The Dink Network

playsound() question

January 12th 2008, 07:43 PM
dinkdead.gif
If I use the following script no sound is heard, but if I change the &current_sprite in playsound to 0, it works (but is not 3D). It makes no difference if the sound_set_vol() part is used or not.

How do I get the 3D effect to work?

void main (void)
{
sp_nodraw(&current_sprite, 1);
sp_nohit(&current_sprite, 1);
int &qfall = playsound(12, 22050, 0, &current_sprite, 1);
sound_set_vol(&qfall, -2750);
}
January 12th 2008, 08:37 PM
sob_scorpy.gif
DinkDude95
Peasant He/Him Australia
The guy with the cute D-Mod. 
Not sure, but you could try taking out the int &qfall and the sound_set_vol(&qfall, -2750);.
January 12th 2008, 08:45 PM
dinkdead.gif
No difference, as I said (or meant to).

This does not work:
void main (void)
{
sp_nodraw(&current_sprite, 1);
sp_nohit(&current_sprite, 1);
playsound(12, 22050, 0, &current_sprite, 1);
}

and I can't just attach the sound in the editor because I want to make it quieter.
January 12th 2008, 09:06 PM
sob_scorpy.gif
DinkDude95
Peasant He/Him Australia
The guy with the cute D-Mod. 
Erm... I dunno. Try switching the positioning of the sp_nodraw and sp_nohit with the playsound and set_sound_vol. I often find that making tiny little changes, like this, often work. For instance, once, my script was perfect, but it wasn't working. So I copied and pasted everything from it, into a new script. Deleted the old one, and renamed the new one. And it worked.
January 12th 2008, 10:35 PM
spike.gif
Who is the sound attached to? Seems like that's the problem.
January 13th 2008, 08:30 AM
dinkdead.gif
If everything is commented out except playsound(12, 22050, 0, &current_sprite, 1); it still doesn't work.

It's just attached to a random sprite, a non-animated duck.