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

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
IvanTheTerrible
Sergeant
Posts: 55
Joined: Thu Jun 26, 2003 7:35 pm
Location: Upland, CA

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

Post 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.
User avatar
Alcoholic
General
Posts: 1470
Joined: Sat May 17, 2003 5:57 am
Location: California
Contact:

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

Post 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? :)
Image
User avatar
Alcoholic
General
Posts: 1470
Joined: Sat May 17, 2003 5:57 am
Location: California
Contact:

Post by Alcoholic »

Look in alarmer.scr :P It should work.
User avatar
IvanTheTerrible
Sergeant
Posts: 55
Joined: Thu Jun 26, 2003 7:35 pm
Location: Upland, CA

No luck Alki

Post 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
User avatar
Alcoholic
General
Posts: 1470
Joined: Sat May 17, 2003 5:57 am
Location: California
Contact:

Might be a typo

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

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

Re: Might be a typo

Post 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.
Image
Post Reply