section_03

UE5
Aura
Udemy
Game
Programming
Author

Serika Yuzuki

Published

October 15, 2023

Sec 03 について

概要

  1. What is Gameplay Ability System: GAS?
    1. Built for Paragon but cancelled
    2. Best for RPGs
  2. Attach Ability System to Characters
    1. It is possible to attach systems to Actor or Actor assosiated Class
      1. In this course, we will attach to both for studying
  3. Setup GAS
    1. Enable Plugin in Plugin Setting and Build.cs
    2. Create Ability System Component both on base-enemy and playerstate
      1. create default object for both abilitySystem and AttributeSet, and set replicated for AbilitySystem
    3. Impliment IAbilitySystemInterface on both characterbase and playerstate
      1. Question Why IAbilitySystemInterface? Why not normal getter?? Answer This is discribed in here
    4. Set player state belonging to controlled player

Distinguish Owner Actor and Avatar Actor. For example, Aura enemy is both owner and avatar, player state is owner, controlled character is avatar.

    1. Consider server side and client side
        - detail will be inplemented in other lec
void AAuraCharacter::InitAbilityActorInfo()
{
    AAuraPlayerState* AuraPlayerState = GetPlayerState<AAuraPlayerState>();
    check(AuraPlayerState);
    AuraPlayerState->GetAbilitySystemComponent()->InitAbilityActorInfo(AuraPlayerState, this);

    AbilitySystemComponent = AuraPlayerState->GetAbilitySystemComponent();
    AttributeSet = AuraPlayerState->GetAttributeSet();
}

void AAuraCharacter::PossessedBy(AController* NewController)
{
    Super::PossessedBy(NewController);

    // Init ability system component for the server
    InitAbilityActorInfo();
}

void AAuraCharacter::OnRep_PlayerState()
{
    Super::OnRep_PlayerState();

    // Init ability system component for the client
    InitAbilityActorInfo();
}

発見

C++のディレクトリ構成を変更する際

  1. マジで面倒なので出来ればやらないこと。
  2. BinaryとIntermediateは消して、直接ディレクトリを編集する
  3. ビルドしなおす。ただRiderでエディタを開いてもコンパイルエラーが出る
  4. Epic Game Launcherから直接開く
  5. Refresh Rider Projectを実行する

iCloudでの作業

やめた方が良い。

resource fork, Finder information, or similar detritus not allowed

こんなエラーを吐いてくるが、

xattr -cr .

これで解決できない。

Server side と Client side の問題

これについては後でじっくりドキュメントを読む必要がありそうだ。

Back to top