SonicSpades
The Scarlet King of Spades.
So, I've been confused about the new stagefailed global and how to implement it correctly.
Here's some example code, that uses Katmint's Character-specific jingles template as a base, that would change the clear music after the special stage depending on if the player fails the stage or not:
I'm not sure what's wrong but it plays the fail music even though I cleared the stage.
Here's some example code, that uses Katmint's Character-specific jingles template as a base, that would change the clear music after the special stage depending on if the player fails the stage or not:
Lua:
addHook("MusicChange", function(oldname, newname)
for i, player in ipairs({consoleplayer, secondarydisplayplayer})
if newname == "_clear"
and ((gamemap >= 50 and gamemap <= 57)
or (gamemap >= 60 and gamemap <= 66))
if stagefailed == true
newname = "_clea4" //the fail music
end
end
if newname == "_clear"
and ((gamemap >= 50 and gamemap <= 57)
or (gamemap >= 60 and gamemap <= 66))
if stagefailed == false
newname = "_clea3" //the clear music
end
end