Jump to content
Sign in to follow this  
jolteon00

How to kill certain # of hostiles and end task

Recommended Posts

In a current mission I am Making, there is a task where a small force is to clear out a town of say 20 opfor and independent forces, while also treating wounded civilians in the time between, how would I end this task to move on to the next one? I am completely confused on where to go from here, any advice or scripting ideas would be greatly appreciated. Thank you

Share this post


Link to post
Share on other sites

If you know how many enemies are put down in the town you can create a trigger to cover the town and count how many enemy are left within the trigger area, so that if they are killed or run away they won't be counted. There's nothing worse than checking every building in a town to find that the last man has run away and is hiding outside the town. The following code will trigger when less than 4 enemy remain within the trigger area.

Activation by OPFOR Present

CONDITION

({alive _x && side _x == east} count thisList) < 4; 

Just sync the trigger to a "set task state module" to changed the task's status to succeeded.

Edited by alky_lee

Share this post


Link to post
Share on other sites
If you know how many enemies are put down in the town you can create a trigger to cover the town and count how many enemy are left within the trigger area, so that if they are killed or run away they won't be counted. There's nothing worse than checking every building in a town to find that the last man has run away and is hiding outside the town. The following code will trigger when less than 4 enemy remain within the trigger area.

Activation by OPFOR Present

CONDITION

({alive _x && side _x == east} count thisList) < 4; 

Just sync the trigger to a "set task state module" to changed the task's status to succeeded.

Would I need to do this two times for independant and Opfor factions seperately?

Share this post


Link to post
Share on other sites
Would I need to do this two times for independant and Opfor factions seperately?

Yes, but simply:

(({alive _x && side _x isEqualTo EAST} count thisList) < 4) && {({alive _x && side _x isEqualTo INDEPENDENT} count thisList) < 4};

Edited by JShock

Share this post


Link to post
Share on other sites

((UNITNAME [url="https://community.bistudio.com/wiki/countEnemy"]countEnemy[/url] thislist) <= 5) &&
(({side _x == civilian && damage _x <= 0.25} count thislist) == ({side _x == civilian} count thislist))

Name your player unit and use that in place of UNITNAME. Only 5 or less units in the trigger area can be enemy to specified unit.

All units in trigger area that are civilian must have health greater/equal to 75%.

The trigger activation would be set to 'ANYBODY'.

Edited by MrPineapple

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  

×