GAS Utility - EmbersGames/MurkyDiversMod GitHub Wiki
Murky Divers extensively uses GAS Utility, a framework based on Epic's Gameplay Ability System. For more information, check out their official documentation.
Access the GAS component
Use the GetAbility node to access the given actor’s GAS component, if found.
Gameplay tags operations
You can add or remove gameplay tags on the GAS component to manage the states of your actor. For the state, it’s better to use SetTagCount
.
You can easily register an asynchronous action to be triggered when an actor’s gameplay tags get changed, added, removed or simply to check if it has the specified gameplay tag using these nodes.
Before using these nodes, make sure the target actor’s GAS component is valid. It may not be the case if you trigger them too soon, for example at the Begin Play.
The Wait-
nodes execute the top exec line right after registering, the bottom exec line is executed when the action triggers.
HasGameplayTag
: Returnstrue
if the given GAS comp has the given gameplay tag,false
otherwise.WaitGameplayTagChangeOnActor
: Use this node on the Actor that owns the watched GAS component. You can use theold count
andnew count
to perform checks when the function triggers. Note : when used in multiplayer, the tag count is only replicated when adding or removing the tag (0 or 1), you can’t use the tag count to pass a number > 1 ; use the gameplay events for this.WaitGameplayTagAddToActor
: same asWaitGameplayTagChangeOnActor
, triggers only when the tag is added.WaitGameplayTagRemoveFromActor
: same asWaitGameplayTagChangeOnActor
, triggers only when the tag is removed.
Bind or unbind a change action
After the WaitGameplayTag-
node that binds an action to a gameplay tag operation, you can save the output AsyncAction
and call EndAction
anytime to unbind it, like the following.
Data structures for gameplay events
You can send data with your gameplay events with the following two data structures:
VariableContainer
: A handy container that can take various types of properties, mapped by a name. These objects are useful to replicate data in a multiplayer context.GameplayEventData
: A structure to carry basic predefined information.
Gameplay events operations
These nodes allow you to send or listen to gameplay events, replicated over network or not. Make sure the target actor has a valid GAS component before using them.
SendGameplayEventOnActor
: Sends a gameplay event to the target actor locally. This event is not replicated. As detailed in the Gameplay Tags section events are usually suffixed with_Event
.SendServerGameplayEventMulticast
: Works only on server (host), sends the event to every client including the owning client.SendServerGameplayEventVariableContainerMulticast
: Same asSendServerGameplayEventMulticast
but allows you to pass data with a variable container.SendServerOnlyGameplayEvent
: Sends the gameplay event from a client to the server.SendServerOnlyGameplayEvent_VariableContainer
: Same asSendServerOnlyGameplayEvent
but allows you to pass data with a variable container.WaitGameplayEventOnActor
: Binds an async task that triggers when the event is received. You can extract the data received via Variable container like this
Make sure you’ve used the -VariableContainer
send method to do so, otherwise the extraction will fail.