OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: JasonO on 29 Mar 2007, 20:59:48
-
Hi
2nd Question..
I have an enemy attack mission where you must hold a base.
I need to make it so the enemy enter the base and enter a trigger. They get there ok and activate the trigger. However this makes the ending instant.
How would I have a script to check if any member of a group is still in the trigger, with a 1 second loop for 10 seconds?
I have a feeling it's something like this:
_group = group1
_i = 0
#loop
?!(_group in trigger) : exit
?(_i >= 10) : goto "end"
~1
_i = _i + 1
goto "loop"
#end
;script if 10 seconds is up and someone is still in that trigger from a certain side - meaning the team loose
exit
It doesnt work :S
Thanks for your help.
-
Attached is a working example (tested various things so should always work and should keep working).
I use two triggers, one for detecting if the player is inside the trigger radius, the other for ending the mission. Check it out, mission file in the zip - mission takes place at the small Rahrani map.
If you want to use the script, let me know.
EDIT: did the two trigger thing, because I dislike using scripts for things that can be easily accomplished with triggers.
EDIT1: oops, atttached
-
Did you attach it? ???
Exactly what I wanted, Thanks cheetah 8)