Skip to content

SetMusicTrackAction ​

Inherits: EventAction < Resource

Action to control music 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 ​

MusicActionactionMusicAction.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 MusicAction ​

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

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

Property descriptions ​

MusicAction action = MusicAction.PLAY_TRACK ​

What to do with the music

SoundSource source ​

What to play (only for PLAY_TRACK): a track with its options (loop or one shot, the pause between plays, volume, fade) or a Music Album. 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