Jump to content

Recommended Posts

I have recently encountered some odd behavior in one of my scripts. I thought I had a pretty good grasp of this command but it has stopped behaving in the usual way.

consider the following:

{_x setUnitPos "UP"}forEach units group squad1;

In the past and indeed up until a few minutes ago in my script, this yielded the expected behaviour of each member of squad 1 standing up. Then I got a typerror . Type group, expected object. So then I removed the word group from the command:

{_x setUnitPos"UP"}forEach units squad1;

And NOW it works again. Does anyone know what is going on with this? Thanks for the help.

Share this post


Link to post
Share on other sites

Your group is already defined as squad1. If that was not the case then your refer to the group as "group player" or "group (driver _veh)", e.g.:

{_x setUnitPos "UP"} forEach units group player;
{_x setUnitPos "UP"} forEach units squad1;

 

  • Like 2

Share this post


Link to post
Share on other sites

@whiztler Thanks very much, that actually makes a lot of sense. It never occurred to me before.  Thanks for the clarification, I'll watch out for this in the future.

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

×