Home   Help Search Login Register  

Author Topic: Standard Alarm script  (Read 934 times)

0 Members and 1 Guest are viewing this topic.

Dubieman

  • Guest
Standard Alarm script
« on: 03 Aug 2004, 03:12:31 »
Has this been done yet? Just a standard alarm script for all to use.

I can make one with like two or three triggers but I dunno, which would be better, a script or triggers?


And there are two alarm sounds. The annoying crappy one and and lower tone "play alarm" (I think that's the name) which is much better but only sounds once and I've tried repeating triggers but no luck. :P

How do you use the other lower tone one?

DBR_ONIX

  • Guest
Re:Standard Alarm script
« Reply #1 on: 09 Aug 2004, 22:08:57 »
Something like (In a script)
Code: [Select]
; Incase the sentry spots the palyer twice, the sound will only play once
; As it checks if this is true, and then stops playing the sound
; It's it's still at true
killalarm=false

;Start the script!

#notnoticed
; Does the sentry know about the player? If so, go to the loop #alarm
?(sentry knowsabout player):GOTO "alarm"
~0.5
; Not yet, so keep checking
GOTO "notnoticed"

#alarm
; Play the alarm sound
playsound "alarm2"
; Wait for it to finish
~2
; Does the mission want the alarm to stop now? (Player killed?),
; put killalarm=true somewhere to stop it
?(killalarm):GOTO "killalarm"
; Keep playing the alarm
GOTO "alarm"

Not sure if alarm2 is the correct name for it..
And if the sound is 2 seconds long..

The line that goes ?(senty knowsabout player) etc
I'm not that sure it's correct..
You have a sniper (Or something) a tower, call him sentry.. And if he sees the player, the alarm is raised
You could copy that line, and put a few units names in the differnet lines.. Say for multiple guards

- Ben

DBR_ONIX

  • Guest
Re:Standard Alarm script
« Reply #2 on: 09 Aug 2004, 22:10:28 »
BTW, if you want I could make the script work with as many units as you want, with something like
[this] exec "alarm"
in all the enemys INIT fields

If your intersted (It would be that complicated, really)
- Ben

Dubieman

  • Guest
Re:Standard Alarm script
« Reply #3 on: 09 Aug 2004, 22:16:12 »
If you got the idea submit to OFPEC. ;) I don't need it right now... :P

Might be something good for the community, but which IS better? triggers or scripts for this?

DBR_ONIX

  • Guest
Re:Standard Alarm script
« Reply #4 on: 16 Aug 2004, 13:01:53 »
Scripts are less laggy ;)
As the triggers have a very fast loop, scripts you can chage the delay
:)
- Ben

DBR_ONIX

  • Guest
Re:Standard Alarm script
« Reply #5 on: 16 Aug 2004, 13:16:19 »
Right, I made up the script :)
It took less time than I though ;)
It's well commented, and that explains everything, like how to call it

It's untested atm, so not totaly sure it works :P
- Ben