Jump to content
Sign in to follow this  
msy

Make AI Ammo Assist. a real assistant who can give you ammo actively

Recommended Posts

In Arma2 it officially introduced a role-- Ammo Assistant, who has extra ammo for MG gunner or RPG soldier. But in ARMA2 vanilla, there is no rucksack, you can't easily get extra ammo from an Ammo Assistant. Until ARMA2 OA, you can get ammo from their rucksack when you move near to the assistant and get the ammo using action menu (open backpack).

However I want it to come true: when you ( or AI) are out of ammo, you ( or AI) report "out fo ammo", then the Ammo Assistant can actively move to you and automatically gives you some magazines. And this process needs no action menu. More over, even in rifle team, one rifle man report he is no ammo, the other AI rifle man who is near to him and have more ammo than him can give him one magazine automatically.

Of course this effect is my thoughts and I am not in army so I don't know in real war how a squard share their ammo. If it is rediculars please correct it.

If it is possible, I think this will be in ARMA3

Edited by msy

Share this post


Link to post
Share on other sites

ASR_AI addon has made it possible for AI to resupply ammo from other AI teamates' rucksacks. So maybe BI can also do something on this.

Share this post


Link to post
Share on other sites
However I want it to come true: when you ( or AI) are out of ammo, you ( or AI) report "out fo ammo", then the Ammo Assistant can actively move to you and automatically gives you some magazines. And this process needs no action menu. More over, even in rifle team, one rifle man report he is no ammo, the other AI rifle man who is near to him and have more ammo than him can give him one magazine automatically.

+3

Excellent suggestion! I've used a number of addons that include automatic rearming - SLX & variants, VFAI [A2] then Robalo's splendid asr_ai [CO], but still find it frustrating & clunky just to rearm myself - & sometimes get killed when chasing some unit with the ammo/opening the backpack/grabbing the ammo. Might be difficult to implement a unit throwing a magazine to a comrade when under fire (i.e. staying in cover) but any active giving would be great.

Hmm - maybe some of the scripting aces could come up with something for CO? If the response was limited to "Out of ammo" calls there shouldn't be a significant hit on the CPU load (do AIs in all-AI teams shout this? I think so, but my memory could be wrong). Polling magazine counts would be a huge load if all AI units were scanned.

Make a CIT feature request & I suspect you'll get a healthy response. Even if it doesn't make it into CO it will let the BIS team gauge how important the community rate it for possible inclusion in A3. Also, it might be worth a post in the addon request thread - if only to get feedback on how difficult it might be to implement.

BR

Orcinus

Share this post


Link to post
Share on other sites
+3

Excellent suggestion! I've used a number of addons that include automatic rearming - SLX & variants, VFAI [A2] then Robalo's splendid asr_ai [CO], but still find it frustrating & clunky just to rearm myself - & sometimes get killed when chasing some unit with the ammo/opening the backpack/grabbing the ammo. Might be difficult to implement a unit throwing a magazine to a comrade when under fire (i.e. staying in cover) but any active giving would be great.

Hmm - maybe some of the scripting aces could come up with something for CO? If the response was limited to "Out of ammo" calls there shouldn't be a significant hit on the CPU load (do AIs in all-AI teams shout this? I think so, but my memory could be wrong). Polling magazine counts would be a huge load if all AI units were scanned.

Make a CIT feature request & I suspect you'll get a healthy response. Even if it doesn't make it into CO it will let the BIS team gauge how important the community rate it for possible inclusion in A3. Also, it might be worth a post in the addon request thread - if only to get feedback on how difficult it might be to implement.

BR

Orcinus

Thanks for your advise. Can you help open a feature CIT for this idea? I think you can express the suggestion better than me.

Share this post


Link to post
Share on other sites
Thanks for your advise. Can you help open a feature CIT for this idea? I think you can express the suggestion better than me.

