Jump to content
avibird 1

Help setting up a end game trigger when all playable/switchable units in a mission are incapacitated!!!

Recommended Posts

I am very frustrated. I don' t know if something has changed with the last few game updates but can't get an end game trigger to work when all playable/switchable units are incapacitated. 

I have 13 playable/switchable units in a mission. I use a modified revive system that the units will only go incapacitated.

Is there a way to setup an end game trigger that will end the game if all playable/switchable units go incapacitated at the same time.

Share this post


Link to post
Share on other sites

Something like this maybe?


_failCondition = count (allPlayers select {lifestate _x isEqualTo "INCAPACITATED" OR !alive _x}) isEqualTo count allPlayers;

if (_failCondition) then {"EveryOneLost" call BIS_fnc_endMissionServer};

Ends mission for everyone if all players are either dead or incapacitated.

 

Cheers

  • Like 1

Share this post


Link to post
Share on other sites

@Grumpy Old Man

your code lines only works if I put it into a gamelogic but the mission ends at the start of the mission lol.

_failCondition = count (allPlayers select {lifestate _x isEqualTo "INCAPACITATED" OR !alive _x}) isEqualTo count allPlayers;
 if (_failCondition) then {"EveryOneLost" call BIS_fnc_endMissionServer};

 

When I put your code in a trigger condition nothing works.

 

This is how it worked before. I use  =BTC= Quick Revive  (modified by me so units will never die only stay incapacitated.)

{!(_x getVariable ["btc_qr_unc", false])} count (playableUnits + switchableUnits) == 10;   It was used in a mission with 60 playable units and  worked fine however now when I reduced the number to ==0 nothing works if I keep the ==10 the it works when there are a few units still up but I needed it to work with no units left all are  incapacitated. I have played with your code no luck and I have played with the numbers in mine and only ==10 works but not when all the units are  incapacitated.

 

I don't understand why your code or mine will not work the way it should.

 

Share this post


Link to post
Share on other sites

@Grumpy Old Man may code does work I had a playable unit on the map very very from the AO lol it was making me nuts ? however I would still like to get you code to work as well. Always like to have a different way of doing things especially if I use a different type of revive system in a mission. Thanks for all the assistance. Really appreciate it scripting does not come easy to me but I do know how to lay out a mission design but sometimes I have no idea how to implement what I want to do with Arma scripting.

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

×