OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: TrackenHit on 23 Jun 2003, 05:53:34
-
I'm having troubles with this trigger:
Condition: ("!Alive _x" count units Alpha >= 0.9 *Count units Alpha) AND ("!Alive _x" count units Bravo >= 0.9 *Count units Bravo) AND ("!Alive _x" count units Charlie >= 0.9 *Count units Charlie)
Activation: Regular DONE obejective stuff here...it works fine.
What happens is that three enemy squads enter an ambush and when 90% of each squad has been eliminated it does the activation. I did some testing to see whats going on, and I found that when I kill the 'leader' of each squad then the trigger would activate, and thats before I killed 90% of each squad. And from what I understand, if I kill the entire squad, and not the leader, then it still does not execute. ???
Does anyone know what I'm missing, or whats wrong with my Condition code?
-
Update: I tried this
("!Alive _x" count units GROUP Alpha >= 0.9 *Count units GROUP Alpha) && ("!Alive _x" count units GROUP Bravo >= 0.9 *Count units GROUP Bravo) && ("!Alive _x" count units GROUP Charlie >= 0.9 *Count units GROUP Charlie)
I added the GROUP(not in capitals, mind you) to the condition code. Same deal as before...sheesh. :P
-
UPDATE Again...
Ok, I went back to my old condition line. THEN I added this line to the leader of each group:
[SQUADNAME] = group this -->([SQUADNAME] = Alpha, Bravo or Charlie)
Seems to work ok for now...I'll do some more tests and see how well it works.
-
Update AGAIn:
Ok, its still acting up and not doing what I want.
-
Welcome to the forums, TrackenHit
I'm assuming each squad has 10 guys in it here... but:
0.9 * 10 = 9
So your trigger is going off when there are 9 units living, but 10 units counted in the group.
However, I wouldn't use that as an activation line as it is flawed. You see, if you use an "alive _x" condition and compare it to 0.1 * count units alpha then the trigger will never go off.
You see when a unit is killed and the leader realises it is dead (You hear it on the radio... "Oh no, 3 is down" etc.), that unit is removed from the group.
So your "count units alpha" will always be getting smaller, rather than just staying at 10. I suggest you simply replace that with 10... (You'll also need to change the >= sign to a <=) or even better yet use this:
(west countside units alpha < 2) and (west countside units bravo < 2) and (west countside units charlie < 2)
Countside is life specific (ie. it will never count dead units). So when the groups get down to 1 unit each, your trigger will activate. (Just note, if your groups are Russian, you'll need to replace the west with east. If they're resistance, you'll need to use: resistance)
Hope that helps you out ;)