-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AI Arsenal Overhaul #441
base: unstable
Are you sure you want to change the base?
AI Arsenal Overhaul #441
Conversation
To support adding items (or not) per loadout category, depending on selection in AI arsenal.
I need some input on how to deal with cargo items. As of right now, all loadouts get medical supplies and misc essentials from If you're playing with other real players, you can make an argument for people carrying equipment for other people, e.g. static weapon bags, extra machine gun ammo, etc. But since AI won't use equipment from other AI anyway, I'm thinking we deal with that major issue by just not allowing setting cargo for AI loadouts... Thoughts? Otherwise, I think this just needs UI improvements (removing "Petros Knows Best" from item lists where it doesn't make sense or isn't implemented, and a way to make this feature / overhaul of the loadout system more discoverable. |
(and are unlocked, or qty >= ITEM_MIN if no unlocks)
Only add weapons to hashmap that have unlocked magazines. Only give rebels magazines that have been unlocked.
"Limits all equipment (weapons, uniforms, NVGs, mags, literally everything) available in the AI arsenal to what's unlocked" What happens when no unlocks is used? As AI need to still pick from limited gear or else become entirely useless |
Short answer is as of right now you're right, this only works well with unlocks enabled. I'm still working through how to make it work for unlocks disabled case. Afaict, This PR is still WIP, I just changed it from draft to review so y'all could get eyes on / lmk if it's not worth spending any more time on. Imo, it makes it a lot easier to deal with the AI arsenal in general with less UI spam from equipment you can't use, and limiting equipment available by class stops what I consider to be an exploit (taking a super cheap AI class and giving them GLs and missile launchers). Could even table the 'petros know best' piece for another time / PR. Just need to sort out the unlocks disabled case as you mentioned, and the current UI issues. |
Class limiting equipment may not function correctly with mods that dont have properly setup weapons, many mods have all weapons inherit from the base assault rifle or similar |
Those cases would (or should) be handled by addons\core\functions\ammunition\fn_categoryOverrides no? |
if they had ever been checked or setup for that yes. but pretty much nothing has |
@stutpip123 I just had a thought, dunno how I didn't think of this earlier: given that the generation of
Update: edd158a and 999063f implements this and seems to work pretty well with both unlocks enabled and disabled. BUT When creating an AI loadout with unlocks disabled and selecting an item with qty more than 25 (from jna_minItemsMember) but not unlimited, then spawning AI with that loadout, the items are NOT removed from the arsenal. Seems like this sets up the potential for item duping cheating - get 25+ of an item, add it to rebel loadout, spawn rebels, kill them, and loot to arsenal. This is replicatable in this PR and in main build. This could be solved, but it would require removing items from arsenal in equipRebel / associated functions and regenerating Also going back to the categories thing, if a mod isn't properly setup and the overrides aren't setup, then that would also affect the generation of A3A_rebelGear. So if anything, this PR just makes the ai loadout arsenal consistent with the rebel gear hashmap. |
What type of PR is this?
Ports:
official-antistasi-community#3392
What have you changed and why?
This PR -
Due to the nature of how the AI arsenal works, it's an all or nothing approach: if you want to change / statically set one thing for an AI class, the AI loadout has to set everything else as well. So e.g. if you want to ensure your AA Specialists use Stingers instead of Strelas, now every other part of their loadout (barring uniform / headgear) will always be exactly the one thing that was set in the loadout you chose the Stinger in.
This PR fixes that annoyance with an override system. Basically, the AI arsenal functions as normal, except that an option is added to all lists (except cargo) called "Petros Knows Best." If this option is chosen, AI will still use the normal functions within fn_equipRebel to equip item(s) from that category.
Example use case: Say I don't want my rebel riflemen to wear police vests, and I want them to always use M4s. So when editing the rifleman class, I choose a vest I like and select the M4. For all other categories, I select "Petros Knows Best." Now when I recruit AI rifleman, they'll have the vest and M4 I chose, and everything else will still be "randomized" using the functions in equipRebel.
PR also limits primary and secondary weapons available for the loadout based on the AI class (e.g. only grenadiers can have a grenade launcher, only AA can have an AA launcher, etc), and ensures rebels only get magazines that are in arsenal (and unlocked if playing with unlocks, or qty >= ITEM_MIN if no unlocks). No more farming rebel recruits for magazines.
Please specify which Issue this PR Resolves (If Applicable).
None AFAIKFixes - @UAC-MaxxLite desire for limiting weapons available by class, and my annoyance with all or nothing loadout approach.Please verify the following.
Is further testing or are further changes required?
This is still very much a WIP. It works enough that you can give it a test and see if it makes sense and y'all think it works for this game.
Issues that need worked out:
Major issues:
Minor issues:
How can the changes be tested?
Steps:
Notes:
official-antistasi-community#3392 is partially ported into this (fn_randomRifle, fn_addPrimaryAndMags, fn_equipRebel) to minimize divergence from upstream.
#433 is merged into this for compat.