Skip to content

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

Opcode0x4D (77)
HandlerCRadiScript::Command_4d
SignatureCRadiScript::Command_4d(int,SCR_DATA*,unsigned int,unsigned int)
Translation unitr_script_run4.cpp
Address— debug build; click for all 3
Handler size0x534 (1332 bytes)
Engine namebackground_auto_rate_anim
FamilyBackground, map, landscape and camera
Command size4 + 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.

FieldRoleMeaning
color_end_vecinputThree-component vector (x, y, z) for color end.
color_flag2inputEnable bit 2 for color.
color_modeinputMode selector for color; the handler branches on it.
color_ratederivedRate at which color changes.
controlinputBitmask word choosing which optional payload words follow, in the order the handler tests them. Changing it changes how many words the command carries.
control_bytesderivedThe control word split into its four bytes, for readability.
durationderivedHuman-readable rendering of the command's duration word. Edit the underlying duration_word when it is listed as an input.
duration_textderivedHuman-readable rendering of the command's duration word. Edit the underlying duration_word when it is listed as an input.
event_durationderivedSet when the duration is an event value rather than a literal time.
flag3derivedBoolean option 3 taken from the handler's argument byte.
modeinputHandler path selector taken from the argument byte. The meaning is specific to each command.
name_sourcederivedSelects where a name operand comes from, such as an inline four-word string.
scalederivedSet when scale is animated by this line; the scale values follow.
scale_flag4inputEnable bit 4 for scale.
target_nameinputName operand for target.
transparentderivedSet when transparency is animated by this line; the transparency values follow.
transparent_flag7inputEnable bit 7 for transparent.
transparent_frominputStart value for transparent; the animation runs from here to the matching _to.
transparent_modeinputMode selector for transparent; the handler branches on it.
transparent_toinputEnd value for transparent; the animation runs from the matching _from to here.
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:

  • 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