Skip to content

0x83 — play_vibration

Reads one operand, splits it into byte/halfword arguments, and calls CVibPlayer::PlayVibration.

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

At a glance

Opcode0x83 (131)
HandlerCRadiScript::Command_83
SignatureCRadiScript::Command_83(int,SCR_DATA*,unsigned int,unsigned int)
Translation unitr_script_run8.cpp
Address— debug build; click for all 3
Handler size0x40 (64 bytes)
FamilyVibration, dialogue and text
Command size4 + extra_words * 4 bytes

Handler behaviour

Reads one operand, splits it into byte/halfword arguments, and calls CVibPlayer::PlayVibration.

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

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

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

FieldRoleMeaning
durationinputHow long the vibration runs, from bits 16-31 of the word. This is the value itself, not a rendering of another field.
motor_flaginputOne bit, from bits 8-15 of the word. CVibPlayer::PlayVibration masks the argument with & 1 and stores that bit beside the strength byte in the vibration record; there is no pattern lookup, and the other seven bits are discarded. Shipped scripts only ever write 0 or 1.
strengthinputVibration strength passed to CVibPlayer::PlayVibration.

Engine calls

Engine functions this handler was observed calling:

  • CVibPlayer::PlayVibration(unsigned int,unsigned int,unsigned int,unsigned int)

Bit masks

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

0x00FF