The Dink Network

Killing a Sound

October 24th 2005, 06:08 AM
spike.gif
kikki
Peasant He/Him United Kingdom
This place has changed :) 
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
October 24th 2005, 09:52 AM
fairy.gif
Glennglenn
Peasant He/Him Norway
GlennGlenn doesn't want a custom title. 
Maybe something like sound_set_kill(1);
October 24th 2005, 01:10 PM
slimeg.gif
metatarasal
Bard He/Him Netherlands
I object 
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)
October 24th 2005, 01:10 PM
fish.gif
Simeon
Peasant He/Him Netherlands
Any fool can use a computer. Many do. 
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.
October 26th 2005, 10:09 AM
spike.gif
kikki
Peasant He/Him United Kingdom
This place has changed :) 
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
anon.gif
me
Ghost They/Them
 
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...
October 26th 2005, 10:56 AM
spike.gif
kikki
Peasant He/Him United Kingdom
This place has changed :) 
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?
October 26th 2005, 11:08 AM
slimeg.gif
metatarasal
Bard He/Him Netherlands
I object 
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.
October 26th 2005, 11:30 AM
spike.gif
kikki
Peasant He/Him United Kingdom
This place has changed :) 
I can't find the code of it being used in the original Dink either.
October 26th 2005, 11:30 AM
custom_magicman.gif
magicman
Peasant They/Them Netherlands duck
Mmmm, pizza. 
int &sound = playsound(#playsound stuff here);
sound_set_survive(&sound);

//Much, much later...

kill_all_sounds();
October 26th 2005, 11:37 AM
spike.gif
kikki
Peasant He/Him United Kingdom
This place has changed :) 
No luck for me, I'm guessing it's impossible to just cut a .wav off then..
October 26th 2005, 12:00 PM
spike.gif
int &sound = playsound();
sound_set_kill(&sound);
October 26th 2005, 12:16 PM
spike.gif
kikki
Peasant He/Him United Kingdom
This place has changed :) 
Would that still work if i used the two lines in different scripts.. or would that be global or something?
October 26th 2005, 12:24 PM
spike.gif
kikki
Peasant He/Him United Kingdom
This place has changed :) 
Woohoo, I've finally managed to cut it off. Had to use a global variable though. Thanks all.