Skip to content

0x57 — position_vibration_vector

Position vibration helper. It allocates CVibrationVector records, calls CVibrationVector::SetParam, then dispatches virtual attach/start paths.

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

At a glance

Opcode0x57 (87)
HandlerCRadiScript::Command_57
SignatureCRadiScript::Command_57(int,SCR_DATA*,unsigned int,unsigned int)
Translation unitr_script_run5.cpp
Address— debug build; click for all 3
Handler size0x404 (1028 bytes)
Engine nameposition_vibration_vector
FamilyBackground, map, landscape and camera
Command size4 + extra_words * 4 bytes

Handler behaviour

Position vibration helper. It allocates CVibrationVector records, calls CVibrationVector::SetParam, then dispatches virtual attach/start paths.

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

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

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

FieldRoleMeaning
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_highderivedUpper part of the matching packed value for control.
control_low8derivedLow byte of control, shown for the handler's byte-wise test.
control_target_modederivedMode selector for control target; the handler branches on it.
direct_floatinputFloat parameter for direct.
modeinputHandler path selector taken from the argument byte. The meaning is specific to each command.
paramsinputThe remaining operand words for this line, kept in order.
start_slot0derivedStart/attach flag for the first slot, decoded from the mode bits.
start_slot1derivedStart/attach flag for the second slot, decoded from the mode bits.
targetinputWhat the command acts on or moves towards.
target_slotinputDestination index into a runtime table owned by this command's subsystem.

Engine calls

Engine functions this handler was observed calling:

  • CVibrationVector::SetParam(POSVIB_ATTR,float,float,float,float,float,float,float)
  • CVibrationVector::SetParam(POSVIB_ATTR,unsigned int,float,float,float,float,float,float)
  • operator new(unsigned int,int,const char*)
  • operator_new (PositionVib)

Bit masks

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

0x0003 0x0001 0x0002