Skip to content

SetAmbientTrackAction ​

Inherits: EventAction < Resource

Action to control ambient track playback Uses TrackSelectionDialog to pick specific tracks NOTE: The world loads the tracks of its events, zones, weather and encounters when it starts (AudioPreload), so they play without a pause. Other tracks load when they are needed.

Properties ​

AmbientActionactionAmbientAction.PLAY_TRACK
SoundSourcesource
floatfade_duration3.0
booluse_crossfadetrue
boolreturn_to_map_albumfalse

Methods ​

Stringget_function_description()
SoundSourceget_source()
Dictionarysave()
voidload_data( data: Dictionary )

Enumerations ​

enum AmbientAction ​

The options of ambient action: play track, stop, fade stop.

  • PLAY_TRACK = 0 - Play a specific ambient track
  • STOP = 1 - Stop ambient immediately
  • FADE_STOP = 2 - Fade out and stop ambient
  • CLEAR = 3 - Take the track of an event off: the ambience of the zone, the weather, the shelter or the world comes back

Property descriptions ​

AmbientAction action = AmbientAction.PLAY_TRACK ​

What to do with the ambient sound

SoundSource source ​

What to play (only for PLAY_TRACK): a track with its options (loop or one shot, the pause between plays, volume, fade). It wins over the zone, the weather and the shelter until it ends or a Clear action takes it off

float fade_duration = 3.0 ​

Crossfade duration in seconds (for PLAY_TRACK and the fades of the other actions; the source may have its own fade)

bool use_crossfade = true ​

Whether to use crossfade when playing (only used for PLAY_TRACK action)

bool return_to_map_album = false ​

After track finishes, return to map album instead of looping

Method descriptions ​

String get_function_description() ​

Return a description of this action with parameter placeholders

SoundSource get_source() ​

The source this action plays: the one chosen, else a track made from the old settings of the action

Dictionary save() ​

Save action state to a dictionary

void load_data( data: Dictionary ) ​

Load action state from a dictionary