sound_token 
Sound tokens, a datumized handler for spatial sound. Uses the spatial grid to track clients in range and add them as listeners Updated by the SSsound_tokens subsystem every tick when requested by client so that if the source or listener moves, the sound updates accordingly.
Vars | |
| allowed_listeners | k:v list of mobs : bool. Used to quickly check whether a mob is allowed to hear this noise. This is null by default which means ANY MOB can hear this. |
|---|---|
| cell_tracker | Cell tracker managing spatial grid cells within range of the source. The wizards say this is the fastest. |
| delete_on_end | Should we destroy the datum when the sound is done? |
| falloff_distance | Sound falloff distance |
| falloff_exponent | Sound falloff |
| frequency | Frequency (playback speed) applied to the sound. Null keeps the default speed. |
| listeners | k:v list of mob : sound status |
| null_sound | Null sound for cancelling the sound entirely. |
| pressure_affected | Whether or not the sound volume is affected by pressure (e.g. whether you can hear it through vacuum). |
| range | Sound maximum range |
| sound | The master copy of the playing sound. |
| sound_channel | The channel being used. |
| sound_duration | Duration of the current sound file in deciseconds. Used to wrap offset for looping sounds. |
| sound_duration_override | Duration of the current sound file in deciseconds. Used to wrap offset for looping sounds. |
| sound_status | Status of the playing sound |
| source | The atom playing the sound. |
| start_time | world.time when the sound started (or when the sound file was last changed). Used to calculate playback offset for new listeners. |
| volume | Sound volume |
Procs | |
| add_listener | Adds a listener to the sound. returns TRUE if we already were added, or for some reason couldnt be added. |
| add_or_update_listener | Updates the data of a listener, or adds them if they are not present. |
| calculate_offset | Calculates the offset to give the sound for people who start hearing it mid-play. |
| force_update_all_listeners | Refresh every listener immediately, bypassing the subsystem queue. |
| listener_deafness_update | Respond to TRAIT_DEAF addition/removal |
| on_cell_client_entered | Signal handler for SPATIAL_GRID_CELL_ENTERED on tracked cells. Adds newly arriving mobs as listeners. |
| on_cell_client_exited | Signal handler for SPATIAL_GRID_CELL_EXITED on tracked cells. Removes mobs who have left all member cells. |
| on_enter_area | Update env when source is entering new area. |
| on_sound_ended | The sound should have ended on all clients. Time to destroy the sound token. |
| player_login | Respond to any mob in the world being logged into. Only adds if the mob is within range. |
| player_logout | Respond to any cliented mob becoming uncliented |
| remove_listener | Remove a listener from the sound. |
| set_listener_status | Set the status of a listener. Does not update the sound. |
| set_new_environment | Apply a new reverb environment and refresh listeners if it changed. |
| set_volume | Setter for volume |
| source_moved | If the sound source moves, update tracked cells then refresh all listener positions. |
| update_all_listeners | Queue every listener for a deferred refresh by the subsystem. |
| update_listener | Recompute a single listener's mute state from distance/z-level/deafness and push the sound. |
| update_sound | Lets us update the sound to a new one. |
| update_tracked_cells | Update tracked cells; happens on movement. We need to check if anyone is now out of cell range and kick them out. |
Var Details
allowed_listeners 
k:v list of mobs : bool. Used to quickly check whether a mob is allowed to hear this noise. This is null by default which means ANY MOB can hear this.
cell_tracker 
Cell tracker managing spatial grid cells within range of the source. The wizards say this is the fastest.
delete_on_end 
Should we destroy the datum when the sound is done?
falloff_distance 
Sound falloff distance
falloff_exponent 
Sound falloff
frequency 
Frequency (playback speed) applied to the sound. Null keeps the default speed.
listeners 
k:v list of mob : sound status
null_sound 
Null sound for cancelling the sound entirely.
pressure_affected 
Whether or not the sound volume is affected by pressure (e.g. whether you can hear it through vacuum).
range 
Sound maximum range
sound 
The master copy of the playing sound.
sound_channel 
The channel being used.
sound_duration 
Duration of the current sound file in deciseconds. Used to wrap offset for looping sounds.
sound_duration_override 
Duration of the current sound file in deciseconds. Used to wrap offset for looping sounds.
sound_status 
Status of the playing sound
source 
The atom playing the sound.
start_time 
world.time when the sound started (or when the sound file was last changed). Used to calculate playback offset for new listeners.
volume 
Sound volume
Proc Details
add_listener
Adds a listener to the sound. returns TRUE if we already were added, or for some reason couldnt be added.
add_or_update_listener
Updates the data of a listener, or adds them if they are not present.
calculate_offset
Calculates the offset to give the sound for people who start hearing it mid-play.
force_update_all_listeners
Refresh every listener immediately, bypassing the subsystem queue.
listener_deafness_update
Respond to TRAIT_DEAF addition/removal
on_cell_client_entered
Signal handler for SPATIAL_GRID_CELL_ENTERED on tracked cells. Adds newly arriving mobs as listeners.
on_cell_client_exited
Signal handler for SPATIAL_GRID_CELL_EXITED on tracked cells. Removes mobs who have left all member cells.
on_enter_area
Update env when source is entering new area.
on_sound_ended
The sound should have ended on all clients. Time to destroy the sound token.
player_login
Respond to any mob in the world being logged into. Only adds if the mob is within range.
player_logout
Respond to any cliented mob becoming uncliented
remove_listener
Remove a listener from the sound.
set_listener_status
Set the status of a listener. Does not update the sound.
set_new_environment
Apply a new reverb environment and refresh listeners if it changed.
set_volume
Setter for volume
source_moved
If the sound source moves, update tracked cells then refresh all listener positions.
update_all_listeners
Queue every listener for a deferred refresh by the subsystem.
update_listener
Recompute a single listener's mute state from distance/z-level/deafness and push the sound.
update_sound
Lets us update the sound to a new one.
update_tracked_cells
Update tracked cells; happens on movement. We need to check if anyone is now out of cell range and kick them out.