Jump to content
avibird 1

Need some help with setting up a trigger condition with an ARRAY of units.

Recommended Posts

I am having some issues with a trigger for multiple units in the condition for the trigger Need some help with setting up an array of units.

 

 trigger activation

                            Type -  none

                            Activation - none

 

trigger expression

                              condition  (Help needed here)

                              on activation - ["task6","succeeded"] call bis_fnc_tasksetstate;

 

I can't get the condition to work with my playable units.

 

I have attempted  multiple times  like this but not working.

 P1 || P2 || P3 || P4  in Bus1;

 P1 && P2 && P3 && P4 in Bus1;

{_x in thisList} count [P1,P2,P3,P4] in Bus1;

_group1 = [P1,P2,P3,P4] in Bus1

 

 

The trigger works with just P1 in BUS1;

The mission has 13 playable units that need to get into the BUS1 for it to succeeded

 

Thanks Avibird

                              

 

 

 

Share this post


Link to post
Share on other sites

A different approach could be counting the seats available in the empty bus as a baseline, subtracting 13, and waiting for the number of available seats to equal the remainder. 

Share this post


Link to post
Share on other sites

hey KC should you be working on that great revive script of yours :don11:  Thanks for the reply but @HazJ help my ass again.

{side _x in [blufor] && _x in BUS1} count playableUnits >= 13
 

  • Like 2

Share this post


Link to post
Share on other sites
2 hours ago, avibird 1 said:

hey KC should you be working on that great revive script of yours :don11:  Thanks for the reply but @HazJ help my ass again.

{side _x in [blufor] && _x in BUS1} count playableUnits >= 13
 

 

P1 || P2 || P3 || P4  in Bus1;//won't work, check the wiki page of "in" for proper syntax
P1 in Bus1 || P2 in Bus1 || P3 in Bus1 || P4 in Bus1;//proper syntax

 P1 && P2 && P3 && P4 in Bus1;//see above

{_x in thisList} count [P1,P2,P3,P4] in Bus1;//activation is set to none, so thisList will stay empty

_group1 = [P1,P2,P3,P4] in Bus1//this is a declaration of a variable, also not proper syntax of "in"

  

If something doesn't work at first, try checking the wiki for proper syntax, if you're using correct datatypes.

 

Cheers

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

@Grumpy Old Man

 

Syntax my ass lol 20% of it may look familiar with a somewhat of a knowledge understanding of what I am looking at the rest is trial and error in the editor. I don't have syntax color notepads ect maybe that would help me understand a little more about syntax in the Bohemia world.  

 

Thanks for the input like usual. Avibird

Share this post


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

@Grumpy Old Man

 

Syntax my ass lol 20% of it may look familiar with a somewhat of a knowledge understanding of what I am looking at the rest is trial and error in the editor. I don't have syntax color notepads ect maybe that would help me understand a little more about syntax in the Bohemia world.  

 

Thanks for the input like usual. Avibird

Don't handicap yourself then, plenty of free software with .sqf syntax highlighting and auto completion. Poseidon even takes you to the wiki when pressing F1 with a command highlighted.

 

Cheers

  • Like 1

Share this post


Link to post
Share on other sites

Also. It seems like you are too used to the editor which isn't a bad thing. There are a lot of tutorials/guides that you can download/watch, etc... The editor is good but with SQF scripts, etc you can do so much more.

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

 The mission has 13 playable units that need to get into the BUS1 for it to succeeded

 

add the 13 units to an array

 

13_units_array = [P1,P2,P3,P4 ect]; // make an array of all the units

 

condition :  13_units_array == crew bus1; // if they all need to be in the bus and only the 13 units

 

 

Share this post


Link to post
Share on other sites

@zonekiller thanks for the reply and feedback but I get it to work with the help of @Hazj with this  {side _x in [blufor] && _x in Bus1} count playableUnits >= 13

 

But I like to learn new ways because we all know in the ARMA world with scripting there are many ways to skin a cat some are easier and cleaner.
I made a new post about  how to setup multiple commands from one trigger here

 if you have  any input on this great.

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

×