Redirect Commands Reference

From Embassy Wiki
Revision as of 11:27, 10 December 2018 by CircuitLord (talk | contribs) (Examples)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Redirect Commands can be used to further extend the functionality of song playback.

List of Redirect Commands

Command Variables Purpose
redirectSong:x x : filename in "Music" folder ( without .ogg ) Specifies the song to load for the specified trigger.
fade:x x : Time ( in ticks ) Manually sets the fade-in / crossfade time for the song, in ticks ( 20 ticks to a second ).
leadIn:x x : Time ( in ticks ) Manually sets the lead-in delay for the song, in ticks.
leadOut:x x : Time ( in ticks ) Manually sets the lead-out delay for the song, in ticks.
lifetime:x x : Time ( in ticks ) Manually sets the length of time a song stays in memory when not active before resetting it.
start:x x : Starting point in song ( in ms ) Sets the point AM should start playing the song at.
cutoff:x x : Ending point in song ( in ms ) Sets a point in the song where it will be cut off and stop playing.
chances:x x : amount of chances to play song ( not 0 ) Can be used to override the default equal chance to play the song. If you have two variants for a trigger, putting "chances:3" will make it play 3/4 times.
loop:x:y x : Start point ( in ms ), y : End point ( in ms ) Sets points that the song will loop through if it is played.
blockTrigger:x x : Trigger to block When the song finishes playing, it blocks the specified trigger until it's naturally disabled.
forceTrigger:x x : Trigger to activate When the song finishes playing, the specified trigger will be forced on until it's naturally enabled.
playOnce N/A Functions the same as blockTrigger, except it blocks the specific trigger used to play this song.
playThrough N/A Doesn't allow the song to stop playing until it has finished playing, even if a higher priority trigger occurs.


Examples

Here are some examples of how you can use Redirect Commands.

bed,redirectSong:sleepingSong,start:5000 Will play sleepingSong.ogg starting at 5000ms ( 5 seconds ) whenever the player gets in a bed.


You can chain as many commands as you like ( assuming they aren't the same or overriding each other ).

Village-Day[1],redirectSong:MoreBadTrades,chances:5,cutoff:60000 will have a 5/6 chance to play ( assuming there's a Village-Day[2] ), and if it reaches 60 seconds it will end.

Underwater,redirectSong:StillBreathing,fade:20,loop:0:60000 will fade in StillBreathing.ogg over 1 second, and loop between 0 and 60 seconds.

BiomeType(Forest)-Day,redirectSong:TheShadeOfATree,playOnce,playThrough will play the entirety of TheShadeOfATree.ogg, then not allow the BiomeType(Forest)-Day trigger to be used again once it is played ( because examples ).