Jump to content
Sign in to follow this  
tracy_t

Positional sounds

Recommended Posts

I would like to play a sound at position <pos>, where pos is a dynamic position (*not* a static position, so I can't use a trigger unfortunately)

However, the PlaySound statement, according to the manual, only takes the sound to play and not a position.

Any idea on how to play sounds from any given position? Can I use setpos on a trigger and then have it play the sound?

Share this post


Link to post
Share on other sites

Setpos a gamelogic at the position you need, then get the gamelogic to say it.

RED

Share this post


Link to post
Share on other sites

Move the gamelogic around as necessary, and have a little script watching it:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">@(player distance soundlogic)

soundlogic playsound "sound"

exit

Share this post


Link to post
Share on other sites

Thanks for the reply Red.

And.. M21man, does that code work - can you have a unit playing a sound?

ie: instead of

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

soundlogic playsound "sound"

you could have:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

Player playsound "sound"

to make the sound fire at the player's position.

What I want to do is have my zombies make some moaning noises, so if I could use

_myzombie playsound "moan1"

that'd be great. It certainly doesn't say you can do that in the command ref. I will try it tomorrow!

Cheers

Scott

Share this post


Link to post
Share on other sites

I use say rather than playsound to get positional sound from my planes

Share this post


Link to post
Share on other sites

Thanks for your replies. "Say" does just the job.

Scott

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  

×