How to stop playsounds?
Okay so my friend wanted me to ask this question for you.
Maybe he is too hurry on making his game? Who knows?
So he wanted to know if there is any way to stop a playsound in a d-mod. (Please note this is not a playmidi). He has got this real cool intro song into his D-Mod. But whenever he starts/loads it, the song/playsound won't stop. Is there any way to stop it?
Not from my experience.
Thanks, Skull.
(Really LordDan)
Maybe he is too hurry on making his game? Who knows?
So he wanted to know if there is any way to stop a playsound in a d-mod. (Please note this is not a playmidi). He has got this real cool intro song into his D-Mod. But whenever he starts/loads it, the song/playsound won't stop. Is there any way to stop it?
Not from my experience.
Thanks, Skull.
(Really LordDan)
You may be able to make the sound a variable and kill it. I think I've seen this done in other DMODs. I'm not 100% sure but it's worth a shot.
int &sound = playsound()
kill(&sound,1);
int &sound = playsound()
kill(&sound,1);
Well, not luck on that one. It still isn't working.
Are you sure? I think that it should work. Remember that if you create the sound in one script and kill in another a local variable won't do, you need to use a global. Alternatively, creating a sprite on the screen, attaching the sound to that sprite and then killing the sprite when you want the sound to end might do it.
Another unholy technique to remove the sound would be to use sound_set_vol(&sound,some really low value here). I don't know how low it should be since I've never used the command for this purpose but you could start with something like -99999, pump up the volume and see if you can still hear something.
Another unholy technique to remove the sound would be to use sound_set_vol(&sound,some really low value here). I don't know how low it should be since I've never used the command for this purpose but you could start with something like -99999, pump up the volume and see if you can still hear something.
He's asking how to add a sprite into the title-screen. I just told him to watch how the START LOAD and QUIT buttons are created.
He didn't get it to work. He says that he puts the song into the end of the game, and puts a normal MIDI into the beginning.
You can stop a sound, similar to what Rabid said but you need to use sound_set_kill() instead of just kill().
//start playing sound
int &sound = playsound();
//stop playing sound
sound_set_kill(&sound);
//start playing sound
int &sound = playsound();
//stop playing sound
sound_set_kill(&sound);













