### OnInitAbilityActorInfo Event Usage (PlayerState) Source: https://gascompanion.github.io/changelog/pull/57 Example of using the OnInitAbilityActorInfo event from a PlayerState to initialize HUD logic. This is useful when ASC is managed by the PlayerState and needs to be fully available before HUD setup. ```csharp void AMyPlayerState::BeginPlay() { Super::BeginPlay(); // Assuming ASC is available on PlayerState AbilitySystemComponent->OnInitAbilityActorInfo.AddDynamic(this, &AMyPlayerState::HandleAbilityActorInfoGranted); } void AMyPlayerState::HandleAbilityActorInfoGranted(const FGameplayAbilityActorInfo* ActorInfo, const FGameplayAbilityActivationInfo& ActivationInfo) { // Initialize HUD logic here, potentially accessing PlayerController or other relevant actors InitializeHUD(); } ``` -------------------------------- ### Initialize Ability Actor Info for ASC on Pawn Source: https://gascompanion.github.io/changelog/pull/79 Example of granting an Ability Set during pawn initialization when the ASC is directly on the Pawn. This is a suitable place to call GiveAbilitySet(). ```blueprint OnInitAbilityActorInfo ``` -------------------------------- ### OnInitAbilityActorInfo Event Usage (Pawn Core Component) Source: https://gascompanion.github.io/changelog/pull/57 Example of how to use the new OnInitAbilityActorInfo event from a Pawn's Core Component to trigger HUD initialization. This event fires after the ASC is fully initialized and ready. ```csharp void AMyPlayerController::OnPossess(APawn* InPawn) { Super::OnPossess(InPawn); MyPawn = Cast(InPawn); if (MyPawn && MyPawn->CoreComponent) { MyPawn->CoreComponent->OnInitAbilityActorInfo.AddDynamic(this, &AMyPlayerController::HandleAbilityActorInfoGranted); } } void AMyPlayerController::HandleAbilityActorInfoGranted(const FGameplayAbilityActorInfo* ActorInfo, const FGameplayAbilityActivationInfo& ActivationInfo) { // Initialize HUD logic here InitializeHUD(); } ``` -------------------------------- ### Create Blueprint Class with GSCModularCharacter Parent Source: https://gascompanion.github.io/working-with-ai When creating an AI/NPC Character for GAS, inherit from GSCModularCharacter. This class handles GAS setup directly on the Pawn. ```blueprint Create a new Blueprint Class with `GSCModularCharacter` as a parent class (or re-parent your AI Character blueprint to use `GSCModularCharacter`): ``` -------------------------------- ### Implement Jump Ability Logic Source: https://gascompanion.github.io/quick-start In the ActivateAbility event of a Gameplay Ability Blueprint, get the owning actor, cast it to ACharacter, and call the Jump method. ```Blueprint Event ActivateAbility -> GetAvatarActorFromActorInfo -> Cast To BP_Modular_Character -> Jump ``` -------------------------------- ### Integrating IGSCNativeAnimInstanceInterface into a Custom Anim Instance Source: https://gascompanion.github.io/changelog/pull/42 This example demonstrates how to add the IGSCNativeAnimInstanceInterface to a custom Anim Instance class. Replace UAnimInstance with your existing native Anim Instance class. ```cpp // Replace UAnimInstance with w/e native Anim Instance you're already using (ALSAnimInstance, AGRCoreAnimInstance, MIAnimInstance, WhaterAnimInstance, etc.) class UMyAnimInstance : public UAnimInstance, public IGSCNativeAnimInstanceInterface ``` -------------------------------- ### Add Third Person Template Source: https://gascompanion.github.io/quick-start Add the Third Person Template to your project if it's not already included. This provides a base for character setup. ```markdown Add/Import > Add Feature or Content Pack > Blueprint Feature > Third Person ``` -------------------------------- ### Configure Modular Character Components Source: https://gascompanion.github.io/quick-start Set up the Skeletal Mesh, Animation Blueprint, CameraBoom, and FollowCamera components for the modular character. Adjust location and rotation as needed. ```markdown Skeletal Mesh -> SK_Mannequin Anim Class -> ThirdPerson_AnimBP Location Z -> -88 Rotation Z -> -90 ``` -------------------------------- ### OnBeginPlay for ASC on Pawn Source: https://gascompanion.github.io/changelog/pull/79 Alternative for granting Ability Sets when the ASC is on the Pawn, using OnBeginPlay. This is applicable only if the ASC is not held by a GSCModularPlayerState. ```blueprint OnBeginPlay ``` -------------------------------- ### Enable GAS Companion Plugin Source: https://gascompanion.github.io/changelog/pull/77 This JSON snippet shows how to enable the GASCompanion plugin in your project's .uproject file. Ensure the MarketplaceURL is correct for your version. ```json "Plugins": [ { "Name": "GASCompanion", "Enabled": true, "MarketplaceURL": "com.epicgames.launcher://ue/marketplace/product/d83c6f34c3fb4b7092dde195c37c7413" } ] ``` -------------------------------- ### Add GAS Companion Modules to Build.cs Source: https://gascompanion.github.io/attributes/attributes-wizard Add these module names to your PrivateDependencyModuleNames in your Build.cs file to resolve compilation errors related to GAS Companion. ```csharp PrivateDependencyModuleNames.AddRange(new string[] { "GASCompanion", "GameplayAbilities", "GameplayTasks", "GameplayTags" }); ``` -------------------------------- ### Grant Ability Set using GiveAbilitySet() Source: https://gascompanion.github.io/changelog/pull/79 Grants an Ability Set to the Ability System Component (ASC), adding its associated Abilities, Attributes, Effects, and Owned Tags. This method should be called on both the server and client for proper setup and binding. ```blueprint UGSCAbilitySystemComponent::GiveAbilitySet() ``` -------------------------------- ### Create and Add HUD Widget Source: https://gascompanion.github.io/quick-start On Begin Play, create a new widget that is a child of GSCUWHud and add it to the player screen. ```Blueprint Event BeginPlay -> CreateWidget (Class: WB_HUD_C) -> Add to Player Screen ``` -------------------------------- ### Create AIController Blueprint Source: https://gascompanion.github.io/working-with-ai To manage Behavior Trees for AI Pawns, create a Blueprint class that inherits from AIController. This controller will be responsible for running the Behavior Tree. ```blueprint Create a new Blueprint with `AIController` as a parent class: ``` -------------------------------- ### UGSCAbilitySystemComponent::GiveAbilitySet Source: https://gascompanion.github.io/ability-sets Grants a given Ability Set to the ASC, adding defined Abilities, Attributes, Effects and Owned Tags. This method should be called on both Authority (server) and Client for proper setup, especially for owned tags and input binding. ```APIDOC ## UGSCAbilitySystemComponent::GiveAbilitySet() ### Description Grants a given Ability Set to the ASC, adding defined Abilities, Attributes, Effects and Owned Tags. This method is meant to run on both Authority (must be called from server), and on Client if you'd like to setup binding as well (Important to call on client too for Owned Tags). During Pawn initialization, if you'd like to grant a list of Ability Sets manually with this method, the typical place to do so is: * OnInitAbilityActorInfo (event exposed by both UGSCAbilitySystemComponent and UGSCCoreComponent) * OnBeginPlay but only if ASC is on the Pawn (not using GSCModularPlayerState to hold the ASC) Both Player State pawns and non Player State pawns can use OnInitAbilityActorInfo, while only non Player State pawns can use OnBeginPlay to grant the ability. Also, for input binding to work and register properly, the avatar actor for this ASC must have UGSCAbilityInputBindingComponent actor component. ### Method Blueprint callable ### Parameters * **InAbilitySet** (TSoftObjectPtr) - Required - The Ability Set to grant. ### Notes * For input binding to work, the Avatar Actor needs the UGSCAbilityInputBindingComponent. * Recommended to call on Server and Client. ``` -------------------------------- ### Granting Ability Sets via GSCAbilitySystemComponent Source: https://gascompanion.github.io/ability-sets Demonstrates how to grant an Ability Set using `GiveAbilitySet` on the `GSCAbilitySystemComponent`. This method grants abilities, attributes, effects, and owned tags. It should be called on both server and client for multiplayer games, typically during Pawn initialization. ```csharp UGSCAbilitySystemComponent::GiveAbilitySet() ``` -------------------------------- ### Enable Ability Queue Property on Abilities Source: https://gascompanion.github.io/ability-queue-system For abilities not using Anim Montages, enable the 'bEnableAbilityQueue' property directly on the GSCGameplayAbility. This opens the queue at activation and closes it upon ability end, allowing all abilities. ```blueprint GSCGameplayAbility -> Details Panel -> Enable Ability Queue (bool) ``` -------------------------------- ### Activate Ability by Class Source: https://gascompanion.github.io/quick-start Use the Ability System Component's TryActivateAbilityByClass method to activate an ability. This is a common way to trigger abilities based on game events or input. ```blueprint Ability System Component -> TryActivateAbilityByClass (Class: GA_Jump) ``` -------------------------------- ### Create Game Mode Blueprint Source: https://gascompanion.github.io/quick-start Create a new Blueprint Class inheriting from GameModeBase to manage gameplay rules and framework classes. ```markdown Blueprint Class > GameModeBase ``` -------------------------------- ### Create Modular Character Blueprint Source: https://gascompanion.github.io/quick-start Create a new Blueprint Class inheriting from GSCModularCharacter. This will serve as your player character. ```markdown Blueprint Class > GSCModularCharacter ``` -------------------------------- ### Project Settings for Enhanced Input Source: https://gascompanion.github.io/quick-start Configure project settings to use Enhanced Input by default. This is crucial for versions prior to Unreal Engine 5.1. ```ini [/Script/EnhancedInput.InputSettings] DefaultPlayerInputClass=EnhancedInput.EnhancedPlayerInput DefaultInputComponentClass=EnhancedInput.EnhancedPlayerInputComponent ``` -------------------------------- ### Configure Game Mode Source: https://gascompanion.github.io/quick-start Set the Default Pawn Class and Player Controller Class within the Game Mode Blueprint. Ensure the Default Pawn Class is a child of GSCModularCharacter, GSCModularPawn, or GSCModularPlayerStateCharacter. ```markdown Default Pawn Class -> GSCModularCharacter, GSCModularPawn, or GSCModularPlayerStateCharacter Player Controller Class -> GSCModularPlayerController ``` -------------------------------- ### Header File Implementation for Gameplay Tag Mapping Source: https://gascompanion.github.io/changelog/pull/42 This is the code to be copied into the header file of your Anim Instance when integrating the Gameplay Tag Blueprint Property Mapping. It includes the UPROPERTY declaration and the InitializeWithAbilitySystem override. ```cpp /** * Gameplay tags that can be mapped to blueprint variables. The variables will automatically update as the tags are added or removed. * * These should be used instead of manually querying for the gameplay tags. */ UPROPERTY(EditDefaultsOnly, Category = "GameplayTags") FGameplayTagBlueprintPropertyMap GameplayTagPropertyMap; virtual void InitializeWithAbilitySystem(UAbilitySystemComponent* ASC) override { GameplayTagPropertyMap.Initialize(this, ASC); } ``` -------------------------------- ### Implement Gameplay Tag Property Map Source: https://gascompanion.github.io/animations Copy this code into the header file of your custom Anim Instance. It declares `FGameplayTagBlueprintPropertyMap` and overrides `InitializeWithAbilitySystem` to set up the mapping. ```cpp /** * Gameplay tags that can be mapped to blueprint variables. The variables will automatically update as the tags are added or removed. * * These should be used instead of manually querying for the gameplay tags. */ UPROPERTY(EditDefaultsOnly, Category = "GameplayTags") FGameplayTagBlueprintPropertyMap GameplayTagPropertyMap; virtual void InitializeWithAbilitySystem(UAbilitySystemComponent* ASC) override { GameplayTagPropertyMap.Initialize(this, ASC); } ``` -------------------------------- ### Show Ability Queue Debug Widget Source: https://gascompanion.github.io/ability-queue-system Display the Ability Queue Debug Widget using the console command 'GASCompanion.Debug.AbilityQueue' or programmatically from Blueprints to view the queue's state. ```blueprint GASCompanion.Debug.AbilityQueue ``` ```blueprint Show Debug Widget ``` -------------------------------- ### Grant Ability with Input Action Source: https://gascompanion.github.io/quick-start Configure the Granted Abilities list on the Ability System Component to use a specific Input Action for activation. This links the input event to the ability. ```blueprint Ability System Component -> Granted Abilities -> GA_Jump -> Input Action = IA_Jump ``` -------------------------------- ### GSCUserWidget Functions Source: https://gascompanion.github.io/api/UI/GSCUserWidget This section details the functions available in GSCUserWidget for initializing and retrieving references to owner components and the Ability System Component. ```APIDOC ## SetOwnerActor ### Description Initialize or update references to owner actor and additional actor components (such as AbilitySystemComponent) and cache them for this instance of user widget. ### Parameters - **Actor** (AActor*) - ## InitializeWithAbilitySystem ### Description Runs initialization logic for this UserWidget related to interactions with Ability System Component. Setup AbilitySystemComponent delegates to react to various events. Usually called from NativeConstruct, but exposed there if other classes needs to run initialization logic again to update references. ### Parameters - **AbilitySystemComponent** (UAbilitySystemComponent*) - ## GetPercentForAttributes ### Description Helper function to return percentage from Attribute / MaxAttribute. ### Parameters - **Attribute** (FGameplayAttribute) - - **MaxAttribute** (FGameplayAttribute) - ### Returns `float` ## GetOwningCoreComponent ### Description Returns reference to OwnerCoreComponent for this user widget, if it has been initialized. ### Returns `UGSCCoreComponent*` ## GetOwningActor ### Description Returns reference to OwnerActor for this user widget, if it has been initialized. ### Returns `AActor*` ## GetOwningAbilitySystemComponent ### Description Returns reference to AbilitySystemComponent for this user widget, if it has been initialized. ### Returns `UAbilitySystemComponent*` ``` -------------------------------- ### Implement OnPostGameplayEffectExecute Event Source: https://gascompanion.github.io/attributes/attributes-events Use the OnPostGameplayEffectExecute event to perform actions like clamping attribute values within a specific range. This is useful for ensuring custom attributes stay within defined bounds. ```Blueprint Event OnPostGameplayEffectExecute Switch on Gameplay Attribute Case StatsAttributeSet.Vitality ClampAttributeValue(Attribute=StatsAttributeSet.Vitality, MinValue=0.0, MaxValue=GetAttributeValue(StatsAttributeSet.MaxVitality)) ``` -------------------------------- ### ActivateAbilityByTags Source: https://gascompanion.github.io/api/Components/GSCCoreComponent Attempts to activate a single gameplay ability matching the given tags, checking requirements. ```APIDOC ## ActivateAbilityByTags ### Description Attempts to activate a **single** gameplay ability that matches the given tag and DoesAbilitySatisfyTagRequirements(). It differs from GAS ASC TryActivateAbilitiesByTag which tries to activate _every_ ability, whereas this version will pick a random one and attempt to activate it. Returns true if the ability attempts to activate, and the reference to the Activated Ability if any. ### Parameters #### Path Parameters - **AbilityTags** (FGameplayTagContainer) - Required - Set of Gameplay Tags to search for - **ActivatedAbility** (UGSCGameplayAbility*) - Optional - The Gameplay Ability that was triggered on success (only returned if it is a GSCGameplayAbility) - **bAllowRemoteActivation** (bool) - Required - If true, it will remotely activate local/server abilities, if false it will only try to locally activate abilities. ### Returns `bool` ``` -------------------------------- ### ActivateAbilityByClass Source: https://gascompanion.github.io/api/Components/GSCCoreComponent Attempts to activate a specified gameplay ability class, checking costs and requirements. ```APIDOC ## ActivateAbilityByClass ### Description Attempts to activate the ability that is passed in. This will check costs and requirements before doing so. Returns true if it thinks it activated, but it may return false positives due to failure later in activation. ### Parameters #### Path Parameters - **AbilityClass** (TSubclassOf) - Required - Gameplay Ability Class to activate - **ActivatedAbility** (UGSCGameplayAbility*) - Optional - The Gameplay Ability that was triggered on success (only returned if it is a GSCGameplayAbility) - **bAllowRemoteActivation** (bool) - Required - If true, it will remotely activate local/server abilities, if false it will only try to locally activate abilities. ### Returns `bool` ``` -------------------------------- ### HUD Lazy Initialization Logic Source: https://gascompanion.github.io/changelog/pull/57 This snippet demonstrates the logic for lazy initialization of the ASC in a HUD. It checks every frame until a reference to the ASC can be obtained before proceeding with initialization. ```csharp public void LazyInitializeASC() { if (ASC == null) { ASC = GetAbilitySystemComponent(); if (ASC == null) { // If ASC is still null, try again next frame FTimerDelegate TimerDel; TimerDel.BindUFunction(this, "LazyInitializeASC"); GetWorld()->GetTimerManager().SetTimer(RetryTimerHandle, TimerDel, 0.1f, false); } } if (ASC != null && !bASCInitialized) { // ASC is ready, proceed with initialization InitializeASC(); } } ``` -------------------------------- ### Set Instancing Policy for Jump Ability Source: https://gascompanion.github.io/quick-start Configure the Instancing Policy to 'Instanced Per Actor' in the Class Defaults for abilities that should only have one instance active per owner, such as a basic jump. ```Blueprint Class Defaults -> Advanced -> Instancing Policy: Instanced Per Actor ``` -------------------------------- ### Input Settings Configuration Source: https://gascompanion.github.io/changelog/pull/77 This INI setting configures the input settings for the Unreal Engine project, specifically adding the '²' key to the console keys list. ```ini [/Script/Engine.InputSettings] +ConsoleKeys=² ``` -------------------------------- ### ExecuteGameplayCueWithParams Source: https://gascompanion.github.io/api/Abilities/GSCBlueprintFunctionLibrary Invokes a gameplay cue on an actor's ability system component, including additional parameters. ```APIDOC ## ExecuteGameplayCueWithParams ### Description Invoke a gameplay cue on the actor's ability system component, with extra parameters. ### Parameters #### Path Parameters - **Actor** (AActor*) - Description not provided - **GameplayCueTag** (FGameplayTag) - Description not provided - **GameplayCueParameters** (FGameplayCueParameters) - Description not provided ``` -------------------------------- ### Configure AbilityQueueWindow Notify State Source: https://gascompanion.github.io/ability-queue-system Use the AbilityQueueWindow Anim Notify State in Animation Montages to control when abilities can be queued. Configure 'Allow All Abilities' or specify 'Allowed Abilities' for finer control. ```blueprint AbilityQueueWindow Notify State - Allow All Abilities (bool) - Allowed Abilities (Gameplay Ability List) ``` -------------------------------- ### ExecuteGameplayCueForActor Source: https://gascompanion.github.io/api/Abilities/GSCBlueprintFunctionLibrary Invokes a gameplay cue on an actor's ability system component. ```APIDOC ## ExecuteGameplayCueForActor ### Description Invoke a gameplay cue on the actor's ability system component. ### Parameters #### Path Parameters - **Actor** (AActor*) - Description not provided - **GameplayCueTag** (FGameplayTag) - Description not provided - **Context** (FGameplayEffectContextHandle) - Description not provided ``` -------------------------------- ### Add GSCAbilityInputBinding Component Source: https://gascompanion.github.io/quick-start Add the GSCAbilityInputBinding component to your Character Blueprint. This component handles input mapping context registration for Enhanced Input. ```blueprint Add Component -> GSCAbilityInputBinding ``` -------------------------------- ### GSCAbilitySystemComponent Properties Source: https://gascompanion.github.io/api/Abilities/GSCAbilitySystemComponent Properties that can be configured for the GSCAbilitySystemComponent. ```APIDOC ## Properties ### GrantedAbilities **Type** `Array of FGSCAbilityInputMapping` Granted Abilities: List of Gameplay Abilities to grant when the Ability System Component is initialized. ### GrantedAttributes **Type** `Array of FGSCAttributeSetDefinition` Granted Attributes: List of Attribute Sets to grant when the Ability System Component is initialized, with optional initialization data. ### GrantedEffects **Type** `Array of UGameplayEffect` Granted Effects: List of GameplayEffects to apply when the Ability System Component is initialized (typically on begin play). ### bResetAbilitiesOnSpawn **Type** `bool` Reset Abilities on Spawn: Specifically set abilities to persist across deaths / respawns or possessions (Default is true). When this is set to false, abilities will only be granted the first time InitAbilityActor is called. This is the default behavior for ASC living on Player States (GSCModularPlayerState specifically). Do not set it true for ASC living on Player States if you're using ability input binding. Only ASC living on Pawns supports this. ### bResetAttributesOnSpawn **Type** `bool` Reset Attributes on Spawn: Specifically set attributes to persist across deaths / respawns or possessions (Default is true). When this is set to false, attributes are only granted the first time InitAbilityActor is called. This is the default behavior for ASC living on Player States (GSCModularPlayerState specifically). Set it (or leave it) to true if you want attribute values to be re-initialized to their default values. ``` -------------------------------- ### BTTask_TriggerAbilityByTags Blueprint Source: https://gascompanion.github.io/working-with-ai This Behavior Tree task activates an ability based on specified Gameplay Tags. It searches for and attempts to activate a single ability matching the provided tags. ```blueprint The task will search for all abilities matching the tag requirements, and try to activate a **single** one from one of the matching abilities (See `ActivateAbilityByTags`). The Blueprint Graph for this task, if you would like to use your own Blueprint-based variation: ``` -------------------------------- ### GetMana Source: https://gascompanion.github.io/api/Components/GSCCoreComponent Returns the current mana value. ```APIDOC ## GetMana ### Description Returns the current mana value. ### Returns `float` ``` -------------------------------- ### Wait Input Release and Stop Jumping Source: https://gascompanion.github.io/quick-start Use the Wait Input Release task to react to input being released and call the Stop Jumping method, followed by the Jump method. This ensures the ability doesn't end prematurely if input is held. ```Blueprint Wait Input Release Stop Jumping Jump ``` -------------------------------- ### Gameplay Tag Blueprint Property Mapping in Native Anim Instance Source: https://gascompanion.github.io/changelog/pull/42 This snippet shows how to declare and initialize FGameplayTagBlueprintPropertyMap within a native Anim Instance. It maps gameplay tags to blueprint variables for automatic updates. Use this in your header file. ```cpp // Gameplay tags that can be mapped to blueprint variables. The variables will automatically update as the tags are added or removed. // These should be used instead of manually querying for the gameplay tags. UPROPERTY(EditDefaultsOnly, Category = "GameplayTags") FGameplayTagBlueprintPropertyMap GameplayTagPropertyMap; virtual void InitializeWithAbilitySystem(UAbilitySystemComponent* ASC) override { GameplayTagPropertyMap.Initialize(this, ASC); } ``` -------------------------------- ### Update World Settings Source: https://gascompanion.github.io/quick-start Assign your custom Game Mode to the map by selecting it in the GameMode Override field within the World Settings panel. ```markdown Window > World Settings ``` -------------------------------- ### GSCUWHud Functions Source: https://gascompanion.github.io/api/UI/GSCUWHud This section details the functions available in the GSCUWHud class for updating and initializing HUD elements. ```APIDOC ## GSCUWHud Functions ### SetStaminaPercentage Updates bound health progress bar with the new percent. ### Method Not applicable (Function call within the system) ### Parameters #### Parameters - **StaminaPercentage** (float) - Description not provided in source ### SetStamina Updates bound stamina widgets to reflect the new stamina change. ### Method Not applicable (Function call within the system) ### Parameters #### Parameters - **Stamina** (float) - Description not provided in source ### SetMaxStamina Updates bound stamina widgets to reflect the new max stamina change. ### Method Not applicable (Function call within the system) ### Parameters #### Parameters - **MaxStamina** (float) - Description not provided in source ### SetMaxMana Updates bound mana widgets to reflect the new max mana change. ### Method Not applicable (Function call within the system) ### Parameters #### Parameters - **MaxMana** (float) - Description not provided in source ### SetMaxHealth Updates bound health widgets to reflect the new max health change. ### Method Not applicable (Function call within the system) ### Parameters #### Parameters - **MaxHealth** (float) - Description not provided in source ### SetManaPercentage Updates bound mana progress bar with the new percent. ### Method Not applicable (Function call within the system) ### Parameters #### Parameters - **ManaPercentage** (float) - Description not provided in source ### SetMana Updates bound mana widgets to reflect the new mana change. ### Method Not applicable (Function call within the system) ### Parameters #### Parameters - **Mana** (float) - Description not provided in source ### SetHealthPercentage Updates bound stamina progress bar with the new percent. ### Method Not applicable (Function call within the system) ### Parameters #### Parameters - **HealthPercentage** (float) - Description not provided in source ### SetHealth Updates bound health widgets to reflect the new health change. ### Method Not applicable (Function call within the system) ### Parameters #### Parameters - **Health** (float) - Description not provided in source ### InitFromCharacter Init widget with attributes from owner character. ### Method Not applicable (Function call within the system) ### Parameters No parameters specified in source. ``` -------------------------------- ### GSCGameplayAbility Functions Source: https://gascompanion.github.io/api/Abilities/GSCGameplayAbility This section details the functions available within the GSCGameplayAbility class, which allow for the creation, manipulation, and application of Gameplay Effects. ```APIDOC ## GSCGameplayAbility Functions ### MakeEffectContainerSpecFromContainer Make gameplay effect container spec to be applied later, using the passed in container. **Parameters** Name | Type | Description ---|---|--- Container | FGSCGameplayEffectContainer | EventData | FGameplayEventData | OverrideGameplayLevel | int32 | **Returns** `FGSCGameplayEffectContainerSpec` ### MakeEffectContainerSpec Search for and make a gameplay effect container spec to be applied later, from the EffectContainerMap. **Parameters** Name | Type | Description ---|---|--- ContainerTag | FGameplayTag | EventData | FGameplayEventData | OverrideGameplayLevel | int32 | **Returns** `FGSCGameplayEffectContainerSpec` ### ApplyEffectContainerSpec Applies a gameplay effect container spec that was previously created. **Parameters** Name | Type | Description ---|---|--- ContainerSpec | FGSCGameplayEffectContainerSpec | **Returns** `Array of FActiveGameplayEffectHandle` ### ApplyEffectContainer Applies a gameplay effect container, by creating and then applying the spec. **Parameters** Name | Type | Description ---|---|--- ContainerTag | FGameplayTag | EventData | FGameplayEventData | OverrideGameplayLevel | int32 | **Returns** `Array of FActiveGameplayEffectHandle` ``` -------------------------------- ### BTTask_TriggerAbilityByClass Blueprint Source: https://gascompanion.github.io/working-with-ai Use this Behavior Tree task to activate a specific Gameplay Ability by its class. It exposes an 'AbilityToActivate' property for selection. ```blueprint The Blueprint Graph for this task, if you would like to use your own Blueprint-based variation: ``` -------------------------------- ### Missing UGSCAbilityInputBindingComponent Error Source: https://gascompanion.github.io/ability-sets This error occurs when an Ability Set contains abilities with input bindings, but the Avatar Actor lacks the required `UGSCAbilityInputBindingComponent`. Ensure this component is added to the Avatar Actor for input binding to work. ```plaintext Error trying to grant ability set AS_Default_Test - The set contains Abilities with Input bindings but BP_Character_C_0 is missing the required UGSCAbilityInputBindingComponent actor component. ``` -------------------------------- ### Clearing Ability Sets via GSCAbilitySystemComponent Source: https://gascompanion.github.io/ability-sets Demonstrates how to remove an Ability Set using `ClearAbilitySet` on the `GSCAbilitySystemComponent`. This method reverses the granting process, clearing input bindings, abilities, effects, and attributes. It should be called on both server and client for multiplayer games. ```csharp UGSCAbilitySystemComponent::ClearAbilitySet() ``` -------------------------------- ### SetInputBinding Source: https://gascompanion.github.io/api/Components/GSCAbilityInputBindingComponent Updates or creates an input binding for a given Ability Handle using an Enhanced Input Action and a specified trigger event. ```APIDOC ## SetInputBinding ### Description Updates the Ability Input Binding Component registered bindings or create a new one for the passed in Ability Handle. ### Parameters #### Request Body - **InputAction** (UInputAction*) - Required - The Enhanced InputAction to bind to - **TriggerEvent** (EGSCAbilityTriggerEvent) - Required - The trigger type to use for the ability pressed handle. The most common trigger types are likely to be Started for actions that happen once, immediately upon pressing a button. - **AbilityHandle** (FGameplayAbilitySpecHandle) - Required - The Gameplay Ability Spec handle to setup binding for (handle returned when granting abilities manually with GSCAbilitySystemComponent) ``` -------------------------------- ### Add GSCAbilityQueue Component Source: https://gascompanion.github.io/ability-queue-system Ensure your Pawn or Character has the GSCAbilityQueue actor component for the Ability Queue System to function. This component is not added by default to Modular Actors. ```blueprint Add Component -> Search for GSCAbilityQueue ``` -------------------------------- ### GetCompanionCoreComponent Source: https://gascompanion.github.io/api/Abilities/GSCBlueprintFunctionLibrary Attempts to find and return the companion core component associated with an actor. ```APIDOC ## GetCompanionCoreComponent ### Description Tries to find a companion core component on the actor. ### Parameters #### Path Parameters - **Actor** (AActor*) - Description not provided ### Returns `UGSCCoreComponent*` ``` -------------------------------- ### OnAbilityFailed Source: https://gascompanion.github.io/api/Components/GSCCoreComponent Called when an ability fails to activate for the owner actor, providing the failed ability and a reason tag. ```APIDOC ## OnAbilityFailed ### Description Called when an ability failed to activated for the owner actor, passes along the failed ability and a tag explaining why. ### Parameters #### Event Parameters - **Ability** (UGameplayAbility*) - The failed ability. - **ReasonTags** (FGameplayTagContainer) - Tags explaining the reason for failure. ``` -------------------------------- ### GetActiveAbilitiesByTags Source: https://gascompanion.github.io/api/Components/GSCCoreComponent Returns a list of currently active ability instances that match the given tags. This only returns if the ability is currently running. ```APIDOC ## GetActiveAbilitiesByTags ### Description Returns a list of currently active ability instances that match the given tags. This only returns if the ability is currently running. ### Parameters #### Path Parameters - **GameplayTagContainer** (FGameplayTagContainer) - The Ability Tags to search for ### Returns `Array of UGameplayAbility` ``` -------------------------------- ### Commit and End Ability Source: https://gascompanion.github.io/quick-start Essential methods for Gameplay Abilities: CommitAbility checks and applies costs/cooldowns, while EndAbility terminates the ability. Ensure EndAbility is called to prevent abilities from running indefinitely. ```Blueprint CommitAbility() EndAbility() ```