0xF0 — anim_frame_trigger
Special opcode whose default cursor behavior consumes only the header. It branches on the command word mode nibble (word >> 28) & 7. Sampled mode 0 records are used with marker_seek; mode 2 resolves a character/person and calls CCharacterPerson::SetSchedulePercent(bits 8-27). Mode 7 sets bit 0x20 in the active SCR_DATA byte. Mode 3 is a no-op to the script stepper: it is an **animation frame trigger** consumed by CCharacterAnim::ChangeFrame_sub (0x002A4A20), which walks the character EVD's marker table, reads each marker's first word, extracts a signed 20-bit frame from bits 8-27 (mode 7 = frame infinity, the end sentinel), and when the playing animation reaches that frame sets the script cursor to the marker and runs AnimationSeqProc(). Bit 31 is the standard keep-going bit. EVDSRC spells these marker id=N (mode 0), anim_frame_trigger frame=N (mode 3), set_schedule_percent percent=N (mode 2) and anim_script_end (0xF00000F0); the remaining modes keep the raw special_f0 form.
proven— handler traced, and exercised by at least one shipped script.
At a glance
| Opcode | 0xF0 (240) |
|---|---|
| Handler | CRadiScript::Command_f0 |
| Signature | CRadiScript::Command_f0(int,SCR_DATA*,unsigned int,unsigned int) |
| Translation unit | r_script_runf.cpp |
| Address | — debug build; click for all 3 |
| Handler size | 0x108 (264 bytes) |
| Family | Markers and return |
| Command size | Always 4 bytes — opcodes >= 0xF0 ignore the extra-word count. |
Documented forms
This opcode is documented under more than one name, one per branch of the handler. They are the same opcode and the same handler; which branch runs is chosen by the argument byte or a control word.
| Form | Engine name | What it does |
|---|---|---|
anim_script_end | — | Marks the end of a character animation script: the sentinel the animation stepper stops at rather than an action on the scene. |
marker | — | A labelled point. Inert when executed; marker seeks and the marker table jump to it. |
special_f0 | — | Raw form of the F0 marker family. Prefer anim_frame_trigger, set_schedule_percent and anim_script_end, which name what the marker does. |
anim_frame_trigger | — | Fires the commands at this marker when the playing animation reaches the given frame. |
set_schedule_percent | — | Calls SetSchedulePercent with the 20-bit value. |
Handler behaviour
Special opcode whose default cursor behavior consumes only the header. It branches on the command word mode nibble (word >> 28) & 7. Sampled mode 0 records are used with marker_seek; mode 2 resolves a character/person and calls CCharacterPerson::SetSchedulePercent(bits 8-27). Mode 7 sets bit 0x20 in the active SCR_DATA byte. Mode 3 is a no-op to the script stepper: it is an **animation frame trigger** consumed by CCharacterAnim::ChangeFrame_sub (0x002A4A20), which walks the character EVD's marker table, reads each marker's first word, extracts a signed 20-bit frame from bits 8-27 (mode 7 = frame infinity, the end sentinel), and when the playing animation reaches that frame sets the script cursor to the marker and runs AnimationSeqProc(). Bit 31 is the standard keep-going bit. EVDSRC spells these marker id=N (mode 0), anim_frame_trigger frame=N (mode 3), set_schedule_percent percent=N (mode 2) and anim_script_end (0xF00000F0); the remaining modes keep the raw special_f0 form.
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 | 0xF0 |
+----------------+----------------+----------------+----------------+Because this opcode is >= 0xF0, the stepper consumes only the header and ignores the extra-word count. The payload therefore lives in the header word itself — see §4 0xF0 markers.
Operand fields
7 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 |
|---|---|---|
frame | input | Signed animation frame at which this marker fires. |
id | input | Identifier for the thing this command acts on. |
key | derived | Derived selector unpacked from raw, cross-checked when compiling. |
mode | derived | Handler path selector taken from the argument byte. The meaning is specific to each command. |
percent | input | The 20-bit value passed to the schedule call. |
raw | derived | The entire command word, which is the whole payload for opcodes >= 0xF0; the compile authority for this line. |
yield | input | 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:
CCharacterManager::GetCharacterSubManager(int)CCharacterPerson::SetSchedulePercent(unsigned int)GetAbstractionCharacterNumber(unsigned int&)
Bit masks
Masks the handler applies to its argument byte or operand words:
0x0007