Jump to content
Sign in to follow this  
Touhou

AI groups to cargo

Recommended Posts

Hi ! 

 

I'd like to move all my team mates to a cargo, but when I use this command, I also move in cargo, but I don't want my player in cargo, only team mates.

 

{_x moveincargo Vehicle;} forEach units group player;

 

Someone have the answer ? Thanks

Share this post


Link to post
Share on other sites
42 minutes ago, Touhou said:

Hi ! 

 

I'd like to move all my team mates to a cargo, but when I use this command, I also move in cargo, but I don't want my player in cargo, only team mates.

 

{_x moveincargo Vehicle;} forEach units group player;

 

Someone have the answer ? Thanks

 

vehicle is a reserved variable. Your example shouldn't work at all.

 

Best get used to your own naming convention using a tag, underscore, descriptor, underscore then the purpose, like in my case GOM_fnc_moveGroupInVehicle would describe a function made by me and stating the functionality in a readable way.

In your case the same function could be called TOU_fnc_moveGroupInVehicle.

For objects like the vehicle in your case this could be TOU_obj_transport1.

 

This way stuff stays as unique as possible without the chance of using already reserved or special variables and increases compatibility with other 3rd party scripts.

 

To your example, you can remove the player from the units array like this:

{_x moveincargo TOU_obj_transport1;} forEach (units group player) - [player];

//also works
{_x moveincargo TOU_obj_transport1;} forEach (units group player select {!isPlayer _x});

 

Cheers

  • Thanks 2

Share this post


Link to post
Share on other sites

Yeah, I wrote "Vehicle" for an exemple, I called my vehicle "C130J_tsp".

Thanks for your reply and your help, I try this later !

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  

×