Page 3 of 3
Posted: Sun Dec 21, 2003 4:07 am
by bdbodger
Most of the script is for the ai's if you don't have any ai's then you don't need most of the script try this instead just put it in the level script and forget the other script .
Code: Select all
main:
......
......
// add this to the main part of your level.script
for (local.i=1;local.i <= $alarm.size;local.i++)
{
$alarm[local.i] notsolid
level.alarm_sound[local.i] = spawn script_model "model" "fx/dummy.tik"
level.alarm_sound[local.i] notsolid
level.alarm_sound[local.i].origin = $alarm[local.i].origin
}
end
//-------------------------------------------------------------------
alarm_player_reset:
for (local.i=1;local.i<= $alarm.size;local.i++)
{
if((vector_length (self.origin - $alarm[local.i].origin))< 80)
{
self playsound alarm_switch
if(self.on !=1)
{
$alarm[local.i] anim turnon
self.on = 1
level.alarm_sound[local.i] loopsound alarmbell
}
else
{
$alarm[local.i] anim turnoff
level.alarm_sound[local.i] stoploopsound
self.on = 0
}
}
}
end
alarms
Posted: Sun Dec 21, 2003 5:51 pm
by Gold
man this works to perfection in m6l1c,,,,also what i think is so great about this script is maybe later we will see more multiplayer maps with alarms:))) In m6l2a and m4l3 it also works but the alarms seem to be independant of one another,,meaning if i cut a alarm on in one area of the map the second player can come to that area and cut it off but if he goes to a different alarm and cuts it on,,it doesnt effect the other switchs,doesnt effect the sound levelwide either which that is good,i traced the difference back to the actual bsps,,,,seems that each alarm in m4l3 and m6l2a has there own independant swicths and speakers,,were as in m6l1c it has the following in the bsp
"targetname" "waittrigger_alarm_master"
"classname" "trigger_multiple"
"origin" "4452 5464 -656"
"target" "t1465"
"spawnflags" "8"
"#alarm_switch" "2"
"$zone" "zone3"
"classname" "trigger_multipleall"
"$targetname" "zone_trigger"
}
ok i must say im more than happy to just have it working this well but i was just wondering if theres any way thru scripting to hook all the sound and swicths levelwide together?? if its possible would be great ,,if its not like i said im still very happy it works as good as it does now hehehe,,,i just put a sample here of whats in the m4l3 bsp so ya can give a quick look see to see if its possible:))
"targetname" "alarm"
"angle" "180"
"origin" "-1834.62 -1192.83 52.01"
"testanim" "idle"
"model" "animate//alarmswitch.tik"
"scale" "1.0"
"classname" "animate_equipment_alarmswitch"
}
"targetname" "alarmspeaker8"
"origin" "-1840.85 -1192.84 170.23"
"classname" "script_model"
"model" "fx/dummy.tik"
"testanim" "idle"
}
"origin" "-4936 830 52"
"setthread" "alarm_player_reset"
"classname" "trigger_use
"origin" "-1702 80 44"
"classname" "trigger_use"
"setthread" "alarm_player_reset"
like i said be4 if its not possible to group them in m4l3 and m6l2a i understand completly and am pretty content about the results so far,,,also in m6l1c the following line was added to the script
exec global/alarmlight.scr which gives a extra added effect because the overhead lights go off and on with the alarms:)))) woooohoooo
Gold<<mohha freak
Posted: Sun Dec 21, 2003 7:05 pm
by Gold
just a thought would it be possible to bind all the alarm triggers and alarm speakers together in those 2 paticular maps and it work correctly?? and if so what would be a good example of this?? or am i thinking about it all in the wrong way lol
Gold<<mohha freak
Posted: Sun Dec 21, 2003 7:49 pm
by Gold
hmmmm would it be possible to say bind or glue this origin
"targetname" "alarm"
"angle" "270"
"origin" "-3173.91 396.38 264.01"
"testanim" "idle"
"model" "animate//alarmswitch.tik"
"scale" "1.0"
"classname" "animate_equipment_alarmswitch
to this origin??
"targetname" "alarm"
"angle" "0"
"origin" "-5656.77 -6905.91 -17.99"
"testanim" "idle"
"model" "animate//alarmswitch.tik"
"scale" "1.0"
"classname" "animate_equipment_alarmswitch"
Gold<<mohha freak
Posted: Mon Dec 22, 2003 10:35 am
by bdbodger
I thought you might like to have the alarms separate that way the alarm will bring players to the site of the alarm . If you want all the alarms linked the use this instead
Code: Select all
main:
......
......
// add this to the main part of your level.script
for (local.i=1;local.i <= $alarm.size;local.i++)
$alarm[local.i] notsolid
level.alarm_sound = spawn script_model "model" "fx/dummy.tik"
level.alarm_sound notsolid
level.alarm_on = 0
end
//-------------------------------------------------------------------
alarm_player_reset:
if(level.alarm_on == 0)
{
level.alarm_sound loopsound alarmbell 1.5 "levelwide"
for (local.i=1;local.i<= $alarm.size;local.i++)
$alarm[local.i] anim turnon
level.alarm_on = 1
}
else
{
level.alarm_sound stoploopsound
for (local.i=1;local.i<= $alarm.size;local.i++)
$alarm[local.i] anim turnoff
level.alarm_on = 0
}
end
You can spawn alarms or use script to move them but what about the trigger use that surrounds the alarm and makes it work ? It has to have a trigger use around it and the trigger must have a Key: setthread and value: alarm_player_reset
alarms
Posted: Tue Dec 23, 2003 2:35 am
by Gold
man thanks so much,,,both of these scripts work to perfection!!! and yes maybe i will use both at different times,,,,thats also a good idea to draw enemies to ya location,,,btw in m6l2a we were having a little lag when we turned on the spotlights,,,i suggested we use ya rescue spotlight script instead ,,,and wham the lag left hehehehe,,,hmmm makes me wonder what other goodies ya hav scripted lol,,,like maybe a working drivable tank for spearhead

)) If ya havent yet im sure ya will get around to it hehehe,,,btw ya maps are awesome also:)) once agian thanks so much for the alrm scripts,,,i appreciate it very much,,,and in advance sorry jv if i got off topic a little bit lol
Gold << a happy mohha freak
gone to check all of bdbodgers posts lol
alarms
Posted: Tue Dec 23, 2003 2:48 am
by Gold
in response to
You can spawn alarms or use script to move them but what about the
trigger use that surrounds the alarm and makes it work ?
It has to have a trigger use around it and the trigger must
have a Key: setthread and value: alarm_player_reset
yes i understand somewhat by looking at the bsp for m612a and m4l3 in radient that there has to be a trigger to make the alarm work,,,as far as having a idea how to script and spawn working alarms into stock maps with usable triggers i would be lost,am i correct in thinking the trigger would have to be in the bsp and couldnt be scripted in?? im still a noob with training wheels on hehehehe,,,thou i must admit i have a great desire learn more about scripting,,and i have spawned a couple things into stock maps so far
Gold <<still happy hehehe
Posted: Tue Dec 23, 2003 1:48 pm
by bdbodger
It is possible to spawn triggers and alarms it is just a lot of work . Maybe some one will agree to help you with that . good luck .
Re: alarms
Posted: Tue Dec 23, 2003 5:35 pm
by WarTech
Gold wrote:in response to
You can spawn alarms or use script to move them but what about the
trigger use that surrounds the alarm and makes it work ?
It has to have a trigger use around it and the trigger must
have a Key: setthread and value: alarm_player_reset
yes i understand somewhat by looking at the bsp for m612a and m4l3 in radient that there has to be a trigger to make the alarm work,,,as far as having a idea how to script and spawn working alarms into stock maps with usable triggers i would be lost,am i correct in thinking the trigger would have to be in the bsp and couldnt be scripted in?? im still a noob with training wheels on hehehehe,,,thou i must admit i have a great desire learn more about scripting,,and i have spawned a couple things into stock maps so far
Gold <<still happy hehehe
Gold thats not to hard to do just time consuming, but to answer you yes it can be done with scripts only. LOL
BTW: bdbodger is now been awarded the <TWZ>bdbodger HONORARY title LOL

You think he will take that bate hehehhe
<TWZ>WarTech
Visit us at
www.twzfragzone.com or
www.texaswarzone.com
Come and get some at server <TWZ>WarTech's-Lair=[sp-maps]=Spearhead-2.15= or any of the <TWZ> servers
