UGantryExperienceStage
One step of an experience activation, run in order and awaited.
You add stages to an experience's Stages list and configure each one there. Gantry runs them in order and waits for each to finish before starting the next, so a stage can take as long as it needs. When the experience ends, Gantry undoes them in reverse order.
In Blueprint
Create a Blueprint class of Gantry Experience Stage and implement the Begin Stage event. Call Finish Stage when the work is done: at once, or after a Delay, an async load, anything. A stage that does not implement Begin Stage finishes as soon as it starts. Implement End Stage to undo the work.
Variables marked Instance Editable appear in the experience's Stages list, so each experience configures its own copy. The stage has a world while it runs, so world nodes (Spawn Actor, Delay, Get Game State) work without a context pin.
In C++
Override BeginStage. Call StartStage first, then FinishStage when done, immediately or frames later. The default implementation runs the Blueprint event, or finishes at once without one. Override EndStage to undo the work, and call Super so a Blueprint subclass's End Stage still runs.
Stages run on the game thread. Each activation runs its own copy of the stage, never the object on the experience asset, so a stage may keep state in its variables.
- Inherits
UObject
Properties
| Property | Type | Default | Description |
|---|---|---|---|
bDisabled read-only | bool | False | Skips this stage: it never runs, and is not counted in progress. Useful for switching a step off while testing. |
NetExecution read-only | EGantryStageNetExecution | Everywhere | Which machines run this stage in a networked game. Everywhere by default; ServerOnly for work only the authority does, ClientOnly for presentation a dedicated server does not need. |
Functions
FinishStage
Reports the stage's completion; the experience moves to the next stage, or fails and unwinds when it did not succeed.
Only the first call after the stage begins counts.
| Pin | Type | Direction | Description |
|---|---|---|---|
bSucceeded = true | bool | in | Whether the work succeeded. |
GetStageDisplayName
Name shown in progress reporting.
Override in Blueprint or C++ (GetStageDisplayName_Implementation).
| Pin | Type | Direction | Description |
|---|---|---|---|
| Return Value | FString | out | The stage's display name; by default the class display name in the editor and the class name in packaged builds, where display names are not available. |
GetStageTag
Tag identifying the kind of work, e.g.
Gantry.Experience.Stage.LoadAssets. Override in Blueprint or C++ (GetStageTag_Implementation).
| Pin | Type | Direction | Description |
|---|---|---|---|
| Return Value | FGameplayTag | out | The stage's kind tag; empty by default. |
IsRunning
Whether the stage is running: between Begin Stage and Finish Stage.
| Pin | Type | Direction | Description |
|---|---|---|---|
| Return Value | bool | out | True while running. |
K2_BeginStage
The stage's work, in Blueprint.
Call Finish Stage when it is done, successful or not; until then the experience waits. Without an implementation the stage finishes at once.
| Pin | Type | Direction | Description |
|---|---|---|---|
Context | FGantryExperienceStageContext | in | The run: experience, subsystem, world, and the load scope to nest work in. |
K2_EndStage
Undo the stage's work, in Blueprint.
Runs on deactivation in reverse stage order, and also for a stage that failed or never finished, so it must tolerate both.
| Pin | Type | Direction | Description |
|---|---|---|---|
Context | FGantryExperienceStageContext | in | The run being stood down. |
C++
Public C++ members that Blueprint does not see.
GetWorld
virtual UWorld *
The world of the run this stage belongs to, so Blueprint world nodes work inside a stage.
Returns: The world while the stage is part of a run; null for the stage objects on an experience asset, which never run.
BeginStage
virtual void
Starts the stage.
Overrides call StartStage(OnFinished) first, then FinishStage when complete, which may be immediately. The default implementation runs the Begin Stage Blueprint event when a Blueprint implements it, and otherwise finishes successfully at once.
EndStage
virtual void
Undoes whatever BeginStage did.
Called in reverse order on deactivation, and may be called on a stage that never began or did not finish, so implementations must tolerate both. The default implementation runs the End Stage Blueprint event; overrides call Super.