Jump to content
Spriterfight

HELP With surrender script

Recommended Posts

I have been making a surrender script but i am stuck with this part

_groups = allgroups select { count (units _x) < 3 ;};
_groupsselect = _groups select 0;//this is the part where i am stuck because i can select only one gorup,how can i sleect all groups form my array?

{
if (side _groupsselect == east) then
{

{
  _x setCaptive true;
  _x action ["Surrender", _x];

} forEach units _groupsselect;

};

} forEach allGroups;

So i want that every group surrender if their unit count drops below 3 but i cant get the allgroup working correctly and i dont understand it.How can i loop the allgroup array to make the units surrender?

Share this post


Link to post
Share on other sites

maybe you mean this:

_groups = allgroups select { count (units _x) < 3 };

{
_groupsselect = _x;
                                                 
if (side _groupsselect == east) then
{

{
  _x setCaptive true;
  _x action ["Surrender", _x];

} forEach units _groupsselect;

};

} forEach _groups;

 

  • Thanks 1

Share this post


Link to post
Share on other sites
20 minutes ago, gc8 said:

maybe you mean this:


_groups = allgroups select { count (units _x) < 3 };

{
_groupsselect = _x;
                                                 
if (side _groupsselect == east) then
{

{
  _x setCaptive true;
  _x action ["Surrender", _x];

} forEach units _groupsselect;

};

} forEach _groups;

 

Thank you very much!

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

×