Skip to content

0x2A — character_movement

Large character movement command. It drives CCharacterMove, connect-target, vibration/throw/straight movement, fall-control, capture, and rotate-target calls.

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

At a glance

Opcode0x2A (42)
HandlerCRadiScript::Command_2a
SignatureCRadiScript::Command_2a(int,SCR_DATA*,unsigned int,unsigned int)
Translation unitr_script_run2.cpp
Address— debug build; click for all 3
Handler size0xBEC (3052 bytes)
Engine namecharacter_movement
FamilyCharacters
Command size4 + extra_words * 4 bytes

Handler behaviour

Large character movement command. It drives CCharacterMove, connect-target, vibration/throw/straight movement, fall-control, capture, and rotate-target calls.

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

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

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

FieldRoleMeaning
actionderivedWhich action this command performs, read from its mode or control bits. Each name is one branch of the handler, so changing it changes what the line does.
base_vecinputThree-component vector (x, y, z) for base.
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.
character_numberderivedLow 16 bits of the character selector: the character/actor id.
character_typederivedByte 2 of the character selector, where the handler treats it as a type selector rather than a variant.
duration_sourcederivedWhere duration is read from.
duration_valuederivedValue used for duration.
explicit_charderived1 when the command carries its own character selector word, 0 when it acts on the script's current character. It corresponds to bit 0 of the handler argument and decides whether a character= word is present.
float13cinputFloat parameter consumed by this command.
modederivedHandler path selector taken from the argument byte. The meaning is specific to each command.
mode4_attach_sourcederivedWhere mode4 attach is read from.
mode4_controlinputBitmask controlling which optional mode4 values follow.
mode4_high_flagsderivedBoolean options for mode4 high, packed one per bit.
mode4_high_modederivedMode selector for mode4 high; the handler branches on it.
mode4_low_flagsderivedBoolean options for mode4 low, packed one per bit.
mode4_slotderivedIndex into the runtime table of mode4.
mode4_submodederivedSub-path selector inside mode 4, unpacked from mode4_control.
mode5_controlinputBitmask controlling which optional mode5 values follow.
mode5_flagsderivedBoolean options for mode5, packed one per bit.
move_controlinputBitmask controlling which optional move values follow.
optional_vec0inputOptional vector operand, present when its control bit is set.
posvib_attrderivedPOSVIB_ATTR word passed to the vibration/throw movement calls.
rateinputHow fast the change is applied.
target_wordsinputRaw payload words for target, kept verbatim.
vec110inputVector written to the movement record at +0x110.
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:

  • CCharacterManager::GetCharacterClass2(int,unsigned int,const CCharacter*,unsigned int)
  • CCharacterManager::GetCharacterMoveClass(const CCharacter*)
  • CCharacterManager::InhibitionCharacter(CCharacter*)
  • CCharacterMove::CatchCameraPosition
  • CCharacterMove::FallControl
  • CCharacterMove::MoveStart(unsigned int,float)
  • CCharacterMove::SetConnectType(unsigned char)
  • CCharacterMove::StraightMove
  • CCharacterMove::ThrowPosition(POSVIB_ATTR,float,float,float,float,float)
  • CCharacterMove::VibrationPosition(POSVIB_ATTR,unsigned int,float,float,float,float,float,float)
  • CCharacterPerson::GetSchedulePercent()
  • CQuaternion::GetLookAtVector(CVector*) const
  • CRadiScript::GetCharacterID(unsigned int&,unsigned int&,unsigned int*,SCR_DATA*,unsigned int)
  • CRadiScript::GetEventValueForScript(int,const SCR_DATA*)
  • GetAbstractionCharacterNumber(unsigned int&)
  • atan2f
  • memset

Bit masks

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

0x0001 0x0003 0xFFFF 0x000F 0x00FF 0x0004