Event Triggers

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.OnRoamInteract(unit1: UnitObject, units: List[UnitObject])

Occurs when a unit interacts during free roam. If a Talk or Region event exists, they will trigger instead. This event will only trigger if Talk or Region events do not exist at the given location during Free Roam. Can be used for Generic NPC dialogue or for opening a menu when not interacting with other NPC’s or regions.

unit1: UnitObject

The current roam unit.

units: List[UnitObject]

the closest nearby other units.

class app.events.triggers.CombatDeath(unit1: UnitObject, unit2: UnitObject | None, position: Tuple[int, int])

Occurs during combat when any unit dies, including generics. If triggered, will delay the death animation of unit1 until after the attack animation of unit2 finishes.

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.UnitDeath(unit1: UnitObject, unit2: UnitObject | None, position: Tuple[int, int])

Occurs after combat 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.UnitWeaponRankUp(unit: UnitObject, weapon_type: NID, old_wexp: int, rank: str)

Occurs whenever a unit gains a weapon rank.

unit: UnitObject

the unit that increased in weapon rank.

weapon_type: NID

nid of weapon type object

old_wexp: int

old wexp before gaining wexp

rank: str

new weapon rank by letter

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. Intended for title screen cutscenes and frontend presentation logic. Use this instead of “OnStartup” for anything that should be visible on the title screen.

class app.events.triggers.OnStartup

Occurs whenever the engine starts, before “OnTitleScreen”. Intended for backend setup steps (such as ‘speak_style’ configuration). Should not contain cutscenes - use “OnTitleScreen” for those instead.

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

hidden: ClassVar[bool] = True

Whether or not this trigger is selectable. True for deprecated and utility triggers.

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)

class app.events.triggers.Preview(position: Tuple[int, int], region: RegionObject)
position: Tuple[int, int]

the position of the user’s cursor when triggering this event

region: RegionObject

the name of the region that was triggered

class app.events.triggers.EventOnHit(unit1: UnitObject, unit2: UnitObject, position: Tuple[int, int], item: ItemObject, target_pos: Tuple[int, int], mode: str, attack_info: Tuple[int, int])

Plays before a hit, if the unit will hit with this item.

Note: trigger is used nowhere in the engine, but is used in the EventOnHit component.

hidden: ClassVar[bool] = True

Whether or not this trigger is selectable. True for deprecated and utility triggers.

unit1: UnitObject

the unit bearing the item.

unit2: UnitObject

the other unit in combat.

position: Tuple[int, int]

the position of the unit bearing the item.

item: ItemObject

the item/ability that the attacking unit is using.

target_pos: Tuple[int, int]

the position of the other unit.

mode: str

One of (attack, defense), depending on whether the bearer of the item is the one doing this attack, or the other unit is the one doing this attack.

attack_info: Tuple[int, int]

The first element is the number of attacks that have occurred before this one. The second element is the number of subattacks (think brave attacks) that have occurred within this main attack.

class app.events.triggers.EventAfterCombat(unit1: UnitObject, unit2: UnitObject, position: Tuple[int, int], item: ItemObject, target_pos: Tuple[int, int], mode: str)

Plays after combat where unit is using this item.

Note: trigger is used nowhere in the engine, but is used in the EventAfterCombatOnHit and EventAfterCombatEvenMiss component.

hidden: ClassVar[bool] = True

Whether or not this trigger is selectable. True for deprecated and utility triggers.

unit1: UnitObject

the unit bearing the item.

unit2: UnitObject

the other unit in combat.

position: Tuple[int, int]

the position of the unit bearing the item.

item: ItemObject

the item/ability that the attacking unit is using.

target_pos: Tuple[int, int]

the position of the other unit.

mode: str

One of (attack, defense), depending on whether the bearer of the skill/item is the one doing this attack, or the other unit is the one doing this attack.

class app.events.triggers.EventAfterInitiatedCombat(unit1: UnitObject, unit2: UnitObject, position: Tuple[int, int], item: ItemObject, mode: str)

Plays after combat initiated by unit bearing this skill.

Note: trigger is used nowhere in the engine, but is used in the EventAfterInitiatedCombat component.

hidden: ClassVar[bool] = True

Whether or not this trigger is selectable. True for deprecated and utility triggers.

unit1: UnitObject

the unit bearing the skill.

unit2: UnitObject

the other unit in combat.

position: Tuple[int, int]

the position of the unit bearing the skill.

item: ItemObject

the item/ability that the attacking unit is using.

mode: str

One of (attack, defense), depending on whether the bearer of the skill is the one doing this attack, or the other unit is the one doing this attack.

class app.events.triggers.EventOnRemove(unit1: UnitObject)

Plays after skill is removed from a unit.

Note: trigger is used nowhere in the engine, but is used in the EventOnRemove component.

hidden: ClassVar[bool] = True

Whether or not this trigger is selectable. True for deprecated and utility triggers.

unit1: UnitObject

the unit bearing the skill to be removed.

class app.events.triggers.UnlockStaff(unit1: UnitObject, position: Tuple[int, int], item: ItemObject, region: RegionObject)

Plays when an unlock staff unlocks a region.

Note: trigger is used nowhere in the engine, but is used in the UnlockStaff component.

hidden: ClassVar[bool] = True

Whether or not this trigger is selectable. True for deprecated and utility triggers.

unit1: UnitObject

the unit that is unlocking.

position: Tuple[int, int]

the position of the unlocking unit.

item: ItemObject

the item/ability that the unlocking unit is using.

region: RegionObject

the region being unlocked.