Jump to content
aviatormoser

Bon's Infantry Recruitment Redux

Recommended Posts

Anyone try this on A3 Wasteland yet? I have the built in Anti-Hack banning for using this.

Share this post


Link to post
Share on other sites

I got this working on Wasteland finally.....If anyone is interested look for Dawg's AI Warzone

Share this post


Link to post
Share on other sites

ok. this script is broken.

21:39:40 Error in expression <itlist.sqf"

disableSerialization;

if (bon_dynamic_list) then {
_scripthandler >
21:39:40   Error position: <bon_dynamic_list) then {
_scripthandler >
21:39:40   Error Undefined variable in expression: bon_dynamic_list
21:39:40 File mpmissions\__CUR_MP.tavi\bon_recruit_units\build_unitlist.sqf, line 7
21:40:06 Error in expression <
if((count (units group player) + count bon_recruit_queue) >= bon_max_units_allo>
21:40:06   Error position: <bon_recruit_queue) >= bon_max_units_allo>
21:40:06   Error Undefined variable in expression: bon_recruit_queue
21:40:06 File mpmissions\__CUR_MP.tavi\bon_recruit_units\recruit.sqf, line 4
21:40:06 Error in expression <

I am trying to use this on DS with ALiVE and dynamic = true. the above are the errors.

Share this post


Link to post
Share on other sites

I am a huge fan of this script and it works flawlessly. However, I do have a question. I want the recruit list to be inclusive of just 5-6 unique soldiers whom I gear up with virtual arsenal loadouts.

 

Lets say I got 3 normal riflemen put down in the editor, I put 3 different virtual arsenal loadouts in their "init" respectively and I name them p1, p2, p3. How can I hide them from mission start and only make them recruitable "n" amount of times?

 

Thank you.

Share this post


Link to post
Share on other sites

Does anyone know how to change the elevation that the recruited units spawn at? I'm trying to use this on the Nimitz but they just spawn in the water below the ship.

Share this post


Link to post
Share on other sites

ok. this script is broken.

21:39:40 Error in expression <itlist.sqf"

disableSerialization;

if (bon_dynamic_list) then {
_scripthandler >
21:39:40   Error position: <bon_dynamic_list) then {
_scripthandler >
21:39:40   Error Undefined variable in expression: bon_dynamic_list
21:39:40 File mpmissions\__CUR_MP.tavi\bon_recruit_units\build_unitlist.sqf, line 7
21:40:06 Error in expression <
if((count (units group player) + count bon_recruit_queue) >= bon_max_units_allo>
21:40:06   Error position: <bon_recruit_queue) >= bon_max_units_allo>
21:40:06   Error Undefined variable in expression: bon_recruit_queue
21:40:06 File mpmissions\__CUR_MP.tavi\bon_recruit_units\recruit.sqf, line 4
21:40:06 Error in expression <

I am trying to use this on DS with ALiVE and dynamic = true. the above are the errors.

 

 

I've used it countless times with Alive and dynamic list generations. I'm not sure why it gives you an undefined error. Have you tried the example demo without errors?

 

Is there a way to change what type of gear and weapons AI recruiters comes with? 

 

 

Not without major edits to the code, and that's kinda of outside the scope of the script.

 

I am a huge fan of this script and it works flawlessly. However, I do have a question. I want the recruit list to be inclusive of just 5-6 unique soldiers whom I gear up with virtual arsenal loadouts.

 

Lets say I got 3 normal riflemen put down in the editor, I put 3 different virtual arsenal loadouts in their "init" respectively and I name them p1, p2, p3. How can I hide them from mission start and only make them recruitable "n" amount of times?

 

Thank you.

 

Like the above, this feature is kinda of outside the scope of the project. It would probably easier to write a new script that does this.

 

 

Does anyone know how to change the elevation that the recruited units spawn at? I'm trying to use this on the Nimitz but they just spawn in the water below the ship.

 

 

You'll have to edit the spawn mechanic in recruit.sqf.

_unit = group player createUnit [_unittype, [(getPos bon_recruit_barracks select 0) + 10 - random 20,(getPos bon_recruit_barracks select 1) + 10 - random 20,0], [], 0, "FORM"];

The last coordinate position in [(getPos bon_recruit_barracks select 0) + 10 - random 20,(getPos bon_recruit_barracks select 1) + 10 - random 20,0] must be changed from 0 to the height of the deck on the Nimitz. As it stands, the height is set to the surface at which the object you set the recruit action to.

Share this post


Link to post
Share on other sites

Would it be possible to make it so someone can recruit only 1 type of unit from the list?

 

Say I want to recruit a Grenadier. I choose the Grenadier, it spawns to my group and then either it gets removed from the list or a message pops up saying that no more are available. And then, ideally once the Grenadier dies they would be available again to recruit.

 

I've been trying to figure out a way to make this happen but I'm still pretty novice when it comes to scripting and haven't had much luck.

  • Like 1

Share this post


Link to post
Share on other sites

Hi,
im using Bon's redux a lot in sp and coop mission, with generally a declared barracks and the dialog pipe on a radio trigger.
All work like a charm! But,

is there a way for making a different delivery barracks for each side that calling the recruitDialog?

EDIT : SOLVED by adding this lines to the opendialogue.sqf :

if (side player == west) then {bon_recruit_barracks = barracks};
if (side player == east) then {bon_recruit_barracks = barracks_east};
if (side player == resistance) then {bon_recruit_barracks = barracks_indep};
createDialog "RecruitUnitsDialog";)

Share this post


Link to post
Share on other sites

Not sure if you can help me

 

- I create 4 units, the units joins my group.

 

- I added the switchable unit command to the new unit init

 

when i switch to a unit, if i die, i get to team switch

 

when i team switch back to the leader, all the soldiers around me are dead, as if when the unit dies when controlled by the player, all created units also die. any fixes?

Share this post


Link to post
Share on other sites

I play only with the switchable unit modification in my Bons, and i haven't this trouble.
If i die in a recruitable unit, i can respawn with, and switch back to my original player, without trouble. Same if i die in the body of my original unit.
(in the preview of editor too)

The Bons inf use a script ( i doesn't know how ) for clean (kill) recuited unit of a player after his disconnection. Maybe have you an issue with that...
What type of revive is used in your mission?
I use the BTC quick revive, for prevent death of player, with the respawn ai function activated.

EDIT : The AI should die too, if they leave the player group.

Share this post


Link to post
Share on other sites

i have placed the switchable unit line here 

_unit = _this select 0;

/*****************************************************************
	following section to run only on server.
	Note: duplicate respective code in the pve in the init.sqf
******************************************************************/
if(isServer) then{
	[_unit] execFSM (BON_RECRUIT_PATH+"unit_lifecycle.fsm");
} else {
	bon_recruit_newunit = _unit;
	publicVariable "bon_recruit_newunit";
	
};


/*****************************************************************
	Client Stuff
******************************************************************/
_unit addAction ["<t color='#949494'>Dismiss</t>",BON_RECRUIT_PATH+"dismiss.sqf",[],-10,false,true,""];
addSwitchableUnit _unit;

is this the correct place for it?

Share this post


Link to post
Share on other sites

Yes, same for me, but i was wrong before, for have the revive on my recruit, i have add another thing for the BTCqRevive :

 

 

_unit = _this select 0;

/*****************************************************************
    following section to run only on server.
    Note: duplicate respective code in the pve in the init.sqf
******************************************************************/
if(isServer) then{
    [_unit] execFSM (BON_RECRUIT_PATH+"unit_lifecycle.fsm");
} else {
    bon_recruit_newunit = _unit;
    publicVariable "bon_recruit_newunit";
};




/*****************************************************************
    Client Stuff
******************************************************************/
_unit addAction ["<t color='#949494'>Dismiss</t>",BON_RECRUIT_PATH+"dismiss.sqf",[],-10,false,true,""];

addSwitchableUnit _unit;

_unit call btc_qr_fnc_unit_init;
    [[_unit, ["<t color='#F00000'>Revive</t>","[_this select 0,_this select 1] spawn btc_qr_fnc_help",[],100,false,true,"","damage _target == 0.99 && _target distance _this < 2.5"]],"AOW_fnc_addAction",true,true] spawn BIS_fnc_MP;this addaction["<t color='#F00000'>Revive</t>","[_this select 0,_this select 1] spawn btc_qr_fnc_help",[],100,false,true,"damage _target == 0.99 && _target distance _this < 2.5"]],"",true,true] spawn BIS_fnc_MP;
};
 

 

