Alliedassault

Alliedassault (alliedassault.us/index.php)
-   MoH Maps, Mods & Skins (alliedassault.us/forumdisplay.php?f=11)
-   -   Radio: Sound Emitter (alliedassault.us/showthread.php?t=10388)

ThinIce 10-12-2002 10:10 PM

Radio: Sound Emitter
 
Can somone help me, say I want to place a radio on my map. And I want it to play some sound, looping over and over again, how would I do that? Is there a script command?

cry:

Crizz 10-13-2002 05:15 AM

I´ve some ambient sounds in DesertBase_final / sandstorm!

I have placed a soundspeaker next to the radio and targeted it to a trigger multiple all (inside the entire room) So when you spawn in that room or enter the room you trigger the radio.

Then enter this in your .scr file (these lines are directly from my .scr file (radio_1 = targetname for your speaker):

level waittill spawn

thread sound_fx

-----------------------

sound_fx:

thread radio_1
thread radio_2

end


radio_1:

$radio_1 waittill trigger
$radio_1 loopsound m2l2b_radio1

end

radio_2:

$radio_2 waittill trigger
$radio_2 loopsound m2l2a_radio2

end

If you don´t hear a radio sound then use an Ubersound.scr that allows all sounds in all gamemodes! BUT use only one in your main folder (beware of hidden Ubersound files in custom maps) -> More than one modified Ubersound.scr in your Main folder will mess up the sounds again!!

There may be other ways to include ambient sounds, but I found this an easy way and it will play the sound only when you enter a trigger field. So it´s more CPU friendly.
You could even break up the loop and let the trigger check again if you´re near the radio before playing a loop again. The CPU will say thank you ;-)

radio_1:

$radio_1 waittill trigger
$radio_1 loopsound m2l2b_radio1
wait 5
$radio_1 stoploopsound
wait 1
goto radio_1

end

sound will play 5 secs, stop for one sec, check the trigger and starts again if you´re inside the trigger. If not it will be silent!
Works great for crickets, some radio sounds. Not so good for machine sound loops etc. as minimum is 0.1 sec for the wait time.

Crizz

ThinIce 10-13-2002 02:37 PM

Thank you sound god :P
You've helped me a heap!

divaid2001 10-15-2002 04:26 AM

doesn't work by me!

I made a sound_speaker, gave it a targetname of radio_1 and target t15.
I made a trigger_multipleall and give it a targetname of t15 so they are linked together.
I exactly copied your script, but I get that fatal error script in the game. you know what I mean, no weapons, no planes, nothing works.

Crizz 10-15-2002 06:44 AM

Only apply targetname radio_1 to the radio and target radio_1 to the trigger_multipleall! The arrow must point from the trigger to the radio.
You´ve targeted the radio to the trigger -> wrong direction!
And no need for a t15 or similar.

Crizz

divaid2001 10-15-2002 08:17 AM

thanks man!

divaid2001 10-15-2002 09:04 AM

goddamnit, still don't work. ah, never mind, everything I try, failes, I think i quit mapping

Crizz 10-15-2002 10:28 AM

NO!!!! Bad idea!

Gimme a mail address and I send you an example file + script! No prob!

Crizz

ThinIce 10-15-2002 10:43 AM

Don't use the speaker, make a script object.

Crizz 10-15-2002 10:52 AM

Maybe! I´ve used sound_speaker in DB_final / Sandstorm and it works just fine. Script_object should also do the trick, haven´t tried it!


All times are GMT -6. The time now is 08:29 PM.

Powered by vBulletin® Version 3.8.12 by ScriptzBin
Copyright ©2000 - 2025, vBulletin Solutions Inc.
© 1998 - 2007 by Rudedog Productions | All trademarks used are properties of their respective owners. All rights reserved.