Starttrackvar

From EDukeWiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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
}