Jump to content
Sign in to follow this  
Bon

AI Recruitment

Recommended Posts

Thanks Bon, I was thinking it would be based on the player (unit) class, as for the addaction command I'm reading up on this now.

Share this post


Link to post
Share on other sites

when i go up to the flag and select recruit units this error message come up "Resource RecruitUnitsDialog not found" how do i fix this?

Share this post


Link to post
Share on other sites

i still cant get this to work, lol, i have the description.ext correct, and the inti.sqf, and the folder structure, and still get the "Resource RecruitUnitsDialog not found" error. btw i am using this for domi as the version i am playing does not have recruit able ai

Share this post


Link to post
Share on other sites

Hiya ~ I've just added the Recruit Script to a mission I'm putting together and it is only partially working. I do get a Recruit Dialogue within a Trigger area that I have created around my Units - but it does not execute, the dialogue screen remains blank. I am able to select 'recruit unit', but that's about it - dead key. Anybody have any ideas?

Share this post


Link to post
Share on other sites

i can't seem to get this to work. i've done everything necessary as far as i can tell (made the necessary changes in the mission description & init, adjusted the unit lists, etc) and created a trigger the way fro described on page 2. the "recruit units" option appears when i'm within range of the designated object, but i don't get the unit selection screen when i use it. i don't get any error or anything, using the action just doesn't cause anything to happen. the bon_recruit_units folder is in my mission folder as well of course. can someone help?

Share this post


Link to post
Share on other sites

Check the adjustment of the unit list. If you made an error with , ( ; ] ect you will get no units in the dialogue box.

Share this post


Link to post
Share on other sites

Im running an arma 2 life community and looking for a vehicle lock script and i got this one to work but was questioning is there a way to assign a car to a player and only he or she can unlock that vehcile assigned to him? please help -Tyler

Share this post


Link to post
Share on other sites

(: wrong thread to put your post ): Yes you can do what you want.

Share this post


Link to post
Share on other sites

Hi! i am making a mission where you will need to recruit soldiers in different points of the map to do different tasks! Each point i wanna recruit 1 to 5 soldiers and then dismiss them after each task is completed! So i set up 6 barracks using your script. I wanna limit each barrack to only give you 5 soldiers at a time! how can i do that?

Thanks for the script!

Share this post


Link to post
Share on other sites
Hi mrcash,

Set maximum allowed group size in the bon_recruit_units\init.sqf.

For the access limitation, do the following:

In the bon_recruit_units\init.sqf you put in the line

bon_recruit_limitation = -1;

which is the number of times you can access the menu (-1 for unlimited).

In the file bon_recruit_units\open_dialog.sqf you append the following piece of code:

bon_recruit_limitation = bon_recruit_limitation - 1;
if(bon_recruit_limitation == 0) then{
   (_this select 0) removeAction (_this select 2);
};

That does the trick. But it's only supposed to be used in SP, as one only has to disconnect and connect again to "refill" his account. To make it MP suitable it becomes way more complicated.

hf.

5char

Share this post


Link to post
Share on other sites

Hi, this script is really great, thanks for sharing !!

I have one problem with it thou, I have 2 squad leaders in SP. I use the 1st one to recruit some soldiers, then I switch the player for the 2nd squad leader and all recruits from squad 1 are instantly getting killed. Any way to avoid this?

I want to have few squad leaders (playable) and make them possible to recruit new soldiers for their squads.

Share this post


Link to post
Share on other sites

Hey bon it saying SCRIPT BON_RECRUIT_UNITS\OPEN_DIALOG.SQF NOT FOUND like dubb teee eff plz help me can any 1 help me

Share this post


Link to post
Share on other sites

I'm guessing that file is missing from the bon_recruit_units folder? Check and make sure it's still there. It should work as long as it is, and you didn't edit anything else along the way.

Share this post


Link to post
Share on other sites

Hi there,

How can I make the AI soldiers playable?

Meaning that when my player die, I'll respawn as one of the AI soldiers

Share this post


Link to post
Share on other sites

Hey I've been using this script as part of my Lots of Bombs mission pack and i was thinking of moving up to Arma 3. I've done a straight copy and paste and your script seems to be throwing some UI errors. Is there anyway you will be moving to arma 3?

Share this post


Link to post
Share on other sites

for a new person learning editing, all of these posts in this forum is not really helping much. i downloaded the file and moved it into my mpmissions folder.

it would be easier if you guys said: put this in the init of each player: and so on

but you all just post Code: asd;lfjasdl;kfjsad;fjads

and dont say where to put it.

i tried putting this in the init:

set max. allowed group size in bon_recruit_units\init.sqf;

define recruitment list in bon_recruit_units\recruitable_units.sqf;

put initialization commands for recruited units into bon_recruit_units\init_newunit.sqf;

in case of idc (control id) conflicts, customize bon_recruit_units\dialog\definitions.sqf;

but it was an error, so i took out some things and left it like:

bon_recruit_units\init.sqf; bon_recruit_units\recruitable_units.sqf; bon_recruit_units\init_newunit.sqf; bon_recruit_units\dialog\definitions.sqf;

