Actions System

How to work with the GS_Play action system — triggerable, composable behaviors that fire from scripts, triggers, or code.

The Actions system provides a universal pattern for attaching discrete, reusable behaviors to entities and triggering them from any source — ScriptCanvas, World Triggers, UI buttons, or C++ code. Actions are data-driven components that fire on named channels, enabling composition without custom scripting.

For architecture details, component properties, and creating custom actions in C++, see the Framework API reference.

 

Contents


How Actions Work

An Action is a component you attach to an entity. Each Action has a channel name. When something calls DoAction(channelName) on that entity’s bus, every Action component whose channel matches the name will execute.

This decoupling is the core value — the system that fires DoAction does not need to know what kind of action is attached. You can change, add, or remove action components on an entity without modifying any calling code.

ConceptWhat It Means
ChannelA named string. Actions on the same channel fire together.
CompositionMultiple actions on the same channel execute in parallel — stack components to compose behaviors.
ChainingAn action can fire a different channel on completion, enabling lightweight sequences.

Triggering Actions

ScriptCanvas

[ActionRequestBus → DoAction(channelName)]
    └─► All Action components on this entity with matching channel execute

To know when an action completes:

[ActionNotificationBus → OnActionComplete]
    └─► Action has finished executing

Built-In Actions

GS_Core ships with these ready-to-use actions:

ActionWhat It Does
PrintLogLogs a configurable message to the console. Useful for debugging trigger chains.
ToggleMouseCursorShows or hides the system mouse cursor.

Additional actions are available in other gems (e.g., World Trigger actions in GS_Interaction, dialogue effects in GS_Cinematics).


Common Patterns

World Trigger → Action

A World Trigger detects a collision or interaction event and fires DoAction on its entity. Action components on the same entity respond — one might play a sound, another might set a record, another might toggle an entity.

UI Button → Action

A UI button press fires DoAction with a channel name. Actions handle the response — navigate to a different UI page, start a new game, or toggle the pause menu.

Chaining Actions

Set an action’s “Chain Channel” property to fire a different channel when it completes:

Channel "OpenDoor" → [ToggleEntity action] → chains to "PlayDoorSound" → [AudioEvent action]

Quick Reference

NeedBusMethod / Event
Fire an actionActionRequestBusDoAction(channelName)
Know when an action completesActionNotificationBusOnActionComplete

Glossary

TermMeaning
ActionA component that executes a discrete behavior when triggered on a named channel
ChannelA named string identifier that groups actions — all actions on the same channel fire together
ChainingConfiguring an action to fire a different channel on completion, creating lightweight sequences

For full definitions, see the Glossary.


See Also

For the full API, component properties, and C++ extension guide:

For related systems:


Get GS_Core

GS_Core — Explore this gem on the product page and add it to your project.