Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
farix

2 Sided AI Recruitment

Recommended Posts

Hey Guys. Another question from me , and hopfuly its the last until i finish.

So Far the mission i am making is 90% completed. the last straw i was going to add was AI Recruitment. I Was wondering if theirs a script that supports multiplayer PVP (2 Sides). I've played around w/ This : http://www.armaholic.com/page.php?id=12113

but i have very little knowlage of coding and i can't seem to get the If/Then statements to work

bon_recruit_recruitableunits = [{

if (side player==west) then {

"I44_Man_A_Army_Ranger_M1Garand",

"I44_Man_A_Army_Ranger_M1Garand_M7",

"I44_Man_A_Army_Ranger_M1Carbine",

"I44_Man_A_Army_Ranger_M1903A3_M1",

"I44_Man_A_Army_Ranger_M3Greasegun",

"I44_Man_A_Army_Ranger_M1A1Thompson",

"I44_Man_A_Army_Ranger_M1918A2",

"I44_Man_A_Army_Ranger_Engr_M37DemoKit",

"I44_Man_A_Army_Ranger_Engr_M2DemoCharges",

"I44_Man_A_Army_Ranger_Engr_M1Mine",

"I44_Man_A_Army_Ranger_Engr_M1A1Bangalore",

"I44_Man_A_Army_Ranger_M1903A3",

"I44_Man_A_Army_Ranger_Sniper_M1903A4",

"I44_Man_A_Army_Ranger_Medic",

"I44_Man_A_Army_Ranger_M1919A4",

"I44_Man_A_Army_Ranger_M1A1Bazooka",

"I44_Man_A_Army_Ranger_CO_M1911A1",

"I44_Man_A_Army_Ranger_CO_M1Carbine",

"I44_Man_A_Army_Ranger_GunCrew_NCO_M1911A1",

"I44_Man_A_Army_Ranger_GunCrew_M1Carbine",

"I44_Man_A_AAF_Pilot_M1911A1",

"I44_Man_A_Army_Ranger_NCO_M1Carbine",

"I44_Man_A_Army_Ranger_NCO_M1Garand",

"I44_Man_A_Army_Ranger_NCO_M1A1Thompson";}

if (side player==east) then = {

"I44_Man_G_WH_Camo_K98kZf41",

"I44_Man_G_WH_Camo_MG42",

"I44_Man_G_WH_GunCrew_K98k",

}];

So what i'm looking for is a eithar a fix for my script up their , or a entire new system of recruting AI , i'd prefer a entire new system hopfully its just out their and i can't find it =P

Thanks again

-Farix

Share this post


Link to post
Share on other sites

bon_recruit_recruitableunits=if (side player==west) then {
  [
     "I44_Man_A_Army_Ranger_M1Garand",
     "I44_Man_A_Army_Ranger_M1Garand_M7",
     etc.
  ];
} else {
  [
     "I44_Man_G_WH_Camo_K98kZf41",
     etc.
  ];
};

Remember, no comma after the last item in an array. Also, use the -showScriptErrors parameter in your shortcut.

Share this post


Link to post
Share on other sites

Dam. That Script would work perfectly if the AI Recruitment thing actually supported it >.>

Thanks for fixing it celery

I need an entire script entirely sadly -_-

Share this post


Link to post
Share on other sites

doesn't it work as Celery suggested?

Another solution that may not be as elegant to the previous one (since we have duplicate code here), however, it does the same:

switch side player {
   case west : {
       bon_recruit_recruitableunits = [
           ...
       ];
   };
   case east : {
       bon_recruit_recruitableunits = [
           ...
       ];
   };
   default {bon_recruit_recruitableunits = []};
};

You can replace the check for the player side by a check for a class type, or what not...

You see, it doesn't matter how to create the recruitableunits list, as long as there is the list when the script finishes. :)

The list gets recreated every time you open the recruit dialog, so the condition result and therefore the list can vary dynamically and is NOT set only once at initialization.

Edited by Bon

Share this post


Link to post
Share on other sites

Thanks for the quick responses guys. I read up on my scripting and ended up making several entirely custom scripts/actions that are attatched to objects that certain sides have access to. I will post the stuff here later

Share this post


Link to post
Share on other sites
Thanks for the quick responses guys. I read up on my scripting and ended up making several entirely custom scripts/actions that are attatched to objects that certain sides have access to. I will post the stuff here later

From the code that Celery posted where do I put that to include them. Which file, init, mission, description? I'm new to scripting.

Share this post


Link to post
Share on other sites
Sign in to follow this  

×