Page 1 of 2

Speaker function

Posted: Fri Feb 21, 2003 8:12 pm
by Desert Eagle
In Radiant how does one put the sounds in a location. I understand the ubersound tut.

What I do not understand is how to put the sound in the map correctly. I would like to use the Tiger idling sound in MP Map, at a local location (local sound), do I use the speaker function in Radiant to place sound?

Posted: Fri Feb 21, 2003 8:15 pm
by jv_map
Create a script_model with model 'fx/dummy.tik'. Assign a targetname of e.g. speaker.

In your script type:
$speaker playsound mysound

8)

Posted: Fri Feb 21, 2003 8:28 pm
by Slyk
JV-

IF you would want the sound to be triggered, such as in a large door opening/closing can you just add:

waittill_trigger as in $speaker waittill_trigger playsound mysound ???

not sure of the proper command syntax there either.....

Posted: Fri Feb 21, 2003 8:50 pm
by jv_map
Well usually the speaker isn't a trigger :?.

Let's say you've got a trigger_multiple with targetname 'trigger' that has to trigger the sound generated by the script_model $speaker. If you want it to play every time the trigger is activated, a thread in your script would look like this:

Code: Select all

while(1)
{
  $trigger waittill trigger
  $speaker playsound mysound
  wait 1.5 // length of sound file
}

but how?

Posted: Wed Mar 12, 2003 7:31 pm
by XKA Murdock
but.. i'm a noob and i didn't uderstand the ambiente sound tut. and i read that it would not be good to place triggers for MP maps... till i heard of the speaker project!

how do i build this speaker? how do i target it 'fx\dummy.tik'? where do i code the part for the speaker to start playing? this is so complicated! :roll:

Posted: Thu Mar 13, 2003 12:17 pm
by mohaa_rox
Just select the object and press "n" and give it a "targetname" (key) of "xxx" (value). Then create a trigger multiple where you want the sound to be played. Then give it a setthread "speaker". In your script:

speaker: //the setthread value
$targetname playsound mysound //$targetname is the targetname you give your speaker
end

Posted: Thu Mar 13, 2003 10:15 pm
by XKA Murdock
ok... i understood everything, what i meant was almost everything... (sorry for my dumbness) but where do i put that script part? :roll:

Posted: Thu Mar 13, 2003 10:32 pm
by panTera
Tut script

That speaker script goes after the 'level waittill spawn' part.

Posted: Thu Mar 13, 2003 10:46 pm
by XKA Murdock
nice post! the best i've seen! i'm very lazzy... now i don't have to look for it :D thnx

Posted: Fri Mar 14, 2003 12:55 am
by XKA Murdock
sorry guys! i can't make this!
what do i put in the "$speaker1 playsound mysound" mysound parameter? is it the sound path? do i need to code anywhere else? i only coded my g2.scr (g2 is map name) and nothing more. i also make a speaker and i made it a "trigger_multiple" i added targetname "speaker1" and setthread "speaker" to it's "parms" (are they parameters?) :(

Posted: Fri Mar 14, 2003 1:13 am
by XKA Murdock
i'm desperate! can anyone malink me at a post a demo map? a pk3 with all it's needed to make a player hear a sound when he's near the object. like a square room with a speaker on it. when the playere gets near the speaker he herars the custom sound...
simple though? NOT! :(

please help me!

(pk3is no t necessary, only the .map and the .scr( i'd prefer this way so that i could analyze how you did that)) i'll compile it later :D

Posted: Fri Mar 14, 2003 6:40 am
by mohaa_rox

Posted: Fri Mar 14, 2003 12:48 pm
by XKA Murdock
well link is broken pall :D sorry... :(
anywhere eslse where i can do this tut?

Posted: Fri Mar 14, 2003 12:59 pm
by jv_map

Posted: Fri Mar 14, 2003 1:10 pm
by XKA Murdock
thnx... i'm analyzing the map you made for "TheStorm" this afternoon when i return home.

thnx a lot (keep up the good work helping others :))