Jump to content
Sign in to follow this  
R3dBuLL

How to check if enemy groups are less then 30%?

Recommended Posts

Hi,

I wanna make a mission where u defend a postion and enemy is attacking u and tries to overrun u. The mission will be over if only 30 % of their mans/vehicles are left. How to do that? Is that possible with a simple trigger? And how can I check if a whole group is still alive?

Share this post


Link to post
Share on other sites

Hi,

try to place a trigger which area covers the whole map, and give it a name, lets say the name Enemies.

It must activate on PRESENT OPFOR (respectively the enemy side), REPEATED.

Thats it. Now when this Trigger is active, i.e. there are ALIVE enemy troops in its area, then you can access all alive enemy units with the array "list Enemies".

Using the command "count" then you can count the enemies in this array.

if((count list Enemies)<value) then{end the game...}

Accessing all units of a group its almost the same, the array then is called "units group <Groupname>", where Groupname is typically the name you assigned to the particular groupleader.

EDIT: BTW all that stuff you can find more or less in Mr-Murrays Editing Guide. Its always a good idea to check that first.

Share this post


Link to post
Share on other sites

The command "units group" and that thing with counting is what I was looking for ^^

I know mr murrays editing guide and I try to find the answer there first before searching in the internet.

Anyway thanks a lot!

Edited by R3dBuLL

Share this post


Link to post
Share on other sites

if((count list Enemies)<value) then{end the game...}

I paste your code into on act. but it does not work.

Share this post


Link to post
Share on other sites

I suggest you to use a countside with some math commands in the trigger condition.

Exemple (this only works if units are already inside the trigger, just replace east by the side that you want):

Activation:
((((east countSide thislist)/100)*30) <= 30)

Couldn't test it yet as i don't have arma around but it shall works.

Edited by Benny.

Share this post


Link to post
Share on other sites

Exemple (this only works if units are already inside the trigger, just replace east by the side that you want):

Activation:
((((east countSide _thislist)/100)*30) <= 30)

I try this code does not work, local variable in global space?

Share this post


Link to post
Share on other sites

Sorry my bad, try with thislist instead of _thislist

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  

×