Jump to content
Sign in to follow this  
janchezs

End scenario when only 30% of enemy left in trigger.

Recommended Posts

So Im making a big compaign and Iam already working on 3rd mission. So the question is how to make scenario end when only 30% BLUFOR is alive in trigger. 
Basicly the scenario is: sit in tank. Drive in trigger, after the player is in trigger 2 infantry squads enter the trigger after player. So how do I make *title*
 

?XMDB7bQ.png

Share this post


Link to post
Share on other sites

@janchezs, try this condition (assuming the units are already inside the trigger):

_unitsCount = count thisList;

_unitsCountMin = thisTrigger getVariable ["unitsCountMin", -1];

if (_unitsCountMin < 0) then {
    _unitsCountMin = ceil (0.3 * _unitsCount);

    thisTrigger setVariable ["unitsCountMin", _unitsCountMin];
};

_unitsCount <= _unitsCountMin

 

Share this post


Link to post
Share on other sites
21 minutes ago, Schatten said:

@janchezs, try this condition (assuming the units are already inside the trigger):


_unitsCount = count thisList;

_unitsCountMin = thisTrigger getVariable ["unitsCountMin", -1];

if (_unitsCountMin < 0) then {
    _unitsCountMin = ceil (0.3 * _unitsCount);

    thisTrigger setVariable ["unitsCountMin", _unitsCountMin];
};

_unitsCount <= _unitsCountMin

 

Hm. So I just use this code as trigger condition and set trigger to END1? I also think that the code is counting all the units, but I actually need to only count blufor, cuz they are defending and player is on the opfor site

Share this post


Link to post
Share on other sites

Ive also tried "Siezed by opfor" in trigger settings, but I doesnt work the way I want because opfor has 2 BMP and 1 tank. Also around 60 people. And blufor has 3 bmp and like 50 people. So when all my units launch an assult I get instant win xd

Share this post


Link to post
Share on other sites
2 minutes ago, janchezs said:

So I just use this code as trigger condition and set trigger to END1?

Correct.

 

3 minutes ago, janchezs said:

I also think that the code is counting all the units, but I actually need to only count blufor

Set that the trigger is activated by BLUFOR.

Share this post


Link to post
Share on other sites
1 minute ago, Schatten said:

Correct.

 

Set that the trigger is activated by BLUFOR.

thx. will try rn

Share this post


Link to post
Share on other sites
51 minutes ago, Schatten said:

@janchezs, try this condition (assuming the units are already inside the trigger):


_unitsCount = count thisList;

_unitsCountMin = thisTrigger getVariable ["unitsCountMin", -1];

if (_unitsCountMin < 0) then {
    _unitsCountMin = ceil (0.3 * _unitsCount);

    thisTrigger setVariable ["unitsCountMin", _unitsCountMin];
};

_unitsCount <= _unitsCountMin

 

Oh thank u so much. It works!

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  

×