Skip to content

0x32 — character_auto_rate_anim

Resolves a character and drives CCharaAutoRateAnim play/stop methods for color-rate, transparency, scale, palette morph, and visibility animations, including WithChild variants.

proven— handler traced, and exercised by at least one shipped script.

At a glance

Opcode0x32 (50)
HandlerCRadiScript::Command_32
SignatureCRadiScript::Command_32(int,SCR_DATA*,unsigned int,unsigned int)
Translation unitr_script_run2.cpp
Address— debug build; click for all 3
Handler size0x710 (1808 bytes)
Engine namecharacter_auto_rate_anim
FamilyCharacters
Command size4 + extra_words * 4 bytes

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.

FormEngine nameWhat it does
animate_character_materialcharacter_auto_rate_animAnimates a character's material over time: colour, transparency, scale, palette, or visibility.
character_auto_rate_visual_animation—Animates a character's material over time - colour, transparency, scale, palette morph or visibility. No structured form yet, so it takes a raw payload; animate_character_material is the readable form of the same opcode.

Handler behaviour

Resolves a character and drives CCharaAutoRateAnim play/stop methods for color-rate, transparency, scale, palette morph, and visibility animations, including WithChild variants.

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   |  0x32          |
+----------------+----------------+----------------+----------------+

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

34 documented fields. input fields are read from the command's operand words; derived fields are computed from other fields rather than stored separately.

FieldRoleMeaning
arginputRaw handler argument byte from the command header. It is printed only when it differs from the value the named fields already imply, so seeing it means the command uses an unusual argument encoding.
characterinputThe packed 32-bit character selector word. Its low half is the character id and byte 2 is a secondary class/variant input; see character_number and character_variant.
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.
color_start_vecinputThree-component vector (x, y, z) for color start.
durationinputHuman-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.
flagsinputCommand header flag byte. Bit 0x80 is the keep-going bit: set (the hidden default), the next command runs in the same frame; clear (printed as yield=1), the script pauses until the next game update. Other bits are rare and stay as an explicit flags= byte.
modeinputHandler path selector taken from the argument byte. The meaning is specific to each command.
option_bitsinputNames of the bits set in the matching packed value.
palettederivedSet when the palette is animated by this line; the palette values follow.
palette_flag7inputEnable bit 7 for palette.
palette_frominputStart value for palette; the animation runs from here to the matching _to.
palette_idinputIdentifier selecting which palette to use.
palette_toinputEnd value for palette; the animation runs from the matching _from to here.
scalederivedSet when scale is animated by this line; the scale values follow.
scale_end_vecinputThree-component vector (x, y, z) for scale end.
scale_flag4inputEnable bit 4 for scale.
target_childinputWhether child objects are included with target.
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.
visibilityderivedSet when visibility is animated by this line; the visibility values follow.
visibility_flag2inputEnable bit 2 for visibility.
visibility_frominputStart value for visibility; the animation runs from here to the matching _to.
visibility_toinputEnd value for visibility; the animation runs from the matching _from to here.
with_childinputWhether child objects are included with with.
wordsinputRaw fallback payload, used when a command shape has no named form yet.
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)
  • CCharaAutoRateAnim::PlayColorRateAnim(unsigned int,int,float,const CVector*,const CVector*,const char*)
  • CCharaAutoRateAnim::PlayColorRateAnimWithChild(unsigned int,int,float,const CVector*,const CVector*,const char*)
  • CCharaAutoRateAnim::PlayPaletteMorphAnim(unsigned int,unsigned int,float,float,float,const char*)
  • CCharaAutoRateAnim::PlayPaletteMorphAnimWithChild(unsigned int,unsigned int,float,float,float,const char*)
  • CCharaAutoRateAnim::PlayScaleAnim(unsigned int,float,const CVector*,const CVector*,const char*)
  • CCharaAutoRateAnim::PlayScaleAnimWithChild(unsigned int,float,const CVector*,const CVector*,const char*)
  • CCharaAutoRateAnim::PlayTransparentAnim(unsigned int,int,float,float,float,const char*)
  • CCharaAutoRateAnim::PlayTransparentAnimWithChild(unsigned int,int,float,float,float,const char*)
  • CCharaAutoRateAnim::PlayVisibilityAnim(unsigned int,float,float,float,const char*)
  • CCharaAutoRateAnim::PlayVisibilityAnimWithChild(unsigned int,float,float,float,const char*)
  • CCharacterManager::GetCharacterClass2(int,unsigned int,const CCharacter*,unsigned int)
  • CCharacterManager::GetCharacterSubManager(int)
  • CRadiScript::GetCharacterID(unsigned int&,unsigned int&,unsigned int*,SCR_DATA*,unsigned int)
  • CRadiScript::GetEventValueForScript(int,const SCR_DATA*)

Bit masks

Masks the handler applies to its argument byte or operand words:

0x0001 0x0003 0x0010