death
death executes configured condlists when a stalker dies and stores the killer id in the death scheme state.
Parameters
death reads its configuration indirectly:
on_death
Location: active logic section. Type: section name. Optional.
Names the death configuration section.
on_info
Location: death configuration section. Type: condlist. Optional.
First condlist executed on death.
on_info2
Location: death configuration section. Type: condlist. Optional.
Second condlist executed on death.
Runtime behavior
On reset, the scheme reads on_death from the current logic section. If it is set, the named section must exist. The
scheme then parses on_info and on_info2 from that section.
On death, the manager stores the killer object id, or -1 when no killer is provided. It then evaluates both parsed
condlists with the actor and the dead object as context. The return value is not used for section switching; use effects
inside the condlist for death side effects.
Runtime sequence
SchemeDeath.activatecreates the state for the stalker.SchemeDeath.addsubscribesDeathManager.SchemeDeath.resetreadson_deathfrom the active logic section.- If a death section is named,
on_infoandon_info2are parsed from that section. DeathManager.onDeathstoreskillerIdand evaluates the parsed condlists.
The condlists are evaluated with registry.actor as the first object and the dead stalker as the second object.
Example
[logic]
active = walker@guard
on_death = death@guard
[walker@guard]
path_walk = guard_walk
path_look = guard_look
[death@guard]
on_info = %+guard_dead%
on_info2 = {=killed_by_actor} %+actor_killed_guard%
Notes
- Missing
on_deathis allowed. - If
on_deathnames a section that does not exist, reset aborts. - Use
mob_deathfor monster death callbacks.deathis the stalker scheme.