Jump to content
Sign in to follow this  
muttly

A.I recruiting help

Recommended Posts

Hi all

Iam trying to spawn A.I soldiers in my mission so far this is what ive done i made a script called hire.sqs

#start

"USMC_Soldier_Medic" createUnit [getmarkerpos "hire", group player]

"USMC_Soldier_HAT" createUnit [getmarkerpos "hire", group player]

"USMC_Soldier_AT" createUnit [getmarkerpos "hire", group player]

"USMC_Soldier_MG" createUnit [getmarkerpos "hire", group player]

"USMC_SoldierS_SniperH" createUnit [getmarkerpos "hire", group player]

"USMC_Soldier_GL" createUnit [getmarkerpos "hire", group player]

"USMC_SoldierS_Spotter" createUnit [getmarkerpos "hire", group player]

"USMC_Soldier_AA" createUnit [getmarkerpos "hire", group player]

"USMC_SoldierM_Marksman" createUnit [getmarkerpos "hire", group player]

"USMC_Soldier_AR" createUnit [getmarkerpos "hire", group player]

"FR_Sapper" createUnit [getmarkerpos "hire", group player]

exit

Ive then added a barracks and in the init box ive typed :

hiresoldier = playername addaction ["Hire Soldiers", "hire.sqs"]

Then ive placed a marker covering the barracks and called it hire but its not working:( ive also tried putting a trigger on the barracks and typed hiresoldier = playername addaction ["Hire Soldiers", "hire.sqs"] in condition box but did nt work either can any one help me please.

Share this post


Link to post
Share on other sites

ahh:) thanks for the quick replie mate ill give it a shot now

---------- Post added at 11:04 PM ---------- Previous post was at 10:44 PM ----------

Hi charon it worked mate thanks:) not how i expected thow just couple of problems when i walk up to the barracks my drop down menu fills up with "hire soldiers" when i click it all 11 ai soliders spawn at same time and then when i walk away from the barracks my drop down menu only consists of "hire soldiers" i can t select my weapons or any thing any ideas:confused:

what id like it to happen is iam able to select the ai soldiers i want like in xeno s domination version thanks for the help:)

Share this post


Link to post
Share on other sites

Ok ive run into another problem now:( ive settled for this script until god xeno or some 1 else comes along but when i try play my mission on lan i get this error message

script CA\modual\function\arrays\fn_arraypush.sqf not found

And i lost the abilty to hire my soldiers i tried goin back into the editer and adding a function module to my barracks and my self and re pdo ed it but did nt work any suggestions guys:rolleyes:

lol spent half day trying get things working:butbut:

Edited by muttly

Share this post


Link to post
Share on other sites

To use functions like arraypush you need to have the Functions Module on your map somewhere.

Share this post


Link to post
Share on other sites

Ill add that function module then aswell sorry for bein such a noob people this my first mission:) put arma2 on the shelf i was done with it but after doin alot reading and watching you tube tutorials ive really starting getting into the editer this games awesome i just need bit of help:yay:

Think the error iam getting has some thing to do with the backpack script

Edited by muttly

Share this post


Link to post
Share on other sites

This is doin my head in i cant seem to get the hire soldiers script to work in Lan spent about 30 min copy pasteing code from you all and 5 hours trying get it all to work :D

Share this post


Link to post
Share on other sites

Guys how do i place units ontop of buildings trying put snipers on roofs but when go in the editer there always on the floor infront of the building.

ta

Share this post


Link to post
Share on other sites

Play around with setPos muttly. In their init field:

this setPos [getPos this select 0, getPos this select 1, 10];

Adjust the "10" above to find the proper height you need.

Share this post


Link to post
Share on other sites

thanks:)

edit: Hey kylania how do i go about making "evidence" objects useable so i can maybe use them as part of an objective and also whats the best way to set up a hostage rescue

Edited by muttly

Share this post


Link to post
Share on other sites

I have a 'collect evidence' example on my website. Just follow the link.

Hostage rescue is pretty easily done by using the following script called via addAction on the hostage:

   _hostage = _this select 0;
   _rescuer = _this select 1;
   _id = _this select 2;

   _hostage playMove "Stand";
   _hostage setCaptive true;
   [_hostage] joinSilent group _rescuer;
   _hostage commandFollow _rescuer;

   _hostage removeAction _id;

Share this post


Link to post
Share on other sites

Hey thanks alot kylania nice 1:)

Ok cheers so i make the ***sqf.file for the hostage but what do i add in the init boxs of the rescuer/hostage sorry still learning stuff

Edited by muttly

Share this post


Link to post
Share on other sites

Save that as rescue.sqf and put the following in your hostage's init field:

this addAction ["Rescue", "rescue.sqf", 0, 0, true, true, "", "(!(captive _target) && (alive _target) && (alive _this))"];

Share this post


Link to post
Share on other sites
:yay: Excellant thanks for all your help mate found few usefull things on your site aswell:) cheers

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  

×