Fangames > Programming Questions
Making a song only play once
(1/1)
128-Up:
I'm messing around with avoidances, and I want to know how to make it so the background music does not repeat after it's finished.
How do I do this?
klazen108:
This depends on which engine you're using.
In GM8/8.1, music is started with either the sound_play or sound_loop functions. If you were coding it yourself you could simply choose which one you wanted.
In GM8/8.1 with FMOD, you use FMODSoundPlay or FMODSoundLoop in the same way as above.
In GMS, you use audio_play_sound(song,0,0) for non-loop or audio_play_sound(song,0,1) for loop, where song is the sound resource name.
In Seph's engine or the KS engine, there is a musicFunctions script that starts the music based on the current room; you could add logic to see "is this the avoidance song, if so, do play, not loop".
In Yuuutu's engine or YoYoYo's engine, there is a playMusic object that starts the song, you could make a separate one that plays instead of loops.
Navigation
[0] Message Index
Go to full version