Jump to content
Sign in to follow this  
thelegendarykhan

AI team mates auto re-arm? :'(

Recommended Posts

I am sure a lot of us want it. But I havent really been following forums lately due to job. I find it tiresome to have AI mates in Arma 3 now. Some revive mods have made it simple for your ai mates to revive you and others. But major payne still remains. HOw to have them re arm automatically, or atleast smartly.

I mean even if I order an out of ammo guy through "6" to Rearm at..., or Pick up MX, or all that there is, that retard just seem to run to the farthest dropped weapon or dead body to rearm. Sometimes I think he deliberately does it. Agh.

And to forget for heavens sake that in war you have to save your bumm and dont be stubborn to have to stick to your class weapons. I make them re-arm at a body or i take the pains to pick up a gun and transfer it in their backpacks. But a lot of times they dont equip that weapon and continue using their pistols.

Another classic example is when snipers run out of ammo, they act like one man army with their pistols and it pests me enough to delete them.

I am not a scripting wizard, but I believe it should be fairly easy to have a mod or addon which scans lets say 100m area for dropped weapons and bodies to rearm AI. And when the player orders them, only those options show under "6"? Also all classes, even snipers should use rifles and shotguns or whatever, in an unbiased way when they dont have any more ammo.

Regards :'(

Edited by TheLegendaryKhan

Share this post


Link to post
Share on other sites

My solution for this has been implementing an AI Remote Control script, which allows players to have direct control of the AI for 60 seconds. Time enough to rearm in non stress situations. Also benefits other situations like convoy ambush and AI AT, stuck AI etc..

Check my signature.

Share this post


Link to post
Share on other sites
I am sure a lot of us want it. But I havent really been following forums lately due to job. I find it tiresome to have AI mates in Arma 3 now. Some revive mods have made it simple for your ai mates to revive you and others. But major payne still remains. HOw to have them re arm automatically, or atleast smartly.

I mean even if I order an out of ammo guy through "6" to Rearm at..., or Pick up MX, or all that there is, that retard just seem to run to the farthest dropped weapon or dead body to rearm. Sometimes I think he deliberately does it. Agh.

And to forget for heavens sake that in war you have to save your bumm and dont be stubborn to have to stick to your class weapons. I make them re-arm at a body or i take the pains to pick up a gun and transfer it in their backpacks. But a lot of times they dont equip that weapon and continue using their pistols.

Another classic example is when snipers run out of ammo, they act like one man army with their pistols and it pests me enough to delete them.

I am not a scripting wizard, but I believe it should be fairly easy to have a mod or addon which scans lets say 100m area for dropped weapons and bodies to rearm AI. And when the player orders them, only those options show under "6"? Also all classes, even snipers should use rifles and shotguns or whatever, in an unbiased way when they dont have any more ammo.

Regards :'(

I would suggest you install one of the splendid ai mods.

Share this post


Link to post
Share on other sites

^ I am not aware of an AI mod that handles re-arming of AI units (please tell me if there is such a beast!!). ASR_AI used to have this feature in Arma 2 however the A3 version does not.

Share this post


Link to post
Share on other sites
^ I am not aware of an AI mod that handles re-arming of AI units (please tell me if there is such a beast!!). ASR_AI used to have this feature in Arma 2 however the A3 version does not.

I do not not specifically if one of those mods improve rearming of AI units, but it's certainly worth a shot.

Share this post


Link to post
Share on other sites

The "rearm" command in A3 has all the awfulness of that in A2 plus it seems to be even more buggy, so autorearm would be great - but unlikely to happen anytime soon (please, somebody prove me wrong. Pretty please?)

