Jump to content
Sign in to follow this  
erem2k

Stop sound broadcasting from Say3D

Recommended Posts

Hello folks,

I'm here with another audio-themed question. Music (sound) is broadcasted by a object using Say3D command - and I need to find a way to stop broadcast using user's action (addAction, strapped to same object). I heard about attaching Game Logic object to the sound-broadcasting object and killing Logic as soon as user needs to stop playing music - is it possible in any way?

Share this post


Link to post
Share on other sites

Yup, sound dies, but with "Sound not found" - I'd want to make something more error-notification-free

Share this post


Link to post
Share on other sites

Do you want to stop a longer type of sound or a sound that's been repeated in a loop?

Units usually stop talking when dead, buildings and objects stop emiting sound when the damage value reaches 1.

If damaging the unit isn't possible then let a game logic say the sound and kill the game logic as soon as you want the sound to stop.

Share this post


Link to post
Share on other sites

Long one, apparently (music track is played). Game logic is spawned and deleted the way regular units are spawned (and deleted, obviously), right?

Edited by Erem2k

Share this post


Link to post
Share on other sites

Why not do this? In CfgSounds, create a new class, but with no sound file or the same sound file/dummy file with reduced decibels. Not sure if the first would work, but reducing the dB would.

class snd_test
{
name = "snd_test";
sound[] = {"sound\snd_test.ogg", db-100, 1};
  	titles[] = {};
};

Then tell it to say3D "snd_test". Not pretty, but should do it...

Edited by rakowozz

Share this post


Link to post
Share on other sites
Why not do this? In CfgSounds, create a new class, but with no sound file or the same sound file/dummy file with reduced decibels. Not sure if the first would work, but reducing the dB would.

class snd_test
{
name = "snd_test";
sound[] = {"sound\snd_test.ogg", db-100, 1};
  	titles[] = {};
};

Then tell it to say3D "snd_test". Not pretty, but should do it...

I think this works similar to kbtell, since an object/unit can only say one thing at a time it will be added to the qeue, so it won't probably stop at the very moment you need it to.

Share this post


Link to post
Share on other sites
I think this works similar to kbtell, since an object/unit can only say one thing at a time it will be added to the qeue, so it won't probably stop at the very moment you need it to.

Err, I did a sound file containing no sound, declared it properly and made simple switch with it - still nothing, sound continues playing. I think approach with game logic will work - but how to spawn it (trough createVehicle or createUnit)?

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×