EDIT : I've begin this some times ago and doesn't remember all exactly, but it seems i've thief that in the All Out Warfare mission... If someone is interested, i can try to clarify the situation...

Share this post


Link to post
Share on other sites

How can i stop the ai from dying after I die? I'm working on a tvt mission and it looks funny if the whole squad dies after the team leader is killed. 

Share this post


Link to post
Share on other sites

I'm trying to install this to my Arma 3 Epoch server, but I can't get it to work.

 

I'm trying to add it using a script. An sqf file.

 

Script:

/*
	File: somecontent1.sqf
	Author: 
	Contact: 
	
	Description: Custom Buildings
*/

diag_log format['Custom %1 - Starting recruitflag.sqf',time];


_pos = [13575.9,12212.8,0];
_object = createVehicle ["Flag_BI_F", _pos, [], 0, "CAN_COLLIDE"];
_object setDir 280.171;
_object setPosATL _pos;
this addAction["<t color='#ff9900'>Recruit Infantry</t>", "bon_recruit_units\open_dialog.sqf"];




//_pos = [625.205566,1820.953369,0.510662];
//_object = createVehicle ["Land_Wreck_CarDismantled_F", _pos, [], 0, "CAN_COLLIDE"];
//_object setDir 300.002;
//_object setPosATL _pos;



