OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: SEAL84 on 26 Jan 2004, 04:47:15
-
This one is driving me nuts >:(
I have five enemy groups that will attack a town held by my grunts, and I need a trigger that will fire when the attack has been defeated - i.e. when all of them are dead.
My troops first take the town from the enemy, then there is a counterattack, so a massive "not present" trigger won't work.
I've tried a bunch of stuff and nothing seems to work...
This is really driving me up the wall because the answer is probably pretty easy to figure out...help me, somebody :noo:
-
try a west present trigger in town, if the player's slow the reinforcements will show up before the player has defeated the enemy. Makes it kinda tricky.
:beat: *Gets Shot* :beat:
-
You'll need a giant trigger that is activated by east & detected by east (or whatever the exact wording is, and change the side to whatever is required).
Then create a script like so:
#reset
_enemies = list TriggerName
_size = count _enemies
_i = 0
_count = 0
#check
? !(alive (_enemies select _i)) : _count = _count + 1
_i = _i + 1
~0.1
? _i < _size : goto {check}
? _count < _size : goto {reset}
[] exec {nextScript}
I don't have access to OFP here so test it out and let me know if it works.
-
Simply you can count the groups holding the town and after the groups of the counter attack...
make a condition in a trigger or in a script:
@ count units group01 + count units group02 + count units group03 (+ count uni....) < 1
-
No, no, no these are all wonderful answers but they are all far too complicated. ;D ;D ;D
All you need is two triggers over the town area, you might need to experiment a little to get exactly the right areas.
Trigger1
Synro with last enemy attack group
Activation Box: Group leader present
On activation: baddiesHere=true
Trigger2
Activation Box: Enemy not present
Condition: this and baddiesHere
On activation: end mission stuff
The first trigger fires when the final enemy group reaches the town. It sets the variable baddiesHere to true. The second trigger will only fire when this variable is true (i.e. after the attack has started) AND when the area is clear of the enemy (i.e. the attack has been defeated).
You can use variables to "turn" triggers "on" and "off" in all kinds of situations. It's a very powerful mission editing tool.
-
Use mine, use mine! It, er, it gets you chicks!
-
Use mine, use mine! It, er, it gets you chicks!
Hmph... Just used it didn't get any >:(
;D
-
;D ;D