Ambient sound (soundscape)
The game plays a background ambient sound for the area the player is in. This is called a soundscape. These members read it and change it.
Sounds ambient sound controls
Read SoundscapeId to see which ambient sound is playing, then use SetSoundscape or ResetSoundscape to change it.
public static class Sounds
{
public static string SoundscapeId { get; }
public static bool SetSoundscape(string id);
public static bool ResetSoundscape();
}
| Method | Returns | What it does |
|---|---|---|
SetSoundscape(id) | bool | Starts the ambient sound with this id now. Returns false when there is none. |
ResetSoundscape() | bool | Goes back to the game’s ordinary ambient sound. |
| Property | Type | What it means |
|---|---|---|
SoundscapeId | string | The id of the ambient sound playing now. null when there is none. |
Things to know
SoundscapeIdis the id of the ambient sound the game is playing now, ornullwhen there is none. (It isSoundscapeArea.idof the controller’s current soundscape.)SetSoundscape(id)starts the ambient sound with that id straight away. (It callsSoundscapeController.PlaySoundscapefor the area thatFindSoundscapeAreaByIdfinds.)ResetSoundscape()goes back to the game’s global ambient sound. (The day and night switch is inSoundscapeGlobal.)
Limits
SetSoundscapereturnsfalsewhen no ambient sound with that id is loaded, or when the game’s sound controller does not exist yet. An empty id throws an error.- The game can change the ambient sound again whenever it likes, for example when day turns to night.