Jump to content
Sign in to follow this  
splatsh

Mapclick, setPos on group. How?

Recommended Posts

This is what I have in editor.

On player init field:

group this setGroupId["Alpha"];

And then I have one mapclick thing:

onMapSingleClick "this, P1 setPos _pos; onMapSingleClick """";";

This one is moving the soldier that name is P1 to that mapclick spot.

But how to move the entire group that are linked to the player?

I have tryed

onMapSingleClick "Alpha, Alpha setPos _pos; onMapSingleClick """";";

and

onMapSingleClick "this, Alpha setPos _pos; onMapSingleClick """";";

And that is not working.

So howto do it?

Share this post


Link to post
Share on other sites

Try:

onMapSingleClick "this, {_x setPos _pos; onMapSingleClick """} foreach units group P1";";

As long as P1 is the leader, it should work...

Share this post


Link to post
Share on other sites

Oh, thank you,

I just added one " and all worked good, then I change the P1 to player.

So here is my code now.

onMapSingleClick "this, {_x setPos _pos; onMapSingleClick """"} foreach units group player";";

Thanks for a fast answer, and help.

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  

×