OpenArena

In this page we propose an example of a script which allows you to use a key to cycle between all OpenArena 0.8.8 background musics. Enjoy!

This works from client and affects yourself only.

Jukebox script[]

In these examples, we bind the music cycle script to "j" key (think about jukebox). Of course you can use the key you prefer!

Press the binded key to start the script, switching from the map-specific music to the first music of the script. Press again to change music.

The game should automatically return to play the map-specific music (as set by map creator) on map change/restart.

Cycle all musics[]

This allows to cycle between all stock background music from OpenArena 0.8.8:

set music1 "music music/oa01; set jukebox vstr music2"
set music2 "music music/oa02; set jukebox vstr music3"
set music3 "music music/oa06; set jukebox vstr music4"
set music4 "music music/oa07; set jukebox vstr music5"
set music5 "music music/oa08; set jukebox vstr music6"
set music6 "music music/oa13; set jukebox vstr music7"
set music7 "music music/oa14; set jukebox vstr music1" //Last music, prepare to restart cycle
set jukebox vstr music1 // Set start of the cycle to the first step
bind j vstr jukebox // Link "j" key to the junkebox script

Cycle all musics and no music[]

This is similar to the one above, but adds a step in the cycle which stops the music.

set music1 "music music/oa01; set jukebox vstr music2"
set music2 "music music/oa02; set jukebox vstr music3"
set music3 "music music/oa06; set jukebox vstr music4"
set music4 "music music/oa07; set jukebox vstr music5"
set music5 "music music/oa08; set jukebox vstr music6"
set music6 "music music/oa13; set jukebox vstr music7"
set music7 "music music/oa14; set jukebox vstr music8"
set music8 "music sound/misc/silence; set jukebox vstr music1" //No music (play silence file), and prepare to restart cycle
set jukebox vstr music1 // Set start of the cycle to the first step
bind j vstr jukebox // Link "j" key to the junkebox script


The way we chose to mute music in the exmple above has been to play a "silence" wave file. In case this may cause some kind of problem on your system, you may alternatively set a non-exising audio file, like this:

set music8 "music nomusic; set jukebox vstr music1" //No music (non-existing sound), and prepare to restart cycle

Although this would cause a message like "Unknown extension for nomusic" to appear.

Also, you may mute music by setting music volume to 0 instead, like this:

set music8 "set s_musicVolume 0; set jukebox vstr music1" //No music (volume 0), and prepare to restart cycle

but that would need you to also tweak the first line of the script, to set the volume back to your liking, like

set music1 "set s_musicVolume 0.25; music music/oa01; set jukebox vstr music2" //Enable music

Of course you have to change the s_musicVolume value to one of your liking.

Revert changes[]

You can delete the script with these commands.

unset music1 //Delete this user-generated cvar
unset music2
unset music3
unset music4
unset music5
unset music6
unset music7
unset music8
unset jukebox //Delete this user-generated cvar
unbind j // Remove any funciton from "j" key.

If you had previously binded the key to a different command, you have to configure it back manually.

See also[]