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
| Opcode | 0x83 (131) |
|---|---|
| Handler | CRadiScript::Command_83 |
| Signature | CRadiScript::Command_83(int,SCR_DATA*,unsigned int,unsigned int) |
| Translation unit | r_script_run8.cpp |
| Address | — debug build; click for all 3 |
| Handler size | 0x40 (64 bytes) |
| Family | Vibration, dialogue and text |
| Command size | 4 + 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.
| Field | Role | Meaning |
|---|---|---|
duration | input | How long the vibration runs, from bits 16-31 of the word. This is the value itself, not a rendering of another field. |
motor_flag | input | One 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. |
strength | input | Vibration 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