0x4D — background_auto_rate_anim
Background/global auto-rate animation helper. It calls CAutoRateManager play/stop methods for color, transparency, scale, palette morph, and visibility animation elements.
proven— handler traced, and exercised by at least one shipped script.
At a glance
| Opcode | 0x4D (77) |
|---|---|
| Handler | CRadiScript::Command_4d |
| Signature | CRadiScript::Command_4d(int,SCR_DATA*,unsigned int,unsigned int) |
| Translation unit | r_script_run4.cpp |
| Address | — debug build; click for all 3 |
| Handler size | 0x534 (1332 bytes) |
| Engine name | background_auto_rate_anim |
| Family | Background, map, landscape and camera |
| Command size | 4 + extra_words * 4 bytes |
Handler behaviour
Background/global auto-rate animation helper. It calls CAutoRateManager play/stop methods for color, transparency, scale, palette morph, and visibility animation elements.
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 | 0x4D |
+----------------+----------------+----------------+----------------+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
21 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 |
|---|---|---|
color_end_vec | input | Three-component vector (x, y, z) for color end. |
color_flag2 | input | Enable bit 2 for color. |
color_mode | input | Mode selector for color; the handler branches on it. |
color_rate | derived | Rate at which color changes. |
control | input | Bitmask word choosing which optional payload words follow, in the order the handler tests them. Changing it changes how many words the command carries. |
control_bytes | derived | The control word split into its four bytes, for readability. |
duration | derived | Human-readable rendering of the command's duration word. Edit the underlying duration_word when it is listed as an input. |
duration_text | derived | Human-readable rendering of the command's duration word. Edit the underlying duration_word when it is listed as an input. |
event_duration | derived | Set when the duration is an event value rather than a literal time. |
flag3 | derived | Boolean option 3 taken from the handler's argument byte. |
mode | input | Handler path selector taken from the argument byte. The meaning is specific to each command. |
name_source | derived | Selects where a name operand comes from, such as an inline four-word string. |
scale | derived | Set when scale is animated by this line; the scale values follow. |
scale_flag4 | input | Enable bit 4 for scale. |
target_name | input | Name operand for target. |
transparent | derived | Set when transparency is animated by this line; the transparency values follow. |
transparent_flag7 | input | Enable bit 7 for transparent. |
transparent_from | input | Start value for transparent; the animation runs from here to the matching _to. |
transparent_mode | input | Mode selector for transparent; the handler branches on it. |
transparent_to | input | End value for transparent; the animation runs from the matching _from to here. |
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:
CAutoRateManager (color / transparency / scale / palette / visibility)CAutoRateManager::PlayColorRateAnim(CSsfHandler2*,unsigned int,int,float,const CVector*,const CVector*,const char*)CAutoRateManager::PlayPaletteMorphAnim(CSsfHandler2*,unsigned int,unsigned int,float,float,float,const char*)CAutoRateManager::PlayScaleAnim(CSsfHandler2*,unsigned int,float,const CVector*,const CVector*,const char*)CAutoRateManager::PlayTransparentAnim(CSsfHandler2*,unsigned int,int,float,float,float,const char*)CAutoRateManager::PlayVisibilityAnim(CSsfHandler2*,unsigned int,float,float,float,const char*)CAutoRateManager::StopAnimElement(unsigned int,unsigned int,CHierarchicalObject*)CRadiScript::GetEventValueForScript(int,const SCR_DATA*)
Bit masks
Masks the handler applies to its argument byte or operand words:
0x0001 0x0003 0x000F 0x0010