Killing a Sound
I've been looking around for a line of code that could kill a .wav file? I know it's possible as the fire crackling sound in Dink stops as soon as Dink leaves the room, but I can't seem to find the script anywhere. It's probably something simple I just can't find it anywhere. Would be most helpful. Thankyou

Maybe something like sound_set_kill(1);
Or use kill_all_sounds(); if you want to kill all sounds...
And sound_set_kill(); requires a number. So you could do:
int &variable = playsound();
sound_set_kill(&variable);
(If I'm not mistaken)
And sound_set_kill(); requires a number. So you could do:
int &variable = playsound();
sound_set_kill(&variable);
(If I'm not mistaken)

All the DinkC commands are in the DinkC Reference and they're in seperate categories as well so you should check the commands in the Sound category.
Is kill_all_sounds(); actually a command? I've tried it everywhere, can't seem to get it working. Would have been the easiest one to use..
October 26th 2005, 10:50 AM

me


It is a command, but after testing it I noticed it didn't work for me either. Seth wrote about it:
void kill_all_sounds(void)
Kills all "survive" sounds, good if you don't want to keep track of the sound # forever. Does not effect regular sounds, so essentially it's a badly labeled procedure. I could probably have renamed it in the type it took me to explain this.
This means, (I think) that it kills only the sounds that have sound_set_survive() set to 1. That might explain why it didn't work for me...
So it's probably my fault that I mentioned this command in the first place...
void kill_all_sounds(void)
Kills all "survive" sounds, good if you don't want to keep track of the sound # forever. Does not effect regular sounds, so essentially it's a badly labeled procedure. I could probably have renamed it in the type it took me to explain this.
This means, (I think) that it kills only the sounds that have sound_set_survive() set to 1. That might explain why it didn't work for me...
So it's probably my fault that I mentioned this command in the first place...

Ok, that's fine. But how would you declare the set_sound_survive command then. Would it be
playsound();
sound_set_survive(1);
(and that would set the above sound to survive?)
then you could use later, when you want to kill it
void kill_all_sounds(void)
{
}
Correct, or?
playsound();
sound_set_survive(1);
(and that would set the above sound to survive?)
then you could use later, when you want to kill it
void kill_all_sounds(void)
{
}
Correct, or?
I think Seth's terminology might be flawed. In The updated DinkC reference it states that it simply cancels the sound_set_survive() command. So it might not be usefull at all.
I can't find the code of it being used in the original Dink either.
int &sound = playsound(#playsound stuff here);
sound_set_survive(&sound);
//Much, much later...
kill_all_sounds();
sound_set_survive(&sound);
//Much, much later...
kill_all_sounds();
No luck for me, I'm guessing it's impossible to just cut a .wav off then..
Would that still work if i used the two lines in different scripts.. or would that be global or something?