Jump to content
Sign in to follow this  
donkassim

need a script for high command squads and AI recruitment

Recommended Posts

Hello all

Is there any way I can add an option for the player to recruit a high command squad and also recruit AI players as part of the players team ?

Thanks

Share this post


Link to post
Share on other sites

For recruitment:

_unit addAction
[
"Recruit My Team!",
{
  {
     _x joinSilent group (_this select 1);
     _x removeAction (_this select 2);
  } forEach units group (_this select 0);
},
[],
5,
true,
true,
"",
"_this distance _target < 5"
];

Share this post


Link to post
Share on other sites

In whatever units init fields you would want to be recruited (replace "_unit" with "this"), or if your spawning in those units via script then just apply this action in that script along with the unit creation.

Share this post


Link to post
Share on other sites

And will I get a menu seclection to recruit ai or ?

Will add this code to the player unit that am playing as

Share this post


Link to post
Share on other sites

Well, no, it just adds a scroll menu action to spawned units that you can walk up to and execute the action to "recruit" them.

Share this post


Link to post
Share on other sites

I've been fiddling with this and not getting it to work. I get the action "Recruit my team!" but no recruitment is happening :(

Using the code in the init field.

Edit: Oh, it works if I have no squads in High Command, but if I already do, it does not work.

Edited by EasyEB

Share this post


Link to post
Share on other sites
[_x] joinSilent group (_this select 1);

!

Dammit, I do it every time, thanks Das!

Share this post


Link to post
Share on other sites

It should really accept an object or an array of objects, like lots of other commands out there, but I digress.

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  

×