0x03 — trigger
Builds an RVTC_DATA-like trigger record from the command stream. Depending on handler_arg_byte >> 6, it registers a trigger in the eight SCR_DATA+0x80 slots, calls CVariousTrigger::Checking(RVTC_DATA*), or clears matching trigger slots.
proven— handler traced, and exercised by at least one shipped script.
At a glance
| Opcode | 0x03 (3) |
|---|---|
| Handler | CRadiScript::Command_03 |
| Signature | CRadiScript::Command_03(int,SCR_DATA*,unsigned int,unsigned int) |
| Translation unit | r_script_run0.cpp |
| Address | — debug build; click for all 3 |
| Handler size | 0x3EC (1004 bytes) |
| Family | Script control, flags and values |
| Command size | 4 + extra_words * 4 bytes |
Handler behaviour
Builds an RVTC_DATA-like trigger record from the command stream. Depending on handler_arg_byte >> 6, it registers a trigger in the eight SCR_DATA+0x80 slots, calls CVariousTrigger::Checking(RVTC_DATA*), or clears matching trigger slots.
Encoding
The command header is one 32-bit word, as described in §3 Instruction encoding:
31 24 23 16 15 8 7 0
+----------------+----------------+----------------+----------------+
| flags | argument byte | extra words | 0x03 |
+----------------+----------------+----------------+----------------+Bits 8–15 give the number of 32-bit operand words that follow. Bits 16–23 are handed to the handler as a bitfield; on character commands bit 0 normally says whether a character selector word is present. Bit 31 is the keep-going bit.
Operand fields
8 documented fields. input fields are read from the command's operand words; derived fields are computed from other fields rather than stored separately.
| Field | Role | Meaning |
|---|---|---|
action | input | What to do with the trigger record, from the top two bits of the argument byte: 0/1 store it in a free wait slot, 2 test it now, 3 clear matching slots. |
arg | input | Raw handler argument byte from the command header. It is printed only when it differs from the value the named fields already imply, so seeing it means the command uses an unusual argument encoding. |
character | input | The packed 32-bit character selector word. Its low half is the character id and byte 2 is a secondary class/variant input; see character_number and character_variant. |
name | input | Object or animation name this line acts on, as text. The engine reads it as a NUL-terminated string; name_fill covers the bytes after the terminator. |
trigger_flags | input | Upper half of the first operand, copied into the record. |
trigger_type | input | Trigger type byte, choosing what is waited on (0x01 timer, 0x03 fade, 0x04 dialogue, 0x0B movie). |
trigger_value | input | Payload for trigger types 1, 7, 0x0C, and some 0x0B cases; for a timer this is the duration as a float. |
yield | derived | Pause the script here for one game frame; the next command runs on the following update. Lines without it keep running immediately. |
Engine calls
Engine functions this handler was observed calling:
CRadiScript::GetAbstractionCharacterNumber(unsigned int&,unsigned int&,const SCR_DATA*)CSsfHandler::SearchName(const char*) constCVariousTrigger::Checking(RVTC_DATA*)memset
Bit masks
Masks the handler applies to its argument byte or operand words:
0x0001 0xFFFF 0x00FF 0x0003 0x000F