Two factors screw autorearming in A3 (which is why asr_A3 doesn't have it): the eye-candy weapon dropping is one. In A2 I modifed COSLX_wounds to remove weapon dropping mainly because it broke asr_AI autorearm; a unit would suddenly appear having dropped say an M249 or a sniper rifle and picked up an empty AK47 from the ground (as the mags were on the corpse).

Really pissed me off when I saw how BIS had implemented weapon-dropping in A3.

The other is the way ammo is split between several different compartments; this affects both how the ammo is taken from a corpse, and how it is placed in the unit inventory (irrespective of source).

Getting a unit to rearm at a group of bodies is even more of a nightmare than it is in A2. If you have a largish team it's just too much of a chore even if the mission allows team-switching. The rubbish standard load-outs don't help, either.

Share this post


Link to post
Share on other sites
The "rearm" command in A3 has all the awfulness of that in A2 plus it seems to be even more buggy, so autorearm would be great - but unlikely to happen anytime soon (please, somebody prove me wrong. Pretty please?)

Two factors screw autorearming in A3 (which is why asr_A3 doesn't have it): the eye-candy weapon dropping is one. In A2 I modifed COSLX_wounds to remove weapon dropping mainly because it broke asr_AI autorearm; a unit would suddenly appear having dropped say an M249 or a sniper rifle and picked up an empty AK47 from the ground (as the mags were on the corpse).

Really pissed me off when I saw how BIS had implemented weapon-dropping in A3.

The other is the way ammo is split between several different compartments; this affects both how the ammo is taken from a corpse, and how it is placed in the unit inventory (irrespective of source).

Getting a unit to rearm at a group of bodies is even more of a nightmare than it is in A2. If you have a largish team it's just too much of a chore even if the mission allows team-switching. The rubbish standard load-outs don't help, either.

What about some fake rearming? Let a script script check if a weapon is close. Then add this kind of weapon + magazines to the units inventory. It's not the nice way, but at least it would work.

Share this post


Link to post
Share on other sites

Unlimited ammo for everything is as follows without even having to reload,put in units ini

this addEventHandler ["Fired",{[_this select 0,getNumber (configFile/"CfgAmmo"/(_this select 4)/"explosive")] spawn {if (_this select 1==1) then {sleep 0.75};_this select 0 setVehicleAmmo 1}}]

Share this post


Link to post
Share on other sites
Unlimited ammo for everything is as follows without even having to reload,put in units ini

this addEventHandler ["Fired",{[_this select 0,getNumber (configFile/"CfgAmmo"/(_this select 4)/"explosive")] spawn {if (_this select 1==1) then {sleep 0.75};_this select 0 setVehicleAmmo 1}}]

Everyone appears to be fascinated by the potential of proper auto re-arm in ARMA 3. But I believe we can adopt Jim's method here for the time being, telling ourselves that our AI mates keep auto- re arming :P

THanks Jim

Share this post


Link to post
Share on other sites

Agreed, that's a workable solution pro tem - thanks, Jim. Doesn't solve the issue of trying to get an AI team-mate with spare capacity to pick a missile launcher, though, or even trying to get one for yourself.

Hmm, wonder how difficult it would be to turn the script into a little addon so it could be an option for pre-compiled missions?

Share this post


Link to post
Share on other sites

The whole rearm thing has never really been fix or worked on by bohemia since OFP days!

I have a great script that allows the AI and human players to never have less then 1 magazine or AT rounds. Works great for ALL AI units on the map! However once the human player is dead and respawns the script does not run on the human player ): Can anyone tell me how to get the script to run again for the player after respawn.

Here is a very good rearm ammo script that XxanimusxX made for me back in ARMA2 and still workd for ARMA3.

Unlimited Ammo Script by XxanimusxX

make an UnlimitedAmmo.sqf - put this in

_unit = _this select 0;

_ammoCount = _this select 1;

_primeWpn = "";

_prevWpn = "";

_magazineType = "";

_foundMags = 0;

while {alive _unit} do {

waitUntil {sleep 0.5; currentWeapon _unit != ""};

_primeWpn = currentWeapon _unit;

if (_primeWpn != _prevWpn) then

{

_prevWpn = _primeWpn;

_magazineType = getArray(configFile >> "cfgWeapons" >> _primeWpn >> "magazines") select 0;

};

_foundMags = 0;

{

if (_x == _magazineType) then

{

_foundMags = _foundMags + 1;

};

} forEach (magazines _unit);

if (_foundMags < _ammoCount) then

{

for "_i" from 1 to (_ammoCount - _foundMags) do

{

_unit addMagazine _magazineType;

};

};

sleep 1;

};

Then in your mission init.sqf put this in-

//Unlimited Ammo*****************************************************
grantUnlimitedAmmo = compile preprocessFileLineNumbers "unlimitedAmmo.sqf";

[player, 1] spawn grantUnlimitedAmmo;  //controls ammo human

{                                     
   if (!(isPlayer _x)) then 
   { 
       [_x, 1] spawn grantUnlimitedAmmo;   //controls ammo AI
   }; 
} foreach allUnits;  
//Unlimited Ammo*****************************************************

If someone knows how I respawn the the code following the death of the player that would be nice.

Share this post


Link to post
Share on other sites

@ jim Brown I can't get the script to work for ARMA3 ):

Does the code you gave on page 1 work after respawn of the player/AI unit? I don't think it does.

The question is how can you get a script to run again after death/respawn for ARMA3. Any help would be great. The script I posted above is just a great script to solve the whole rearm thing. It works for players and any AI place down via editor however after the player respawns or if you spawn in AI units during the mission the script wanted work at that point. need help on this.

If anyone wants to use this script please give XxanimusxX credit for his work that he made for me with ARMA2. Thank you AVIBIRD.

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  

×