0x45 — background_play_animation
Background animation command. It resolves optional character abstraction data and calls CBackGround::PlayAnimation.
proven— handler traced, and exercised by at least one shipped script.
At a glance
| Opcode | 0x45 (69) |
|---|---|
| Handler | CRadiScript::Command_45 |
| Signature | CRadiScript::Command_45(int,SCR_DATA*,unsigned int,unsigned int) |
| Translation unit | r_script_run4.cpp |
| Address | — debug build; click for all 3 |
| Handler size | 0x1B0 (432 bytes) |
| Engine name | background_play_animation |
| Family | Background, map, landscape and camera |
| Command size | 4 + extra_words * 4 bytes |
Handler behaviour
Background animation command. It resolves optional character abstraction data and calls CBackGround::PlayAnimation.
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 | 0x45 |
+----------------+----------------+----------------+----------------+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
15 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 |
|---|---|---|
char_ref_stream | input | Bit 5 of the argument byte: when the control word has bit 15 set, an explicit character-reference word follows in place of the third float. |
children_share_range | derived | Children play the same frame range as the parent rather than their own. |
float0 | input | Float parameter 0 consumed by this command. |
float1 | input | Float parameter 1 consumed by this command. |
float2 | input | Float parameter 2 consumed by this command. |
frames_are_keys | derived | Treat the frame numbers as key indices rather than frame counts. |
has_float0 | derived | Whether float0 is present on this line. |
has_float1 | derived | Whether float1 is present on this line. |
has_float2_or_char | derived | Whether float2 or char is present on this line. |
include_children | derived | Also play the animation on the object's child nodes. |
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. |
name_source | input | Selects where a name operand comes from, such as an inline four-word string. |
repeat | input | How many extra times to loop: 0 plays once, forever loops until stopped. |
restart_if_playing | derived | Restart from the beginning if this animation is already running. |
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:
CBackGround::PlayAnimation(const char*,unsigned int,float,float,float,unsigned int,unsigned int,unsigned short)CRadiScript::GetAbstractionCharacterNumber(unsigned int&,unsigned int&,const SCR_DATA*)
Bit masks
Masks the handler applies to its argument byte or operand words:
0xFFFF 0x0003 0x0001 0x0002 0x0004 0x8000 0x0020 0x00FF