Skip to content

EventAction ​

Inherits: Resource

Inherited by: AbandonQuestAction, ActivateQuestAction, ActivateQuestLineAction, AddItemsToInteractableAction, AddPlayerToPartyAction, AdvanceTimeAction, AwaitAction, CameraShakeAction, ChangeEncounterBehaviorAction, ChangePartySizeAction, ChangeWorldAction, CinematicAction, ClearContainerAction, ClearEnvironmentLookAction, CompleteQuestAction, CompleteQuestObjectiveAction, ControlDoorAction, CreateVFXAction, CutsceneAction, DamageInteractableAction, DestroyInteractableAction, DismountEntityAction, DropItemAction, FailQuestAction, FailQuestObjectiveAction, ForceEncounterCombatAction, ForceGameOverAction, ForceTeleportEntityAction, GrantEffectToEntityAction, GrantEffectToInteractableAction, GrantRewardAction, IfAction, KillAllEncounterEntitiesAction, KillEntityAction, LockObjectAction, ManipulateCameraAction, ManipulateLocalFloatVariableAction, ManipulateLocalIntVariableAction, ManipulateLocalStringVariableAction, ModifyGlobalVariableAction, MountEntityAction, PlaySFXAtPositionAction, PlaySFXGlobalAction, PlayStingerAction, PlayVoiceLineAction, PlayerEventAction, PopupAction, ReleaseWeatherAction, RemoveAllEffectsFromEntityAction, RemoveAllEffectsFromInteractableAction, RemoveEffectFromEntityAction, RemoveEffectFromInteractableAction, RemoveItemsFromContainerAction, RemovePlayerFromPartyAction, RepairInteractableAction, ResetSpawnerAction, RunEventAction, RunLocalEventAction, SayAction, ScreenLookAction, SetAmbientTrackAction, SetConversationResponseStateAction, SetConversationStartingChatAction, SetEntityActiveStateAction, SetEntityBehaviorScriptAction, SetEntityCombatScriptAction, SetEntityFactionAction, SetEntityPositionAction, SetEnvironmentConfigAction, SetGlobalVariableAction, SetGroundWeatherAction, SetInteractablePositionAction, SetLocalBoolVariableAction, SetLocalFloatVariableAction, SetLocalIntVariableAction, SetLocalStringVariableAction, SetMusicIntensityAction, SetMusicStateAction, SetMusicTrackAction, SetPackActiveStateAction, SetPrimaryInteractionAction, SetRabbitHoleDestinationAction, SetRabbitHoleStateAction, SetResponsesByTagAction, SetSkyConfigAction, SetSpawnerActiveAction, SetSunConfigAction, SetSwitchStateAction, SetTimeConfigAction, SetTimeOfDayAction, SetTrapStateAction, SetVehicleHijackableAction, SetWeatherAction, SetWeatherIntensityAction, SpawnEntityAction, SpawnFromTableAction, SpawnInteractableAction, SpawnSoundAction, SpawnWorldEffectAction, StopSoundAction, SwitchAction, ToggleLocalVariableAction, ToggleSwitchAction

Base class for all event actions. Actions define behaviors that can be triggered as part of an event. This is an abstract class that should be extended by specific action types.

Variables ​

EventActionStatestateEventActionState.NOT_STARTED
GameHost.SystemHubsystem_hub

Methods ​

voidset_system_hub( p_system_hub: GameHost.SystemHub )
Stringget_display_name()
Stringget_function_description()
voidstart()
voidcleanup()
voidcomplete()
voidforce_complete()
voidfail( reason: String = "" )
voidreset()
boolis_completed()
Dictionarysave()
voidload_data( data: Dictionary )
voidresume()

Signals ​

event_action_completed( action: EventAction ) ​

Signal emitted when the action completes

event_action_failed( action: EventAction ) ​

Signal emitted when the action fails

event_action_state_changed( action: EventAction, new_state: int ) ​

Signal emitted when the action state changes

Enumerations ​

enum EventActionState ​

Possible states for an action

  • NOT_STARTED = 0 - Action hasn't been triggered yet
  • IN_PROGRESS = 1 - Action is currently running
  • COMPLETED = 2 - Action has successfully completed
  • FAILED = 3 - Action has failed to complete

Variable descriptions ​

EventActionState state = EventActionState.NOT_STARTED ​

Current state of the action

GameHost.SystemHub system_hub ​

GameHost access for action flexability

Method descriptions ​

void set_system_hub( p_system_hub: GameHost.SystemHub ) ​

Gives the action the hub of the game systems.

String get_display_name() ​

Return the display name of this Action

String get_function_description() ​

Return a description of this action with parameter placeholders

void start() ​

Start the action

void cleanup() ​

Clean up resources

void complete() ​

Complete the action

void force_complete() ​

Force-complete the action

void fail( reason: String = "" ) ​

Fail the action. The reason is written to the Godot output as a warning, so a developer can see why an event stopped

void reset() ​

Reset the action to its initial state

bool is_completed() ​

Check if the action is completed

Dictionary save() ​

Save action state to a dictionary

void load_data( data: Dictionary ) ​

Load action state from a dictionary

void resume() ​

Run an action that was in progress when the game was saved again from its start (the Event does this after it has loaded all its actions)