but there is still an error but different type, it says missing ; now.

so, i want a simple ai that i can walk up to and recruit ai's. what is the most simplest way?

Share this post


Link to post
Share on other sites
Hey Bon!

I was searching for a better way to recruit units than what I already have (add action type) and noticed this. I downloaded the example and to my dismay found out it was made for Arma 2 OA... I am in no way an expert script writer but, I took a look at your scripts and didn't see anything that would keep me from using it in Arma 2 vanilla besides the unit names. I am at work now and will try this out later tonight, but figured I would ask if this is even possible. I have to say I am a fan of your work. I used the weapons preset script of yours and it is awsome! I believe it is alot better than refilling ammo boxes. Keep up the great work!

EDIT:

Ok, I have extracted the bon_recruit_units folder from the downloadable mission and this works very well. Step by step I (for those who may want to know):

1. Extract the bon_recruit_units folder into a preexisting mission folder.

2. Change the types of units in the recruitable_units.sqf to Arma 2 friendly types (from US_Soldier_AA_EP1 to USMC_Soldier).

3. Create any inanimate object like a barracks, as I did and name it, for this example, brk.

4. Create a trigger with the following parameters:

Condition -> player distance brk < 20

On Activation -> recruit = player addAction ["Recruit Units","bon_recruit_units\open_dialog.sqf"];

On Deactivation -> player removeAction recruit;

And that should be it!!!

It took me a minute to find out how the dismissing worked but all you do is look at the soldier you want to dismiss and select Dismiss from the Action Menu (so if anyone wants to know).

My only real problem is that once you get within 20 meters of the barrack I named brk the Action will not go away, even if I go outside of the trigger. removeAction for some reason does not work. Any help with this will be great, it is kind of annoying having the "Recruit Units" action up all the time.

Also, is there a way to create vehicles like hummers and tanks with this? I tried adding "HMMWV" as a unit type in the recruitable_units.sqf file but it only displayed an error message. Thanks for the hard work Bon!!!

LAST EDIT:

I just got the action to go away. I placed this addAction ["Recruit Units","bon_recruit_units\open_dialog.sqf"]; into the Init of a Barracks and it works when you are within about 5 meters and looking at it, then disappears if you look away or move further than 5 meters or so away. Hope this helps!

Still if anyone has an Idea of how to get removeAction to work I would like that more. I find it a hassle to have to look at the barrack in just the right way. I would rather just be near it to call the recruit script.

thanks this helps a lot. it works perfect with this method.

Share this post


Link to post
Share on other sites

so yea i see that this Thread is like super old and basically ancient at this Point but i would really love for someone to post the Example Mission somewhere, with the End of Armaholic and all other Arma2 related Websites, basic Scripts like these are gone and i really would like to use it, surely i could learn to do it myself but im not smart enough to do that. 😄

Share this post


Link to post
Share on other sites
26 minutes ago, RainbowBier said:

so yea i see that this Thread is like super old and basically ancient at this Point but i would really love for someone to post the Example Mission somewhere, with the End of Armaholic and all other Arma2 related Websites, basic Scripts like these are gone and i really would like to use it, surely i could learn to do it myself but im not smart enough to do that. 😄

Not sure if this is anything to do with it, have a look and see.

https://mega.nz/file/aeAhUJaI#S5gWJ_zlVsIUcM9ysOmNmonNISCaOHg1XhJyY5Wp0OY

Share this post


Link to post
Share on other sites

@RainbowBier Welcome to BI forums!

Linked here is the script with readme included

https://drive.google.com/file/d/12NfBkdYM4aNM8HjtCAAogerqvM8SMuTD/view?usp=sharing

 

Here is the installation instructions.

1. create a mission in the editor, just place a player and a flagpole, save the mission as ai recruit test or something.

Then take the files from the zip file and put them into your mission folder.

Heres the instructions from the readme:

 

Installation:

  1. Place the folder bon_recruit_units in your root mission folder.
  2. For the init.sqf, place the following line to initialize the server and client scripts:    [] execVM "bon_recruit_units\init.sqf";
  3. For the "description.ext", place the following lines for the recruitment GUI.     #include "bon_recruit_units\dialog\common.hpp"       #include "bon_recruit_units\dialog\recruitment.hpp"
  4. In an object's initialization field (such as a flag), add:      this addAction["<t color='#ff9900'>Recruit Infantry</t>", "bon_recruit_units\open_dialog.sqf"];

Theres already an init and a description.ext setup with these codes, all you need to do is put the init.sqf and the description.ext in your folder

and then step 4 here put that code in the init box of the flagpole and it will work.

Share this post


Link to post
Share on other sites

@Gunter Severloh Thank you, i know how it works lol i tried to repair a Version someone slaughtered with Dayz but i did not get the Goldbar Requirment gone really so i was unable to recruit Units

 

@WGP  Thank you, its nice to see someone still has them laying around. The loss of Armaholic was a great Setback. 

 

 

  • Like 1

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  

×