Jump to content
Sign in to follow this  
GhettoP

Objective Problem!!!

Recommended Posts

Ok. I have a mission where I first go into an enemy controlled area and destroy all the enemy forces. Once that First objective is completed, the trigger triggers enemy reinforcements to come in. The enemy reinforcements are a total of three groups. Each group is a mechanized infantry squad. I have each group labled grp20, grp21, and grp22. The Second objective of the mission is to destroy the enemy counterattack. I have the following sensor to detect this objective:

class Item7

{

position[]={8165.000000,8.000000,3160.000000};

age="UNKNOWN";

expCond="((""fleeing _x"" count units grp20) + (""not alive _x"" count units grp20)) == count units grp20; ((""fleeing _x"" count units grp21) + (""not alive _x"" count units grp21)) == count units grp21; ((""fleeing _x"" count units grp22) + (""not alive _x"" count units grp22)) == count units grp22";

expActiv="L6 globalchat ""Objective 2 is Completed""; ""2"" objstatus ""DONE""; objective2=true";

class Effects

{

};

synchronizations[]={};

};

The problem I am having is that when just ONE of the groups are destroyed, it says the objective is complete but I want it to be complete when ALL of the groups are destroyed. Anybody know how I can make a sensor which will be triggered when ALL three of the groups are destroyed? Please let me know. Thanks

Share this post


Link to post
Share on other sites

Make three triggers, each like that one you have there. And when they fire have grp1dead=true. and 2 and 3 in those triggers. then have a fourth trigger with the condition of grp1dead and grp2dead and grp3dead that has the on activation of doing the objective complete.

Share this post


Link to post
Share on other sites

Why you makin the asking in your trigger

so complex? Tell me more, does the mission

continue after that? could it be enough if you

only ask for east present in the specified area?

Remember not present means dead or retreated

(at least from that area).

vitoal is also right, with makin 3 triggers

and sending 3 conditions (like a,b,c all true)

to the fourth trigger, where in the condition

field would be: a and b and c

Share this post


Link to post
Share on other sites

expCond="((""fleeing _x"" count units grp20) + (""not alive _x"" count units grp20)) == count units grp20; ((""fleeing _x"" count units grp21)

Also a mistake i found is:

you have to use the "and" instead of the ";" in

the condition field. The ";" indicates that the

command ends here, the "and" indicates,

that there is another condition needed too.

Share this post


Link to post
Share on other sites

Ok thanks guys.  I'm going to try what you guys said to do.  I'll test the mission in the morning and I'll let ya'll know if it worked or not.  Seems like it should work.  Anyways, my mission does end after that second objective.  I have a trigger that if Objective 1 and 2 are completed, the mission ends and is accomplished.  I don't know if it works yet though.

(Edited by GhettoP at 7:56 am on Nov. 17, 2001)

Share this post


Link to post
Share on other sites

Not to sound dumb, but your problem was the semi colons in your condition test. You want AND's, not separate tests (they act as an OR... if it actually accepted it without an error of an invalid condition).

Anyways, no need to test the fleeing thing, just do:

("alive _x" count units grp20) + ("alive _x" count units grp21) + ("alive _x" count units grp22) == 0

For your test. When everyone is dead, it triggers and voila. Programming skills rule!

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×