Speaker function

If you're looking for mapping help or you reckon you're a mapping guru, post your questions / solutions here

Moderator: Moderators

Desert Eagle
Captain
Posts: 237
Joined: Mon Jan 13, 2003 1:05 am
Location: Mapping Bunker
Contact:

Speaker function

Post 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?
Desert-Eagle
....The Eagle Has Landed...
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post 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)
Image
Slyk
Lieutenant Colonel
Posts: 361
Joined: Sun Jul 14, 2002 12:42 am
Location: Elizabethtown, PA

Post 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.....
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post 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
}
Image
XKA Murdock
Sergeant
Posts: 59
Joined: Wed Mar 12, 2003 7:28 pm

but how?

Post 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:
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Post 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
Live to map, not map to live.
-mohaa_rox, .map
moderator
XKA Murdock
Sergeant
Posts: 59
Joined: Wed Mar 12, 2003 7:28 pm

Post 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:
panTera
Brigadier General
Posts: 573
Joined: Wed Jan 29, 2003 11:46 pm
Location: The Netherlands
Contact:

Post by panTera »

Tut script

That speaker script goes after the 'level waittill spawn' part.
XKA Murdock
Sergeant
Posts: 59
Joined: Wed Mar 12, 2003 7:28 pm

Post 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
XKA Murdock
Sergeant
Posts: 59
Joined: Wed Mar 12, 2003 7:28 pm

Post 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?) :(
XKA Murdock
Sergeant
Posts: 59
Joined: Wed Mar 12, 2003 7:28 pm

Post 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
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Post by mohaa_rox »

Live to map, not map to live.
-mohaa_rox, .map
moderator
XKA Murdock
Sergeant
Posts: 59
Joined: Wed Mar 12, 2003 7:28 pm

Post by XKA Murdock »

well link is broken pall :D sorry... :(
anywhere eslse where i can do this tut?
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Image
XKA Murdock
Sergeant
Posts: 59
Joined: Wed Mar 12, 2003 7:28 pm

Post 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 :))
Post Reply