Jump to content
Sign in to follow this  
VictorFarbau

VFAI.Equipment -> Public Domain

Recommended Posts

Here's a beta version of my remake of Victor's addon. (updated: v0.91)

The AI should be pretty smart about how they rearm. Some new features:

- AI will rearm from about anywhere possible: crates, vehicles, stuff dropped on the ground and backpacks.

- AI will rearm even under combat if they have no weapons to fight with (unless they're commanded to stay put).

- AI will arm themselves with rocket launchers unless they are carrying a rucksack (OA or ACE) or their primary weapon is a sniper rifle, machinegun or automatic rifle.

- AI grabs a little more ammo when using specialist weapons (sniper, MG, AR) since they won't take a launcher.

- AI will not look for ammo if their gear slots are full.

- AI do not grab a pistol if their secondary ammo slots are full.

- AI will try and grab all useful stuff found in a place on a single run.

- Options found on userconfig can also be set at the beginning or during the mission by changing the global variables (you can turn rearming on/off or allow civilians to rearm etc.)

ACE mod features (when ACE mod is active)

- AI will also grab extra types of grenades and smokeshells found in ACE.

If ACE Wounding module is active:

- AI will grab bandages. Medics will also take Epi and Morphine.

- AI will rearm from unconscious units.

Requires CBA.

Enjoy!

and remember it's a beta :)

Edited by Robalo_AS

Share this post


Link to post
Share on other sites

Many thanks Robalo! It has almost all new great features that I missed in previous version. Just tried it and it works really well. Great work on beta so far. Victor can be proud :)

Share this post


Link to post
Share on other sites

I've discovered an issue. On large scale missions, using this BIS function causes a ton or errors like this in the rpt. and a big slowdown:

Error in expression <i = 0;

{

_return = _return + [_x + (_p2 select _i)];

_i = _i + 1;

} forEach _p>

Error position: <select _i)];

_i = _i + 1;

} forEach _p>

Error Zero divisor

File ca\modules\functions\vectors\fn_vectorAdd.sqf, line 27

_freeslots = [_unit] call BIS_fnc_invSlotsEmpty

That sucks, because it's a very useful function. Guess I gotta figure out how to make my own :(

Share this post


Link to post
Share on other sites

Yeah was about to post about that. Tried it with a warfare mission and everything started running like crap.

Share this post


Link to post
Share on other sites

New version: Download 0.91 beta

- Optimized, should run smooth even on large missions.

- Extra muzzle magazines are now also counted for primary weapons - means the AI might grab GL rounds as well.

- Upped the number of mags they try to maintain from 3 to 5.

If this checks out OK I'll make a proper release and thread for it.

Share this post


Link to post
Share on other sites

Does it automatically resupply the player's ammo when he walks near a dead soldier with the same ammo? I ask this because I fired off lots of PK rounds and when I went to 2 dead PK soldiers, no action menu came up to take their mags. I looked in my own inventory and I was fully supplied.

What's the radius on this happening?

On the one hand, it is more convenient, but on the other hand it feels like "power-ups". It would be nice if there was an action menu selection that said, "Resupply". Doing that would stock up all possible slots, drawing from the dead soldier's inventory.

I was testing pre-0.91 beta.

Share this post


Link to post
Share on other sites
New version: Download 0.91 beta

- Optimized, should run smooth even on large missions.

- Extra muzzle magazines are now also counted for primary weapons - means the AI might grab GL rounds as well.

- Upped the number of mags they try to maintain from 3 to 5.

If this checks out OK I'll make a proper release and thread for it.

Very much appreciated. Downloading and testing.

Share this post


Link to post
Share on other sites
Does it automatically resupply the player's ammo when he walks near a dead soldier with the same ammo? I ask this because I fired off lots of PK rounds and when I went to 2 dead PK soldiers, no action menu came up to take their mags. I looked in my own inventory and I was fully supplied.

I was testing pre-0.91 beta.

Nope, it does not do anything to a player. It only enhances the AI units.

Share this post


Link to post
Share on other sites

Well now I'm puzzled.

Another observation: Any chance there is a conflict with the Copy My Stance (Keypress Version) addon?

I didn't observe any of my A.I. buddies scavenging from the dead, so I wondered if "Copy My Stance" (I was in a crouch) might prevent them, somehow.

Share this post


Link to post
Share on other sites
Well now I'm puzzled.

Another observation: Any chance there is a conflict with the Copy My Stance (Keypress Version) addon?

I didn't observe any of my A.I. buddies scavenging from the dead, so I wondered if "Copy My Stance" (I was in a crouch) might prevent them, somehow.

OK, I rushed when I packaged it and the function that returns free slots does not actually work, hence AI not grabbing mags, assuming slots full, so just weapons and bandages. That explains the good performance :D

Working on another fix. Thanks for testing.

About Copy My Stance, I'll download it to see, but I don't think anything would conflict with this.

