Jump to content
Sign in to follow this  
Ion_Tychi

EndMission Trigger for all alive playable units

Recommended Posts

hey guys,

i would create an endmission trigger for 14 players which are grouped to 4 groups. the trigger should fire if all alive playable units reach the trigger. all should work in MP. anybody an idea? im no pro scripter but im willing to learn. so every idea is welcome.

ion

Share this post


Link to post
Share on other sites

i think it should be this: (cant test atm)

{_x in thisList} count playableUnits == {alive _x} count units playableUnits

for editor testing you need to use switchableUnits (editor)

Edited by SaltatorMortis

Share this post


Link to post
Share on other sites

You can use playableUnits + switchableUnits so it'll be compatible in both SP and MP; also "units" probably slipped there, since it isn't needed with playableUnits being a list of units already. Otherwise it should work.

So you can set the trigger settings to "<player side> present" or "anybody present" and put this into your trigger's "condition" field:

{_x in thisList} count (playableUnits + switchableUnits) == {alive _x} count (playableUnits + switchableUnits)

To maybe help understand what it does:

count counts each element of a list (called array) and returns their number. You can also give it something to check each element for when it cycles through the array, like in this case. Syntax is:

{ what to check for each element of the array, with _x referring to the element currently being cycled (optional) } count

thisList refers to the units currently fulfilling the conditions of the trigger - the ones setup above the condition / on (de)activation fields - "BLUFOR present" for example.

(list is the command if you want to refer to a specific trigger instead of the currently active one.)

So the line SaltatorMortis posted asks: is the number of playable units fulfilling the conditions of this trigger equal to the number of playable units alive?

Edited by Magirot

Share this post


Link to post
Share on other sites

thx for the ansmers. i tryed both codes but the trigger didnt fire.

Share this post


Link to post
Share on other sites
thx for the ansmers. i tryed both codes but the trigger didnt fire.

Did you remember this part:

So you can set the trigger settings to "<player side> present" or "anybody present" and put this into your trigger's "condition" field:

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  

×