UGantryGameFeatureAction
Game feature action whose activation can finish asynchronously, awaited by experience loading.
A game feature action is a step a game feature plugin runs when it activates: add a component, register a widget, load some data. Put your action in a Game Feature Data's Actions list. When an experience activates that plugin, its loading screen stays up until every Gantry action has called Finish Activation.
Gantry does not ship ready-made actions such as Add Components or Add Widgets. Your game makes the ones it needs from this class. The one Gantry ships is Patch Data (UGantryGameFeatureAction_DataPatches), which changes data values and table rows while the feature is active.
In Blueprint
Create a Blueprint class of Gantry Game Feature Action and add it to a Game Feature Data's Actions list.
- Implement Begin Activation. It receives the game worlds the plugin is activating for. Call Finish Activation when the work is done, which may be several frames later. Without an implementation the action finishes at once.
- Implement End Activation to undo the work.
The action has no world of its own, since one plugin serves every world, so world nodes take one of the worlds as their context. Worlds created after activation are not announced. An action that must reach every future world listens for them itself.
In C++
Override BeginActivation instead of OnGameFeatureActivating, and call FinishActivation when the work is done:
void
void
A synchronous action overrides nothing extra: the default BeginActivation finishes at once. This is the same pattern as an experience stage's BeginStage and FinishStage (see UGantryExperienceStage): override Begin, call Finish.
- Inherits
UGameFeatureAction
Functions
FinishActivation
Reports that the action's work is done.
Only the first call after activation begins counts.
GetActionDisplayName
Name shown in load progress and logs.
Override in Blueprint or C++ (GetActionDisplayName_Implementation).
| Pin | Type | Direction | Description |
|---|---|---|---|
| Return Value | FString | out | The action's name; by default the class display name. |
IsActivating
Whether the action is between Begin Activation and Finish Activation.
| Pin | Type | Direction | Description |
|---|---|---|---|
| Return Value | bool | out | True while activating. |
K2_BeginActivation
The action's work, in Blueprint.
Call Finish Activation when it is done; experience loading waits until then. Without an implementation the action finishes at once.
| Pin | Type | Direction | Description |
|---|---|---|---|
Worlds | TArray<UWorld*> | in | The game and play-in-editor worlds this activation applies to. May be empty when the plugin activates before any game world exists. |
K2_EndActivation
Undo the action's work, in Blueprint.
Runs on deactivation, also for an action that never finished activating.
| Pin | Type | Direction | Description |
|---|---|---|---|
Worlds | TArray<UWorld*> | in | The game and play-in-editor worlds this deactivation applies to. |
C++
Public C++ members that Blueprint does not see.
OnGameFeatureActivating
virtual void
Counts this action as working on the action tracker, then calls BeginActivation.
Final so the counting cannot be skipped: override BeginActivation instead.
OnGameFeatureDeactivating
virtual void
Finishes the action if still working, then calls EndActivation.
Overrides call Super.