Script events¶
The messages scripts subscribe to with SetMsgHandler(object, message, callback), and the same
messages for a whole gang with GangSetMsgHandler(gang, message, callback): a human's event goes to its
own handlers, then to its gang's (AI: gang events). The arguments
each message's callback gets are in Scripts: message handlers.
The meaning of a message is read from its sender where that is traced, else from the names of the
callbacks scripts give it.
What is complete
Every message number a script uses with either binding is listed; the senders of 3, 4, 5 and 8 are traced, the other meanings are inferred from callback names.
16 entries. Data: research/references/script-events.yaml.
Entries¶
| Message | Meaning | Handlers | Example callbacks | Gang handlers | Example gang callbacks |
|---|---|---|---|---|---|
| 0 | 2 | PARTY.ActionCatch, C5.OpenAllDoors |
|||
| 1 | Damage taken (DamageHandler, BossHealth). |
131 | C2.DamageHandler, C5.BossHealth, LCCheer, HotDogGuyDamage, BandMeleeMove |
80 | C1.TacticGangDamage, C0.Damage, F.RiotPedHit, OrphanDamaged, PARTY.Damage |
| 2 | A scripted object or character finished or broke (AjaxDead, FortBroken, LaunchMissionFailed). |
132 | SwitchNodeStack, F1.AjaxDead, F1.SwanDead, C1.FortBroken, LaunchMissionFailed |
214 | MrWolf, df.DealerDied, DestroyerDied, P2.CheckDead01, P1.CheckDead01 |
| 3 | A human entered a volume box or an object's trigger sphere; (self, human) (Triggers). |
567 | ObjectiveEnter, GlowGoAway, EnterBoxEvent, GS.RunnerEventTriggered, AddSuspend |
||
| 4 | A human left a volume box or trigger sphere, or died inside it; (self, human). |
137 | GlowComeBack, ObjectiveExit, ExitBoxEvent, ExitInteriorCam, C7.EndButton |
||
| 5 | A human is still inside a volume box or trigger sphere (at most once per repeat period); (self, human). |
37 | ObjectiveEnter, VandalTwiggy, C5.CheckBox, VandalMarcello, VandalChuck |
||
| 6 | A store was damaged or vandalised (StoreDamaged, SetStoreBars). |
29 | SetStoreBars, C1.CleonTrashStore, AwardDamage, C3.CHVandleRespond, StoreDamaged |
||
| 7 | An object was stolen (ObjectStolen). |
2 | C2.TheftCallback, ObjectStolen |
||
| 8 | A human arrived at a flag (GoalMoveToFlag); (flag, human). |
121 | df.RestoreDealersBrains, P1.Walk03, P3.InsideGate, C2.BanterPassive, P3.AccountantDone |
||
| 10 | A character saw the player (SeePlayer). |
6 | coney.SeePlayer, SecuritySeePlayer, P3.AccountantDonePlayer, ch4.StopPornoChat, freedom.CopGoesForPlayer |
3 | PlumbBackupTalk1, VoodooBackupTalk1, WarehouseDestroyerTalk1 |
| 11 | A character spotted someone (PlayerSpotted, PlayerSawStalker). |
13 | BopStopTag1, ToolSeePlayer, P3.AccountantDoneSpot, vigilante.PlayerSawStalker, P3.PlayerSpotted |
5 | P3.HunsSpotPlayer, P2.LootersSpotPlayer, P4.EngageEnemy, P2.CopSpotPlayer, C1.LiquorDestroyerTalkTriggered |
| 14 | A tag (graffiti) was finished (GangTagComplete). |
23 | GangTagComplete, WarrTag1Complete, C4.BonusTagComplete, C1.GangTagComplete, WarrTag2Complete |
||
| 16 | A character was attacked (DealerAttacked, DealerHit). |
6 | Brawl, P3.DealerHit, roam.MiniGameDamage, flashhead.DealerAttacked |
||
| 17 | Arrested or released from arrest (ImArrestedAndICantGetUp, CochiseUnarrested). |
19 | ImArrestedAndICantGetUp, CochiseUnarrested, VerminUnarrested, C2.ArrestedWarpOut, C4.ArrestedPoolHall |
76 | CheckPlayerArrested, PigArrested, F.TopsideGangArrested |
| 18 | A human died or was knocked out (StandardGang1Dead, AjaxDead). |
162 | StandardGang1Dead, StandardGang2Dead, F1.AjaxDead, F1.SwanDead, P6.NewWarrior |
210 | CheckPlayerDead, DestroyerDied, P2.CheckDead01, P1.CheckDead01, P2.CheckDead02 |
| 19 | A human came back (revived) (StandardGang1Lives, FoxRevived). |
73 | StandardGang1Lives, StandardGang2Lives, FoxRevived, CowboyRevived, AddToMap |
Sources and evidence¶
Evidence levels used: confirmed-code, inferred.
- every script, SetMsgHandler and GangSetMsgHandler
- the box and sphere updates, 0x00415378 and 0x004146e0
- the flag's message handler, 0x00416038
Fields¶
| Field | Type | Hand-written | Meaning |
|---|---|---|---|
id |
int | Message number (SetMsgHandler's second argument). |
|
meaning |
str | yes | What the message reports, in our words. |
handlers |
int | How many SetMsgHandler calls name a callback for it. |
|
clears |
int | How many calls pass nil (removing a handler). | |
examples |
list | The most common callback names (evidence for the meaning). | |
gang_handlers |
int | How many GangSetMsgHandler calls name a callback for it. |
|
gang_clears |
int | How many GangSetMsgHandler calls pass nil. |
|
gang_examples |
list | The most common gang callback names. | |
source |
str | yes | Where the entry comes from: a script and binding, an address, a chunk. |
evidence |
str | yes | How we know: confirmed-code, confirmed-runtime, inferred or speculative (evidence levels). |
notes |
str | yes | Our own short notes. |