Starttrackvar: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
'''starttrackvar''' <track#> | '''starttrackvar''' <track#> | ||
starttrackvar | starttrackvar sets the background music to <track#>, as defined for the current episode with the [[music]] command. It works like [[starttrack]], but the parameter can be a variable instead of a constant | ||
Example: this will | Example: this code will cause the music to cycle through the first ten tracks defined for the current episode when the player presses the open key. (Replace the line "actor APLAYER..." with the code below) | ||
gamevar | gamevar TRACK 9 0 | ||
actor APLAYER MAXPLAYERHEALTH PSTAND 0 0 | |||
ifhitspace ifcount 26 | |||
{ | |||
resetcount | |||
addvar TRACK 1 | |||
ifvarg TRACK 9 setvar TRACK 0 | |||
starttrackvar TRACK | |||
} | |||
[[Category:EDuke32 specific commands]] | [[Category:EDuke32 specific commands]] | ||
[[Category:Sound manipulation]] | [[Category:Sound manipulation]] |
Revision as of 15:15, 5 May 2009
starttrackvar <track#>
starttrackvar sets the background music to <track#>, as defined for the current episode with the music command. It works like starttrack, but the parameter can be a variable instead of a constant
Example: this code will cause the music to cycle through the first ten tracks defined for the current episode when the player presses the open key. (Replace the line "actor APLAYER..." with the code below)
gamevar TRACK 9 0 actor APLAYER MAXPLAYERHEALTH PSTAND 0 0
ifhitspace ifcount 26 { resetcount addvar TRACK 1 ifvarg TRACK 9 setvar TRACK 0 starttrackvar TRACK }