Class AGKCharacterBase

Inheritance Relationships

Base Types

  • public ACharacter

  • public IAbilitySystemInterface

  • public IGenericTeamAgentInterface

  • public IGKSelectableInterface (Class IGKSelectableInterface)

Class Documentation

class AGKCharacterBase : public ACharacter, public IAbilitySystemInterface, public IGenericTeamAgentInterface, public IGKSelectableInterface

Base class for Character, Designed to be blueprinted

Public Functions

AGKCharacterBase()
bool IsReplicationPausedForConnection(const FNetViewer &ConnectionOwnerNetViewer)
void OnReplicationPausedChanged(bool bIsReplicationPaused)
virtual void GetLifetimeReplicatedProps(TArray<FLifetimeProperty> &OutLifetimeProps) const override
virtual void BeginPlay() override
virtual void PossessedBy(AController *NewController) override
virtual void UnPossessed() override
virtual void OnRep_Controller() override
void Tick(float Delta) override
bool IsDead()
virtual void Die()
void ReceiveDeath()
void OnDeath_Native()
virtual void Deselect()
virtual void Select()
void OnSelect()
void OnDeselect()
void PostInitProperties() override
void SetupPlayerInputComponent(UInputComponent *PlayerInputComponent) override
void OnSetupPlayerInputComponent(UInputComponent *PlayerInputComponent)

Give the opportunity to user to bind their abilities using a Enum here see BindAbilityActivationFromInputEnum

void OnSetupPlayerInputComponent_Implementation(UInputComponent *PlayerInputComponent)
void BindAbilityActivationFromInputEnum(UInputComponent *PlayerInputComponent, FGKGameplayAbilityInputBinds InputBinds)

Configure input callbacks to directly call the ability system component The num is used to map an action name (enum name) to an input id (enum value) A callaback is setup making the action name key press calling the ability system with the corresponding enum value When abilities are granted they are assigned an input it (enum value) when the action is pressed the ability system will activate the corresponding ability This removes the need for custom setup in blueprint and automate all the input binding boilerplate

void MoveToLocation(FVector loc)
UGKAttributeSet *GetAttributeSet()
void GrantAbility(FGKAbilitySlot Slot, TSubclassOf<UGKGameplayAbility> AbilityClass, int Level = 0)

Can only be called by the Authority,.

void RemoveAbility(FGKAbilitySlot Slot)

Remove ability, if currently active, it will be removed once the activation ends.

void EquipItem(EGK_ItemSlot Slot, TSubclassOf<UGKGameplayAbility> AbilityClass)
int AbilityCount() const
UGKGameplayAbility *GetAbilityInstance(FGKAbilitySlot Slot)
FGameplayAbilitySpecHandle GetAbilityHandle(FGKAbilitySlot Slot)
bool ActivateAbility(FGKAbilitySlot Slot)

Low level ability activation.

void AddPassiveEffect(UGameplayEffect *Effect)
UAbilitySystemComponent *GetAbilitySystemComponent() const override
virtual int32 GetCharacterLevel() const

Returns the character level that is passed to the ability system

virtual bool SetCharacterLevel(int32 NewLevel)

Modifies the character level, this may change abilities. Returns true on success

void ReceiveNewAbility(FGKAbilitySlot Slot, FGameplayAbilitySpec NewAbilAbilitySpecity)
void OnNewAbility_Native(FGameplayAbilitySpec &AbilitySpec)

Client side register the granted ability.

void OnAbilityRemoved_Native(FGameplayAbilitySpec &AbilitySpec)

Client side register the removal.

virtual void OnHealthChanged_Native(const FOnAttributeChangeData &Data)
void ClearGameplayAbilities()
void K2_GetUnitStatic(FGKUnitStatic &UnitStatic, bool &Valid)
FGKUnitStatic *GetUnitStatic()
void OnDataTableChanged_Native()
virtual void LoadFromDataTable(FGKUnitStatic &UnitDef)

Called everytime the Static data is loaded (init & reimport) Needs to be called after ASC get initialized with its Actor info

void OnRep_Team()
void SetGenericTeamId(const FGenericTeamId &TeamID) override
FGenericTeamId GetGenericTeamId() const override

Retrieve team identifier in form of FGenericTeamId

void ReceiveTeamAssigned(FGenericTeamId NewTeam)

Public Members

bool InputsBound
bool bPreviousVisibility

Protected Attributes

TMap<FGKAbilitySlot, FGameplayAbilitySpec> AbilitySpecs
int32 CharacterLevel

The level of this character, should not be modified directly once it has already spawned

UGKAbilitySystemComponent *AbilitySystemComponent

The component used to handle ability system interactions

UGKAttributeSet *AttributeSet

List of attributes modified by the ability system

class UDataTable *UnitDataTable
FName UnitRowName
FGKUnitStatic *UnitStatic

Cached lookup.

FGenericTeamId Team

This is set by the Player Controller on possession.

Friends

friend class UGKAttributeSet
friend class UGKAbilitySystemComponent