Skip to content

TimelineAttackLogic ​

Inherits: AttackStateLogic < Resource

TimelineAttackLogic follows a scripted sequence of actions at specific times. Used for Scenario 2 - scripted MMO boss fights with predictable patterns.

Description ​

Example boss timeline:

  • 0s: UseAbilityAction (Fireball)
  • 10s: UseAbilityAction (Summon Adds)
  • 20s: MoveToPointAction (Arena Center)
  • 30s: Loop back to 0s

Between timeline events, the combat script's auto_basic_attack handles filler.

Properties ​

Array[CombatAction]timeline_actions[]
Array[float]action_times[]
boolloop_timelinetrue

Variables ​

Array[TimelineEntry]timeline[]
floattimeline_time0.0
intnext_event_index0
booltimeline_completedfalse

Methods ​

voidsetup( system_hub: GameHost.SystemHub, entity_ref: Entity, script: ModularCombatScript )
boolexecute( delta: float )
voidreset_timeline()
Dictionaryto_save_data()
voidfrom_save_data( save_data: Dictionary )
voidcleanup()

Property descriptions ​

Array[CombatAction] timeline_actions = [] ​

The scripted timeline of actions with their trigger times

Array[float] action_times = [] ​

Times when each action should trigger (must match timeline_actions length)

bool loop_timeline = true ​

Whether the timeline loops

Variable descriptions ​

Array[TimelineEntry] timeline = [] ​

Internal timeline entries (built from actions + times)

float timeline_time = 0.0 ​

Current time in the timeline (seconds)

int next_event_index = 0 ​

Index of the next event to execute

bool timeline_completed = false ​

Whether the timeline has completed (if not looping)

Method descriptions ​

void setup( system_hub: GameHost.SystemHub, entity_ref: Entity, script: ModularCombatScript ) ​

Setup the timeline

bool execute( delta: float ) ​

Execute timeline logic

void reset_timeline() ​

Reset the timeline (useful for phase transitions)

Dictionary to_save_data() ​

Save runtime state

void from_save_data( save_data: Dictionary ) ​

Restore runtime state

void cleanup() ​

Cleanup