0x75 — play_sound_effect
Resolves sound-effect parameters and optionally character/SSF attachment data, then calls CRadiSound::PlaySe; also calls CRadiSound::GetSEBankFromChrNum and CSsfHandler::SearchName in traced branches.
proven— handler traced, and exercised by at least one shipped script.
At a glance
| Opcode | 0x75 (117) |
|---|---|
| Handler | CRadiScript::Command_75 |
| Signature | CRadiScript::Command_75(int,SCR_DATA*,unsigned int,unsigned int) |
| Translation unit | r_script_run7.cpp |
| Address | — debug build; click for all 3 |
| Handler size | 0x520 (1312 bytes) |
| Engine name | play_sound_effect |
| Family | Primitives, textures, sound and movies |
| Command size | 4 + extra_words * 4 bytes |
Handler behaviour
Resolves sound-effect parameters and optionally character/SSF attachment data, then calls CRadiSound::PlaySe; also calls CRadiSound::GetSEBankFromChrNum and CSsfHandler::SearchName in traced branches.
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 | 0x75 |
+----------------+----------------+----------------+----------------+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
15 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 |
|---|---|---|
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. |
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. |
control_high | input | Upper part of the matching packed value for control. |
control_low_s16 | input | Signed low half of the control word, as the handler sign-extends it. |
mode | input | Handler path selector taken from the argument byte. The meaning is specific to each command. |
pan | input | Stereo position; 64 is centre and is what almost every line uses. |
playse_arg5 | input | Argument 5 passed to the engine call for playse. |
playse_stack0 | input | Word passed through to the PlaySe call unchanged; untraced beyond that. |
se_flags | input | Boolean options for se, packed one per bit. |
se_index | input | Index selecting which se to act on. |
sound_id | input | Identifier selecting which sound to use. |
submode | input | Secondary path selector from the argument byte. |
target_name | input | Name operand for target. |
volume | input | Playback volume, 0-127. Shipped scripts overwhelmingly use 127. |
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)CRadiScript::GetAbstractionCharacterNumber(unsigned int&,unsigned int&,const SCR_DATA*)CRadiSound::GetSEBankFromChrNum(unsigned int,unsigned int) constCRadiSound::PlaySe(int,unsigned int,unsigned int,CHierarchicalObject*,int,int,int,int)CSsfHandler::SearchName(const char*) const
Bit masks
Masks the handler applies to its argument byte or operand words:
0xFFFF 0x0007 0x0003 0x001F 0x0001 0x00FF 0x007F 0x1FFF 0x000F