HolyLib Wiki

soundscape

soundscape

This library adds a few functions allowing handling of soundscapes.

Recently Added

This was recently added in version (0.8 - DEV).

Methods

soundscape.BlockEngineChanges( Player player, boolean shouldBlock = false )
Sets if the engine should be blocked from changing the soundscape of the given player.
soundscape.EnableUpdateHook( boolean enable = false )
Enables/Disables the HolyLib:OnSoundScapeUpdateForPlayer hook.
table soundscape.GetActivePositions( Player player )
Returns a table containing all positions used for local sounds that are linked to the currently active soundscape.
Will return an empty table if the client has no active soundscape.
Entity soundscape.GetActiveSoundScape( Player player )
Returns the currently active soundscape for the given player
number soundscape.GetActiveSoundScapeIndex( Player player )
Returns the currently active soundscape index for the given player or -1 if they have no soundscape active.
table soundscape.GetAll( )
Returns a table containing all soundscapes that exist.
key will be the soundscape index and value will be the name of the soundscape
The table can possibly be non-sequential so use pairs instead of ipairs when iterating.
table soundscape.GetAllEntities( )
Returns a sequential table containing all soundscape entities.
number soundscape.GetIndexByName( string soundscapeName )
Returns the index of the given soundscape name or returns nil if not found.
string soundscape.GetNameByIndex( number soundscapeIndex )
Returns the name of the given soundscapeIndex or returns nil if not found.
soundscape.SetActiveSoundscape( Player player, Entity soundScape )
Sets the soundscape entity for the given player, use soundscape.BlockEngineChanges as else the engine might override it.
soundscape.SetCurrentDistance( number distance )
Sets the distance for the currently active soundscapeUpdate.
Only works inside the HolyLib:OnSoundScapeUpdateForPlayer hook!
Mostly only useful to influence which soundscape could be selected.
soundscape.SetCurrentPlayerPosition( Vector position )
Sets the player position for the currently active soundscapeUpdate.
Only works inside the HolyLib:OnSoundScapeUpdateForPlayer hook!
Mostly only useful to influence which soundscape could be selected.
soundscape.SetCurrentSoundscape( Entity soundScape )
Sets the soundscape entity for the currently active soundscapeUpdate.
Only works inside the HolyLib:OnSoundScapeUpdateForPlayer hook!