OK, will do over the weekend. Would you like to post in the addon request thread? - since it was your idea in the first place (but best to search first in case it's been requested before)

BR

Orcinus

Share this post


Link to post
Share on other sites
OK, will do over the weekend. Would you like to post in the addon request thread? - since it was your idea in the first place (but best to search first in case it's been requested before)

BR

Orcinus

In fact I really want to see it done by BIS himself. I'm not used to add AI enhancement addon except for MODs in which AI is part of it such as ACE MOD. Meanwhile I will be happy if there will be a AI improvement addon for my wish in 3rd party's work.

Share this post


Link to post
Share on other sites

Just FYI - ASR AI is de facto a part of ACE mod (since Robalo is the guy currently responsible for ACE AI improvements and ASR is built around them).

Share this post


Link to post
Share on other sites

Why not just have something similar to the first aid module? Then if you select "out of ammo", they will run to you and give you a couple mags...you could even use it for extra RPG/SMAW rounds.

Seems simple, but I can't script either lol

Share this post


Link to post
Share on other sites
Why not just have something similar to the first aid module? Then if you select "out of ammo", they will run to you and give you a couple mags...you could even use it for extra RPG/SMAW rounds.

Seems simple, but I can't script either lol

Good instance. Hope BIS can add more interaction into ARMA series.

Share this post


Link to post
Share on other sites

I believe that BIS has previously stated that this was already planned for OA, but unfortunately they were not able to make it work in time for the release. It's a great suggestion though, and I definitely hope that they have not given up on making it work in the future versions.

I love ASR AI and never play without it. However, when it comes to this particular feature, I find that they still have a long way to go. I was never able to get the RPG assistant to make good use of himself in my test scenarios... come to think of it - I hope that they have not given up on this feature either...

Peace,

DreDay

Share this post


Link to post
Share on other sites

i do not think the player should have to micromanage his men in these sort of tasks, i imagined the scenario something like this:

leader "team, take a drink and check your ammo, maintain 50% watch"

bob "only 2 mags left"

john "i've got some spare, here you go"

leader "good, anyone else?"

team "no, all good"

leader "ok, we're oscar mike"

so, here's a script made recently which will make men with less than three magazines try to obtain some from team mates. this was designed to be run in the consolidation phase after a contact, not during a firefight , but i suppose it could be tried then.

In the absence of a player command in game, it does the job. This works for Arma 2, no backpacks involved, simply shares out ammo from normal inventory.

If unit does not have the weapon for which it is carrying a type of ammo, it is considered a bearer and can give all the ammo of that ammo class to the unit who is low.

otherwise, magazines are shared. e.g unit bob has 2 magazines, john has 5 magazines: one magazine is handed over, so they now have 3 and 4 mags respectively.

Not exactly what you were asking for, but I understand it's good practice to check and redistribute ammo after any contact and doing that goes a long way to solving the problem of running out in the first place. ;)

Doesn't include ammo for secondary weapons (rockets) as there can be several class names to consider as in the case of SMAW or RPG. Getting too complicated and I wanted to move on...

Still, if people find this useful and are happy to just create a radio trigger to call upon this in their own missions, I would go back and include rockets somehow.

I seem to have found a 'bug'? After giving away some ammo, your weapon is empty, you have to reload.

The bastard took the mag out of my rifle and even the round from the chamber :eek:

//script to make team share ammo - written by Small Ashram 2012
//Parameter 1: group
//example usage: nul=[group player]execVM "SAFC_distributeammo.sqf"
//Simplest, player controlled use: put the above code in the On Act. of a radio trigger. In text box of trigger put "Distribute Ammo".  Set trigger to activate 'repeatedly'

private ["_grp","_taker","_giver","_nmags","_magclass","_mags","_weapon","_unit","_mostmags","_unitg","_magsg","_nmagsg","_magstogive"];

_grp=_this select 0;

//do getting ammo from bearer
{
   _nmags=0;
   _unit=_x;
   _weapon=primaryWeapon _unit;
   _mags=magazines _unit;
   _magclass=getArray (configFile/"CfgWeapons"/_weapon/"magazines") select 0;

   {
       if (_x == _magclass) then {_nmags=_nmags+1};
   }forEach _mags;

   if (_nmags<3) then {
       _taker=_unit;
       _giver=objNull;
       _mostmags=0;
       {
            _unitg=_x; 
            _nmagsg=0;
            _magsg=magazines _unitg;
            {
                if (_x == _magclass) then {_nmagsg=_nmagsg+1};
            }forEach _magsg;
           if (_unitg !=_unit && _nmagsg>0 && (getArray (configFile/"CfgWeapons"/(primaryWeapon _unitg)/"magazines") select 0) !=_magclass) then {_giver=_unitg;_mostmags=_nmagsg};

       }forEach units _grp;

       if (!(isNull _giver)) then {
               _magstogive=_mostmags;

           //move taker to giver and transfer mags
           _taker commandMove getpos _giver;
           waitUntil {sleep 0.1;_taker distance _giver < 2};
           for "_i" from 1 to _magstogive do {
               _taker action ["TakeMagazine", _giver, _magclass];
               sleep 0.1;
           };
       };

   };
sleep 1 + random 1;
}forEach units _grp;

//do swapping mags between weapon users
{
   _nmags=0;
   _unit=_x;
   _weapon=primaryWeapon _unit;
   _mags=magazines _unit;
   _magclass=getArray (configFile/"CfgWeapons"/_weapon/"magazines") select 0;

   {
       if (_x == _magclass) then {_nmags=_nmags+1};
   }forEach _mags;

   if (_nmags<3) then {
       _taker=_unit;
       _giver=objNull;
       _mostmags=0;
       {
             _unitg=_x; 
            _nmagsg=0;
            _magsg=magazines _unitg;
            {
                if (_x == _magclass) then {_nmagsg=_nmagsg+1};
            }forEach _magsg;
           if (_unitg !=_unit && _nmagsg>=_nmags+2 && _nmagsg >_mostmags) then {_giver=_unitg;_mostmags=_nmagsg};

       }forEach units _grp;

       if (!(isNull _giver)) then {
               _magstogive=floor((_mostmags-_nmags)/2);
               if (_magstogive==0) then {_magstogive=1};
               if (_magstogive<0) then {_magstogive=0};

           //move taker to giver and transfer mags
           _taker commandMove getpos _giver;
           waitUntil {sleep 0.1;_taker distance _giver < 2};
           for "_i" from 1 to _magstogive do {
               _taker action ["TakeMagazine", _giver, _magclass];
               sleep 0.1;
           };
       };

   };
sleep 1 + random 1;
}forEach units _grp;

Share this post


Link to post
Share on other sites

@Ashram 1-1

That could be quite useful, thanks a lot for sharing. Maybe add in limiters? - if a unit has < 3 mags, make no donor action, move on to next _x

- and when _x has >3 mags, donate until # of mags ==3. then skip to next _x

The issue with all current approaches to rearming is that they involve one or more units wandering around; under fire that is potentially suicidal & very unrealistic (from common sense & combat footage rather than any personal experience).

I'm in the (somewhat slow) process of making an addon that will let the player throw a mag to a unit (or order an AI to throw a mag to the player) while under fire. Might be possible also to have the player order 1 unit to throw a mag to another, though that isn't as straightforward as there musn't be any obstacles in the trajectory; even trickier with there being some trees & other object(s) the AI "sees" through. Be nice to have an almost fully-automated ammo distribution from backpack units. I got hold of a couple of studies on throw distance vs weight, so that could be factored in to avoid the absurdity of someone lobbing a 200-round M249 mag as far as they would a grenade - a conservative max-allowed-distance comparison with the distance between the units.

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  

×