Page 1 of 1

Air raid signal...MOHAA sound drives me to drink...HELP!

Posted: Fri Aug 29, 2003 8:45 pm
by IvanTheTerrible
I would like to add an air raid type of alarm sound that EVERYONE hears that starts looping when the bomber starts it's bombing run, and ends when the bombing run is finished. The closest wav I found is:

Code: Select all

aliascache m2l2_alarm1 sound/mechanics/Mec_Alarm_03.wav soundparms 0.5 0.0 1.0 0.0 1000 20000 item loaded maps "m2l2a "
I have no idea how the script syntax for adding the sound should be written. Here are the pertinent parts of the script:

Code: Select all

Main:

level waitTill prespawn

//*** Precache Dm Stuff
exec global/DMprecache.scr

level.script = maps/dm/mohdm1.scr
exec global/ambient.scr mohdm1

level waittill spawn

thread plane
end

plane:

// Bunch of plane coordinates here ommited for brevity

// Bunch of bomb coordinates here ommited for brevity

spawn script_object "targetname" "bomberpath" "classname" "info_splinepath" "target" $pl1 "origin" "237 -3800 1000" "angles" "15 90 0" "model" "vehicles/p47fly.tik" "$mdl" "vehicles/p47fly.tik" "#set" "1" "speed" "1.5"

// Bomber Speaker
spawn script_object "targetname" "bomberspeaker" "classname" "sound_speaker" "origin" $pl5.origin "#set" "1"

// Bunch of connected plane paths here ommited for brevity

exec global/bomber.scr
wait 125

planeboot:
local.planewait = randomint(180) + 40
wait local.planewait
iprintlnbold "P47 bomber approaching...RUN!!!"
wait 3
thread global/bomber.scr::bomb 1	
goto planeboot

end
I also have a problem with the sound of the plane flying by playing too soon. The players located near the plane at the begining of the run hear the plane properly, but the players located near the end of the run hear nothing.

Posted: Sat Aug 30, 2003 6:31 am
by Alcoholic
For the siren you can add this:

Code: Select all

level.siren = spawn script_model
level.siren.model = "fx/dummy.tik"
level.siren notsolid
level.siren alwaysdraw
level.siren loopsound m2l2_alarm 1 "levelwide" //sound, volume, min distance

Posted: Sat Aug 30, 2003 6:49 am
by jv_map
Alcoholic wrote:level.siren loopsound m2l2_alarm 1 "levelwide" //sound, volume, min distance
Where did you find that levelwide Alcoholic? And, does it work? :)

Posted: Sat Aug 30, 2003 6:47 pm
by Alcoholic
Look in alarmer.scr :P It should work.

No luck Alki

Posted: Sat Aug 30, 2003 10:56 pm
by IvanTheTerrible
I took out the period between siren and model. I also removed the space between alarm and 1, but still no luck. I can't get it to work.

Code: Select all

level.siren = spawn script_model 
level.siren model = "fx/dummy.tik" 
level.siren notsolid 
level.siren alwaysdraw 
level.siren loopsound m2l2_alarm1 "levelwide" //sound, volume, min distance

Might be a typo

Posted: Sun Aug 31, 2003 3:08 am
by Alcoholic
try adding the line "level.siren forceactivate" under the first line

and replace

level.siren loopsound m2l2_alarm1 "levelwide" //sound, volume, min distance

with

level.siren loopsound m2l2_alarm1 1 "levelwide" //sound, volume, min distance


for most variables, you can either type it as

object.variable = a

or

object variable a

Posted: Sun Aug 31, 2003 6:23 am
by jv_map
level.siren model = "fx/dummy.tik"

should be

level.siren model "fx/dummy.tik"

No doubt the console told ya ;), so make sure to always check your console for error messages (check as far up as the 'adding script...' line). If required make a log with logfile 2.

Re: Might be a typo

Posted: Sun Aug 31, 2003 6:25 am
by jv_map
Alcoholic wrote:for most variables, you can either type it as

object.variable = a

or

object variable a
I would rather type the latter as:
object command [a] [c] ...

Since that's how it works. The command mostly sets a variable as well, but it's not strictly required.