OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Chud on 18 Sep 2005, 22:10:40

Title: alarm trigger timeout?
Post by: Chud on 18 Sep 2005, 22:10:40
I have a trigger with an alarm that sounds when the east are not present. How do I get the alarm to shut off after awhile???
Title: Re:alarm trigger timeout?
Post by: Abe on 20 Sep 2005, 17:18:25
I've been wondering how to time out triggers.  There must be a way.
Title: Re:alarm trigger timeout?
Post by: h- on 20 Sep 2005, 17:58:57
Umm, I think this requires multiple triggers?

One trigger that sets a variable like my_alarm to true when you want the alarm to sound, the one playing the sound would have condition my_alarm and a third trigger would also have a condition my_alarm but would also have countdown of the time you want the alarm to sound (min, max, mid boxes) and 'on activation' field would have my_alarm=false

Trigger 1:
The trigger detecting East not present
Repeatedly
Condition: this && !(my_alarm)
On activation: my_alarm=true

Trigger 2 (sound):
size: 0/0
Repeatedly
Condition: my_alarm
Effect: alarm sound

Trigger 3
size: 0/0
Repeatedly
Min: (time in seconds) Max: (time in seconds) Mid: (time in seconds)
Condition: my_alarm
On Activation: my_alarm=false


That should work, but no guarantees :P
Title: Re:alarm trigger timeout?
Post by: macguba on 20 Sep 2005, 18:00:25
init.sqs

alarmOn=false


Trigger:-

Repeatedly
Condition: alarmOn
Effects:  alarm sound


Use other triggers to set the variable alarmOn to true or false as you like, thereby turning the alarm sound on or off.  For example:-

Trigger1:
East detected by West
On activation:  alarmOn=true

Trigger2:
Countdown:   30    30     30
Condition:  alarmOn
On Activation:  alarmOn=false

When East is detected the variable is set to true at the alarm sounds.  At the same time, trigger2 is fired and starts a 30 second countdown.     30 seconds later the variable is set back to false (as it was at the start of the mission in init.sqs) and the alarm stops.


Edit:  Grrr ... too slow again.
Title: Re:alarm trigger timeout?
Post by: Chud on 21 Sep 2005, 03:58:04
Thanx.... been wondering how to do that for some time now.
Title: Re:alarm trigger timeout?
Post by: Tyger on 21 Sep 2005, 04:14:10
you can also do stuff similar to that in the deactivation box of a trigger. i.e.

Trigger:
West Detected by East Repeatedly
Cond: this
on Activation: westDetected = true
on Deactivation: westDetected = false

AlarmTrigger:
Cond: westDetected
Effects: play Alarm sound

If west is detected by east, it will play the alarm, but when east doesn't see west anymore, the alarm shuts off.