what about multiple songs? do i just do
local audio = audio_stream_load("audio file.ogg", "audio file 2.ogg")
function on_warp()
if gNetworkPlayers[0].currLevelNum == LEVEL_NAME then
stop_background_music(get_current_background_music())
audio_stream_set_looping(rand.randint(audio), true)
audio_stream_play(audio, true, 1)
else
audio_stream_play(audio, true, 0)
end
end
hook_event(HOOK_ON_WARP, on_warp)
or what
basically, but instead of using
("audio file.ogg", "audio file 2.ogg")
do
("audio file 2.ogg")
in a separate piece of code
example:
local audio = audio_stream_load("audio file.ogg")
function on_warp()
if gNetworkPlayers[0].currLevelNum == LEVEL_NAME then
stop_background_music(get_current_background_music())
audio_stream_set_looping(rand.randint(audio), true)
audio_stream_play(audio, true, 1)
else
audio_stream_play(audio, true, 0)
end
end
hook_event(HOOK_ON_WARP, on_warp)
local audio = audio_stream_load("audio file 2.ogg")
function on_warp()
if gNetworkPlayers[0].currLevelNum == LEVEL_NAME then
stop_background_music(get_current_background_music())
audio_stream_set_looping(rand.randint(audio), true)
audio_stream_play(audio, true, 1)
else
audio_stream_play(audio, true, 0)
end
end
hook_event(HOOK_ON_WARP, on_warp)
at least, this is what worked for me when i was making mine, however the audio is going to play without stopping (ie. if you get a metal cap, the music keeps playing), i haven't found a fix of it as of far, but that's not a terrible downside in my opinion.