Skip to content

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

Opcode0x45 (69)
HandlerCRadiScript::Command_45
SignatureCRadiScript::Command_45(int,SCR_DATA*,unsigned int,unsigned int)
Translation unitr_script_run4.cpp
Address— debug build; click for all 3
Handler size0x1B0 (432 bytes)
Engine namebackground_play_animation
FamilyBackground, map, landscape and camera
Command size4 + 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.

FieldRoleMeaning
char_ref_streaminputBit 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_rangederivedChildren play the same frame range as the parent rather than their own.
float0inputFloat parameter 0 consumed by this command.
float1inputFloat parameter 1 consumed by this command.
float2inputFloat parameter 2 consumed by this command.
frames_are_keysderivedTreat the frame numbers as key indices rather than frame counts.
has_float0derivedWhether float0 is present on this line.
has_float1derivedWhether float1 is present on this line.
has_float2_or_charderivedWhether float2 or char is present on this line.
include_childrenderivedAlso play the animation on the object's child nodes.
nameinputObject 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_sourceinputSelects where a name operand comes from, such as an inline four-word string.
repeatinputHow many extra times to loop: 0 plays once, forever loops until stopped.
restart_if_playingderivedRestart from the beginning if this animation is already running.
yieldderivedPause 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