Share this post


Link to post
Share on other sites
OK, I rushed when I packaged it and the function that returns free slots does not actually work, hence AI not grabbing mags, assuming slots full, so just weapons and bandages. That explains the good performance :D

Working on another fix. Thanks for testing.

About Copy My Stance, I'll download it to see, but I don't think anything would conflict with this.

Yes I already was wondering about the great performance...:rolleyes:

Share this post


Link to post
Share on other sites

OK, third one must be good: Download beta 0.92

- More optimisations

- Ammo that goes into primary or secondary slots is handled separately. This means AI with a rifle GL will also grab GL ammo when found.

- When looking for a weapon because the current one is empty, don't pick up same weapon :)

Tested this one better and it's working fine, main concern here is performance.

Share this post


Link to post
Share on other sites

// Units will take handguns. 0 = No; 1 = Yes
asr_vfai_sidearm = 0;

:yay: Thank you!

Share this post


Link to post
Share on other sites

Excellent work as usual Rob, played with it for a while this morning. Great improvements, and I'm really glad to see the all positive responses. Good stuff. :)

Share this post


Link to post
Share on other sites

Thanks, it's not a proper release though as it does not include a readme, I'll do that once I gather enough feedback (repackage, release)

Share this post


Link to post
Share on other sites

I tested it yesterday, and hmmmm...the features are really nice, but performancewise it not that good. It slows down all the other scripts significantly. (Especially ACE2 and GL4).

Can you improve the performance?

Share this post


Link to post
Share on other sites

I guess the way to go it to make as many features as possible optional. The code should already be fairly optimized, any contributions welcome.

While this might have an impact on a large SP scenario, I tested this on our dedicated and did not notice any performance degradation.

Share this post


Link to post
Share on other sites

@Robalo

Maybe a good idea would be to make the script check the magazines for units only every 2-3 minutes. And for the player controlled squad every 60 seconds. This would maybe help with the performance.

What do you think, is this feasible?

Share this post


Link to post
Share on other sites
@Robalo

Maybe a good idea would be to make the script check the magazines for units only every 2-3 minutes. And for the player controlled squad every 60 seconds. This would maybe help with the performance.

What do you think, is this feasible?

Sounds good, the magazine part is the most expensive. I'll try that first, thanks for the suggestion Kroky !

Share this post


Link to post
Share on other sites

I offer this only as a data point. I think this is a great idea, but here's why it didn't work for me...

4 man fireteam (TierOne and TF86 SEALs). Each one has a backpack added w/ GL4's addon (which is excellent, btw). All are running w/ ZeusAI. Even when told to stop, several units would either move to the nearby vehicle (Hummer SOV w/ some M136's added) and grab launchers and ammo. I filled up everyone's slots before the mission started. Even at the very beginning of the mission, I tell them to stop, they still grab rockets and/or ignore my "STOP" command.

I think this addon is a great idea, just didn't work right for me. Just thought I'd post the info as I experienced it.

Share this post


Link to post
Share on other sites

Considering how far apart I know the "intended remake" was for and what everyone would like it to be ... I think the more config options the better.

If for no other than reason than helping the hardcore SP guys out :p

(seems it can get rather heavy quick, quicker than i thought ... tested smaller box Rob)

Make the interations configurable? This might be really handy for big persistant mission servers also, and perhaps other missions.

Anyway, just another more options rant basically. But I think that would make it the package very user friendly. I'll do the readme! :D

Gnome

Share this post


Link to post
Share on other sites

Hey gatordev, thank for testing. Need some more info about your scenario:

4 man fireteam (TierOne and TF86 SEALs). Each one has a backpack added w/ GL4's addon (which is excellent, btw).

I don't know what is a GL4 backpack. I have Group Link 4 but don't know about any backpack feature. There is a check in place, if the secondary slot is taken, the AI will not pick up launchers. Afraid I can't cover for scripted, imaginary backpack solutions if that's the case.

All are running w/ ZeusAI. Even when told to stop, several units would either move to the nearby vehicle (Hummer SOV w/ some M136's added) and grab launchers and ammo. I filled up everyone's slots before the mission started. Even at the very beginning of the mission, I tell them to stop, they still grab rockets and/or ignore my "STOP" command.

Hmm, I think some other addon/script else might give the AI something to do and then they're ready for the rearming bits to grab them. If I give my AI the Stop command, they stop as they should and do nothing. Observe the icons on the bottom of the screen: when you say Stop, they icons get labeled "Stop". If they are released from that then you will see no text on the icons.

Please test if they remain labeled "Stop" without the rearming addon.

Something about the upcoming update:

- optimized for performance - the full inventory check is done less often, 30-60 seconds for AI with a player in their group, 2-3 minutes otherwise. Quick checks are done more often, each 10-20 seconds, like if a soldier needs a primary weapon.

- making sure they don't try grabbing stuff out of the water :)

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  

×