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
| Opcode | 0x2A (42) |
|---|---|
| Handler | CRadiScript::Command_2a |
| Signature | CRadiScript::Command_2a(int,SCR_DATA*,unsigned int,unsigned int) |
| Translation unit | r_script_run2.cpp |
| Address | — debug build; click for all 3 |
| Handler size | 0xBEC (3052 bytes) |
| Engine name | character_movement |
| Family | Characters |
| Command size | 4 + 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.
| Field | Role | Meaning |
|---|---|---|
action | derived | Which 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_vec | input | Three-component vector (x, y, z) for base. |
character | input | The 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_number | derived | Low 16 bits of the character selector: the character/actor id. |
character_type | derived | Byte 2 of the character selector, where the handler treats it as a type selector rather than a variant. |
duration_source | derived | Where duration is read from. |
duration_value | derived | Value used for duration. |
explicit_char | derived | 1 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. |
float13c | input | Float parameter consumed by this command. |
mode | derived | Handler path selector taken from the argument byte. The meaning is specific to each command. |
mode4_attach_source | derived | Where mode4 attach is read from. |
mode4_control | input | Bitmask controlling which optional mode4 values follow. |
mode4_high_flags | derived | Boolean options for mode4 high, packed one per bit. |
mode4_high_mode | derived | Mode selector for mode4 high; the handler branches on it. |
mode4_low_flags | derived | Boolean options for mode4 low, packed one per bit. |
mode4_slot | derived | Index into the runtime table of mode4. |
mode4_submode | derived | Sub-path selector inside mode 4, unpacked from mode4_control. |
mode5_control | input | Bitmask controlling which optional mode5 values follow. |
mode5_flags | derived | Boolean options for mode5, packed one per bit. |
move_control | input | Bitmask controlling which optional move values follow. |
optional_vec0 | input | Optional vector operand, present when its control bit is set. |
posvib_attr | derived | POSVIB_ATTR word passed to the vibration/throw movement calls. |
rate | input | How fast the change is applied. |
target_words | input | Raw payload words for target, kept verbatim. |
vec110 | input | Vector written to the movement record at +0x110. |
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:
CCharacterManager::GetCharacterClass2(int,unsigned int,const CCharacter*,unsigned int)CCharacterManager::GetCharacterMoveClass(const CCharacter*)CCharacterManager::InhibitionCharacter(CCharacter*)CCharacterMove::CatchCameraPositionCCharacterMove::FallControlCCharacterMove::MoveStart(unsigned int,float)CCharacterMove::SetConnectType(unsigned char)CCharacterMove::StraightMoveCCharacterMove::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*) constCRadiScript::GetCharacterID(unsigned int&,unsigned int&,unsigned int*,SCR_DATA*,unsigned int)CRadiScript::GetEventValueForScript(int,const SCR_DATA*)GetAbstractionCharacterNumber(unsigned int&)atan2fmemset
Bit masks
Masks the handler applies to its argument byte or operand words:
0x0001 0x0003 0xFFFF 0x000F 0x00FF 0x0004