Event Triggers
- class app.events.triggers.EventTrigger
A trigger called sometime during the engine that allows the user to execute events.
- class app.events.triggers.GenericTrigger(unit1: UnitObject = None, unit2: UnitObject = None, position: Tuple[int, int] = None, local_args: Dict[str, Any] = None)
A generic trigger containing common fields. Use to trigger anonymous events.
- class app.events.triggers.LevelStart
Occurs at the very beginning of a level. The chapter screen and title is usually displayed here, as well as introductory cinematics.
- class app.events.triggers.LevelEnd
This occurs once win_game is set in another event. This is called at the end of gameplay, and usually handles end cinematics before going to the save screen or overworld.
- class app.events.triggers.OverworldStart
Occurs upon entering the overworld.
- class app.events.triggers.LevelSelect
Occurs when an overworld entity is about to issue a move to the node containing the next level. Because of implementation detail, when this event occurs, it supersedes any queued moves. Therefore, the entity will not move to the selected node. Any events that use this trigger should include a scripted move if movement is desired.
- class app.events.triggers.PhaseChange(team: str)
Occurs whenever the phase changes.
- team: str
contains the NID of the team of the new phase
- class app.events.triggers.TurnChange
Occurs immediately before turn changes to Player Phase. Useful for dialogue or reinforcements.
- class app.events.triggers.EnemyTurnChange
Occurs immediately before turn changes to Enemy Phase. Useful for “same turn reinforcements” and other evil deeds.
- class app.events.triggers.Enemy2TurnChange
Occurs immediately before turn changes to Second Enemy’s Phase.
- class app.events.triggers.OtherTurnChange
Occurs immediately before turn changes to Other Phase.
- class app.events.triggers.OnRegionInteract(unit1: UnitObject, position: Tuple[int, int], region: RegionObject)
Occurs when a unit interacts with an event region. All event region type events (like Shop, Armory, Visit, etc.) follow this trigger’s format.
- unit1: UnitObject
the unit that is interacting
- position: Tuple[int, int]
the position of the unit.
- region: RegionObject
the event region.
- class app.events.triggers.UnitDeath(unit1: UnitObject, unit2: UnitObject | None, position: Tuple[int, int])
Occurs when any unit dies, including generics.
- unit1: UnitObject
the unit that died.
- unit2: UnitObject | None
the unit that killed them (can be None).
- position: Tuple[int, int]
the position they died at.
- class app.events.triggers.UnitWait(unit1: UnitObject, position: Tuple[int, int], region: RegionObject | None, actively_chosen: bool)
Occurs when any unit waits.
- unit1: UnitObject
the unit that waited.
- position: Tuple[int, int]
the position they waited at.
- region: RegionObject | None
region under the unit (can be None)
- actively_chosen: bool
boolean for whether the player actively selected Wait
- class app.events.triggers.UnitSelect(unit1: UnitObject, position: Tuple[int, int])
Occurs when a unit is selected by the cursor.
- position: Tuple[int, int]
the position they were selected at.
- class app.events.triggers.UnitDeselect(unit1: UnitObject, position: Tuple[int, int])
Occurs when a unit selected by the cursor is deselected.
- position: Tuple[int, int]
the position they were deselected at.
- class app.events.triggers.UnitLevelUp(unit1: UnitObject, stat_changes: Dict[NID, int], source: str)
Occurs whenever a unit levels up.
- unit1: UnitObject
the unit that changed their level.
- stat_changes: Dict[NID, int]
a dict containing their stat changes.
- source: str
One of (‘exp_gain’, ‘stat_change’, ‘class_change’, ‘promote’, ‘event’) describing how the unit got to this point.
- class app.events.triggers.DuringUnitLevelUp(unit1: UnitObject, stat_changes: Dict[NID, int], source: str)
Occurs during a unit’s level-up screen, immediately after stat changes are granted. This event is useful for implementing level-up quotes.
- unit1: UnitObject
the unit that gained/lost stats.
- stat_changes: Dict[NID, int]
a dict containing their stat changes.
- source: str
One of (‘exp_gain’, ‘stat_change’, ‘class_change’, ‘promote’) describing how the unit got to this screen.
- class app.events.triggers.CombatStart(unit1: UnitObject, unit2: UnitObject, position: Tuple[int, int], item: ItemObject, is_animation_combat: bool)
Occurs when non-scripted combat is begun between any two units. Useful for boss quotes.
- unit1: UnitObject
the unit who initiated combat.
- unit2: UnitObject
the target of the combat (can be None).
- position: Tuple[int, int]
contains the position of unit1.
- item: ItemObject
the item/ability used by unit1.
- is_animation_combat: bool
a boolean denoting whether or not we are in an actual animation or merely a map animation.
- class app.events.triggers.CombatEnd(unit1: UnitObject, unit2: UnitObject, position: Tuple[int, int], item: ItemObject, playback: List[PlaybackBrush])
This trigger fires at the end of combat. Useful for checking win or loss conditions.
- unit1: UnitObject
the unit who initiated combat.
- unit2: UnitObject
the target of the combat (can be None).
- position: Tuple[int, int]
contains the position of unit1.
- item: ItemObject
the item/ability used by unit1.
- playback: List[PlaybackBrush]
a list of the playback brushes from the combat.
- class app.events.triggers.OnTalk(unit1: UnitObject, unit2: UnitObject, position: Tuple[int, int])
This trigger fires when two units “Talk” to one another.
- unit1: UnitObject
the unit who is the talk initiator.
- unit2: UnitObject
the unit who is the talk receiver.
- position: Tuple[int, int]
the position of unit1 (is None if triggered during free roam)
- class app.events.triggers.OnSupport(unit1: UnitObject, unit2: UnitObject, position: Tuple[int, int], support_rank_nid: NID, is_replay: bool)
This trigger fires when two units “Support” to one another.
- unit1: UnitObject
the unit who is the support initiator.
- unit2: UnitObject
the unit who is the support receiver.
- position: Tuple[int, int]
the position of unit1 (could be None, for instance during Base).
- support_rank_nid: NID
contains the nid of the support rank (e.g. A, B, C, or S)
- is_replay: bool
whether or not this is just a replay of the support convo from the base menu.
- class app.events.triggers.OnBaseConvo(base_convo: str, unit: str)
This trigger fires when the player selects a base conversation to view.
- base_convo: str
contains the name of the base conversation.
- class app.events.triggers.OnPrepStart
Occurs each time the player enters preps.
- class app.events.triggers.OnBaseStart
Occurs each time the player enters base.
- class app.events.triggers.OnTurnwheel
Occurs after the turnwheel is used. Events that happen within are not recorded within the turnwheel and therefore will not be reversed upon turnwheel activation.
- class app.events.triggers.OnTitleScreen
Occurs before the title screen is shown.
- class app.events.triggers.OnStartup
Occurs whenever the engine starts.
- class app.events.triggers.TimeRegionComplete(position: Tuple[int, int], region: RegionObject)
Occurs when a time region runs out of time and would be removed.
- position: Tuple[int, int]
the position of the region that has run out of time.
- region: RegionObject
the region that has run out of time.
- class app.events.triggers.OnOverworldNodeSelect(entity_nid: str, node_nid: str)
Occurs when an entity is about to issue a move to a node (which may or may not contain the next level, or any level at all). Because of implementation detail, when this event occurs, it supersedes any queued moves. Therefore, the entity will not move to the selected node. Any events that use this trigger should include a scripted move if movement is desired.
- entity_nid: str
Contains the id of entity that will issue a move.
- node_nid: str
Contains the id of the node.
- class app.events.triggers.RoamPressStart(unit1: UnitObject, unit2: UnitObject)
Occurs when the start key is pressed in Free Roam.
- unit1: UnitObject
The current roam unit.
- unit2: UnitObject
the closest nearby other unit.
- class app.events.triggers.RoamPressInfo(unit1: UnitObject, unit2: UnitObject)
Occurs when the info key is pressed in Free Roam.
- unit1: UnitObject
The current roam unit.
- unit2: UnitObject
the closest nearby other unit.
- class app.events.triggers.RoamPressAux(unit1: UnitObject, unit2: UnitObject)
Occurs when the aux key is pressed in Free Roam.
- unit1: UnitObject
The current roam unit.
- unit2: UnitObject
the closest nearby other unit.
- class app.events.triggers.RoamingInterrupt(unit1: UnitObject, position: Tuple[int, int], region: RegionObject)
Occurs when the player enters an interrupt region on the map.
- unit1: UnitObject
The current roam unit.
- position: Tuple[int, int]
The position of the current roam unit
- region: RegionObject
The region that was triggered.
- class app.events.triggers.RegionTrigger(nid: NID, unit1: UnitObject, position: Tuple[int, int], region: RegionObject, item: ItemObject = None)
Special trigger. This trigger has a custom nid, and will be created whenever you make an interactable event region.
- nid: NID
the nid of the region event
- unit1: UnitObject
The unit triggering the region
- position: Tuple[int, int]
The position of the unit triggering the region
- region: RegionObject
the name of the region that was triggered
- item: ItemObject = None
the item used to trigger this region (used with unlock staves and keys)