0x79 — sound_listener
Sound listener placement helper. It can set listener point by character, map object, camera, direct vector/quaternion, or call CSoundManager::SetListener.
proven— handler traced, and exercised by at least one shipped script.
At a glance
| Opcode | 0x79 (121) |
|---|---|
| Handler | CRadiScript::Command_79 |
| Signature | CRadiScript::Command_79(int,SCR_DATA*,unsigned int,unsigned int) |
| Translation unit | r_script_run7.cpp |
| Address | — debug build; click for all 3 |
| Handler size | 0x234 (564 bytes) |
| Engine name | sound_listener |
| Family | Primitives, textures, sound and movies |
| Command size | 4 + extra_words * 4 bytes |
Handler behaviour
Sound listener placement helper. It can set listener point by character, map object, camera, direct vector/quaternion, or call CSoundManager::SetListener.
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 | 0x79 |
+----------------+----------------+----------------+----------------+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
10 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 |
|---|---|---|
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. |
character_type | input | Byte 2 of the character selector, where the handler treats it as a type selector rather than a variant. |
manager_listener | input | Whether CSoundManager::SetListener is called (listener-control bit). |
mode | input | Handler path selector taken from the argument byte. The meaning is specific to each command. |
position | input | Listener position operand. |
positive_distance | input | Distance-sign control bit from the argument byte. |
raw_byte3 | input | Byte 3 of the packed raw entry. |
tail | input | Remaining operand words for this line, kept in order. |
target_source | input | Where target is read from. |
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:
CRadiScript::GetAbstractionCharacterNumber(unsigned int&,unsigned int&,const SCR_DATA*)CRadiSound::SetListenerPoint (multiple variants)CRadiSound::SetListenerPointByCamera(float)CRadiSound::SetListenerPointByCharaObject(unsigned int,unsigned int,const char*,float)CRadiSound::SetListenerPointByMapObject(const char*,float)CRadiSound::SetListenerPointDirect(CVector&,CQuaternion&,float)CSoundManager::SetListener(CHierarchicalObject*,float,float)
Bit masks
Masks the handler applies to its argument byte or operand words:
0x0007 0xFFFF 0x00FF 0x0003 0x0040 0x0020