Skip to content

IfAction ​

Inherits: EventAction < Resource

A conditional action that only executes its child actions if all conditions are met. This is different from event conditions because it's evaluated at action execution time, not at event trigger time, allowing for dynamic decision making during an event.

Properties ​

Array[Condition]conditions[]
Array[EventAction]if_true_actions[]
Array[EventAction]if_false_actions[]
boolwait_for_actionstrue

Variables ​

Eventparent_eventnull
Array[EventAction]current_branch[]
Array[bool]completed_actions[]
boolcondition_evaluatedfalse
boolcondition_resultfalse

Methods ​

voidset_system_hub( p_system_hub: GameHost.SystemHub )
Stringget_function_description()
voidset_parent_event( event: Event )
voidcleanup()
voidforce_complete()
voidreset()
Dictionarysave()
voidload_data( data: Dictionary )

Property descriptions ​

Array[Condition] conditions = [] ​

Array of conditions that must be met for the actions to execute

Array[EventAction] if_true_actions = [] ​

Actions to execute if conditions are met

Array[EventAction] if_false_actions = [] ​

Optional actions to execute if conditions are NOT met

bool wait_for_actions = true ​

Whether to complete this action when all child actions are complete

Variable descriptions ​

Event parent_event = null ​

Reference to parent event (set by Event when action starts)

Array[EventAction] current_branch = [] ​

Tracks the active branch for completion tracking

Array[bool] completed_actions = [] ​

Tracks which actions have completed

bool condition_evaluated = false ​

Whether we've decided the condition result

bool condition_result = false ​

Result of the condition check

Method descriptions ​

void set_system_hub( p_system_hub: GameHost.SystemHub ) ​

Gives the action, its conditions and its child actions the hub of the game systems.

String get_function_description() ​

Return a description of this action with parameter placeholders

void set_parent_event( event: Event ) ​

Set the parent event (called by Event before starting action)

void cleanup() ​

Override cleanup to disconnect from child actions

void force_complete() ​

Override force_complete to force-complete all child actions

void reset() ​

Override reset to reset all child actions

Dictionary save() ​

Override save to include child action states

void load_data( data: Dictionary ) ​

Override load_data to restore child action states