djukel
2nd Dec 06, 5:52 AM
I wrote a small SCAR file that can be attached to any usermade map in order to listen (random) music.
function OnGameSetup()
Rule_AddOneShot(music, 0)
end
function music()
local rand = World_GetRand(1,4)
if rand == 1 then
Util_PlayMusic("SOUND/Music/creditstheme", 0, 0)
elseif rand == 2 then
Util_PlayMusic("SOUND/Music/longroad_to_mortar", 0, 0)
elseif rand == 3 then
Util_PlayMusic("SOUND/Music/genericmissionmusic", 0, 0)
elseif rand == 4 then
Util_PlayMusic("SOUND/Music/enterthesqarecombat", 0, 0)
end
end
You should make a file called mapname.scar and copy these line into it.
function OnGameSetup()
Rule_AddOneShot(music, 0)
end
function music()
local rand = World_GetRand(1,4)
if rand == 1 then
Util_PlayMusic("SOUND/Music/creditstheme", 0, 0)
elseif rand == 2 then
Util_PlayMusic("SOUND/Music/longroad_to_mortar", 0, 0)
elseif rand == 3 then
Util_PlayMusic("SOUND/Music/genericmissionmusic", 0, 0)
elseif rand == 4 then
Util_PlayMusic("SOUND/Music/enterthesqarecombat", 0, 0)
end
end
You should make a file called mapname.scar and copy these line into it.