0x2D — character_rotate_option
Resolves a character and then configures character rotation, character option targets, capture data, posture, speed limits, and head angle through CCharacterRotate, CCharacterOption, CCharacterCapture, and quaternion helper calls.
proven— handler traced, and exercised by at least one shipped script.
At a glance
| Opcode | 0x2D (45) |
|---|---|
| Handler | CRadiScript::Command_2d |
| Signature | CRadiScript::Command_2d(int,SCR_DATA*,unsigned int,unsigned int) |
| Translation unit | r_script_run2.cpp |
| Address | — debug build; click for all 3 |
| Handler size | 0xD34 (3380 bytes) |
| Engine name | character_rotate_option |
| Family | Characters |
| Command size | 4 + extra_words * 4 bytes |
Handler behaviour
Resolves a character and then configures character rotation, character option targets, capture data, posture, speed limits, and head angle through CCharacterRotate, CCharacterOption, CCharacterCapture, and quaternion helper 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 | 0x2D |
+----------------+----------------+----------------+----------------+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
17 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 | input | 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. |
arg | derived | Raw 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. |
bit13 | derived | Not yet traced. The handler consumes it but its meaning was never established, so it is preserved verbatim rather than given an invented name. |
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. |
duration_text | input | Human-readable rendering of the command's duration word. Edit the underlying duration_word when it is listed as an input. |
head_angle_add | input | Extra head angle added on top of the body rotation, as x:..,y:... |
initial_vec | input | Three-component vector (x, y, z) for initial. |
mode | derived | Handler path selector taken from the argument byte. The meaning is specific to each command. |
position_offset | derived | Offset applied to position. |
postprocess_mode | input | Mode selector for postprocess; the handler branches on it. |
speed_values | input | Rotation speed operands, in the order the handler consumes them. |
stand | input | Stand-position operand, resolved through GetAbstractionStandPosNumber. |
target_char_from_stream | derived | Whether the target character comes from the stream rather than the current context. |
target_character_pair | input | Packed target character word for the target-character rotate actions. |
target_posture_vec | input | Three-component vector (x, y, z) for target posture. |
target_vector | input | Direction the character turns toward. |
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:
CCharacterCapture::Initialize()CCharacterManager::GetCharacterClass2(int,unsigned int,const CCharacter*,unsigned int)CCharacterManager::GetCharacterOptionClass(const CCharacter*)CCharacterManager::GetCharacterRotateClass(const CCharacter*)CCharacterManager::SetCharacterAttribute(CCharacter*,unsigned int,int)CCharacterOption::SetPostureCCharacterOption::SetSpeedCCharacterOption::SetTargetCCharacterRotate (multiple methods)CCharacterRotate::SetTargetCharacterCCharacterRotate::SetTargetCharacterDiffer(unsigned int,unsigned int,const CQuaternion*,unsigned int,float)CCharacterRotate::SetTargetMapObject(const char*,const CVector*,const CQuaternion*,unsigned int,float)CCharacterRotate::SetTargetPosture(const CVector&,const CQuaternion*,unsigned int,float)CCharacterRotate::SetTargetVector(const CVector&,const CQuaternion*,unsigned int,float)CQuaternion::Euler(const CVector&)CRadiScript::GetAbstractionCharacterNumber(unsigned int&,unsigned int&,const SCR_DATA*)CRadiScript::GetAbstractionStandPosNumber(unsigned int&,CVector&,CVector&,const SCR_DATA*)CRadiScript::GetCharacterID(unsigned int&,unsigned int&,unsigned int*,SCR_DATA*,unsigned int)
Bit masks
Masks the handler applies to its argument byte or operand words:
0x0001 0x0003 0x0400 0x0200 0x1000 0x0800 0x0002 0xFFFF 0x000F 0x01C0