//etc, etc

The Flag is where I want it but there is no addaction. No option to recruit units.

 

I have no idea what I'm doing. I've installed this on A2 Epoch in mission.sqm and it was very easy, but I have no idea how to make it work for an sqf file...

 

 

Share this post


Link to post
Share on other sites

@pazuzu In the init of the flag/object you want them to look at so they get the new "add action".. .do this.. (I think)

this addAction["Infantry Recruitment","recruitflag.sqf"];

This should/may allow you to look at the flag use the scroll wheel and have "Infantry Recruitment" as a new action. Once selected it would activate the recruitflag.sqf.

Share this post


Link to post
Share on other sites

@pazuzu In the init of the flag/object you want them to look at so they get the new "add action".. .do this.. (I think)

this addAction["Infantry Recruitment","recruitflag.sqf"];

This should/may allow you to look at the flag use the scroll wheel and have "Infantry Recruitment" as a new action. Once selected it would activate the recruitflag.sqf.

 

This is for a server and I'm not using the editor to spawn Flag because Epoch doesn't use mission.sqm for spawning map objects, so I'm trying to use a script I found on the Epoch forums.

 

I tried just adding that addaction line to the script but it doesn't show up in game.

 

I've also read that it would be local anyways so I need to use the BIS_fnc_MP command. Beyond that I have no clue how to adapt that addaction to my script...

 

Thanks for the reply.

 

Share this post


Link to post
Share on other sites

This is for a server and I'm not using the editor to spawn Flag because Epoch doesn't use mission.sqm for spawning map objects, so I'm trying to use a script I found on the Epoch forums.

 

I tried just adding that addaction line to the script but it doesn't show up in game.

 

I've also read that it would be local anyways so I need to use the BIS_fnc_MP command. Beyond that I have no clue how to adapt that addaction to my script...

 

Thanks for the reply.

 

No problem. Sorry I couldn't be of help. Good luck! I will be watching for a solution as well. Would be noteworthy to learn. 

Share this post


Link to post
Share on other sites

Hello awesome work! Congrats!

Is there a way to recluit units and leave them there in their own group? 

Im working on a persistence war theather and, i want my unit to take a position, then with a mobile recluit vehicle, spawn a group, and that group to hold the position, until the IA tries to take it back..

THank you very much.

Share this post


Link to post
Share on other sites

script works great, just have a small issue, I have playable as blufor Gendarme, so the selectable pool is only the 2 units, so if I switch the script to use static, and then add some other blufor units, and then select those in the game. If they are not also Gendarme  then they fire on each other even though they are all part of the same main faction.

 

anyway to stop this?

 

and if 2 factions have playable units: like blufor and independant, how can I have a static list for both factions, but only for their own?

 

I dont want blufor players to select independant units and vise versa

 

thanks

Share this post


Link to post
Share on other sites

Hi, love the script, the AI aren't showing up for other players on my server, know what I might have done wrong?

Share this post


Link to post
Share on other sites

Since last Arma update this script only recruits one soldier then keeps adding to que but no more spawn. Anyone else having this issue?

Share this post


Link to post
Share on other sites

Ive found in part my problem. Since last Arma update the script doesnt realise that the unit has been created.

 

Tried recruiting just one and after unit was recruited went back into recruit menu and found it still states 1 unit qued. Anyone got any ideas

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

×