Sound only play in one area

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
merlin
Corporal
Posts: 47
Joined: Tue Jan 13, 2004 11:22 am
Location: essex (uk)
Contact:

Sound only play in one area

Post by merlin »

I have an alarm sound that i would like to play when i run through a trigger.
This works great but only when you near the sound speaker(a model/fx/dummy.tik with the always draw and not solid ticked)
with this script-
local.master = spawn ScriptMaster
local.master aliascache snd_alarm sound/mechanics/Mec_Alarm_10.wav soundparms 1.2 0.0 1.0 0.0 300 12000 item streamed maps "m6l3a "

$alarmspeaker loopsound snd_alarm

so how comes i have the always draw ticked but when i move about 4 feet away from the speaker the sound fades away,i am still in line with the speaker!
How can i get the alarm sound to play whereever i am on the map?
My candle burns at both ends it will not last the night,but oh my foes and oh my friends it gives a lovely light!
Shuriken1
Corporal
Posts: 28
Joined: Thu Sep 02, 2004 3:05 pm
Contact:

Post by Shuriken1 »

Get the player to produce the sound, thats what I do for exactly the same thing, like this:

Code: Select all

parm.other playsound alarm
That is inside my loop which also does the red flashy lights, coincidentally, that makes sure the lights are in sync with the alrm noise. :)
Shuriken1
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

Post by tltrude »

local.master = spawn ScriptMaster
local.master aliascache snd_alarm sound/mechanics/Mec_Alarm_10.wav soundparms 1.2 0.0 1.0 0.0 300 12000 auto loaded maps "m moh dm obj "

The two numbers in orange are min and max distance. So, it would play at full volume inside the 300 unit radius. The sound would fade as you walk away from that radius until you reach the 12000 radius where it would cut out altogether.

The "1.2" is how much to multiply the player's volume by--inside the min distance.
Tom Trude,

Image
User avatar
merlin
Corporal
Posts: 47
Joined: Tue Jan 13, 2004 11:22 am
Location: essex (uk)
Contact:

Post by merlin »

thanks for your help guys you made me see the problem in a different way so for anyone else who would like it in simpletons terms(like me)just put the min distance to 12000 and your sound will follow you wherever you go(like a little lamb)

Now whats the quickest simplest way to stop the sound when i want it to stop!

This is and remains the best forum for help i have ever known thank you all,and i'd just like to say that i have helped someone too!(woohoo)
My candle burns at both ends it will not last the night,but oh my foes and oh my friends it gives a lovely light!
Post Reply