-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Welcome to the BG3_Automatic_Inventory_Manager wiki!
See the other wiki pages for a more in-depth explanation - there may be additional checks on the different triggers, depending on the config.json values, and additional behaviors that don't translate well to flow charts.
flowchart TD
A[Save Load]
A --> |When an item with the CONSUMABLE tag is used by a party member| SC["Sort every item in the party's inventory with the same RootTemplate"]
A --> |If never sorted previously| IS["Sort all items in party inventory"]
A --> |When an item or stack is added to party member's inventory| TA["Sort the received stack of item(s)"]
IS & TA & SC --> BL["Is this item in the blacklist"]
IS & TA --> HasSorted["Has this item already been sorted"]
BL & HasSorted --> |"No"| IFL["ItemFilter Lookup"]
IFL --> |"Merge all ItemFilters pulled from the ItemFilterMaps"| CP["CoreProcessor"]
CP --> PSPF["Run found Per-Stack PreFilters"]
PSPF --> II["Iterate over every item in the stack"]
II --> PIPF["Run found Per-Item PreFilters"]
PIPF --> F["Run each found filter until a single target remains or there are no more filters"]
F --> |"If no more filters and multiple targets left"| MW["Randomly select a winner from the list of remaining targets"]
F & MW --> OW["Add the winner to the winner maps"]
OW --> II
OW --> PW["Distribute the item stack to the identified winner(s)"]
AIM works on Larian's event system and has safegaurds ensuring the item exists and is in the party's inventory, so it should play well with mods like Auto Loot Seller and any bag mods with auto-sorting like Bags Of Sorting - Beans. Mods can also leverage AIM's API to implement or overwrite filters to specifically work with their mods, if so desired.
There shouldn't be any concerns with uninstalling this mod - the only artifact it will leave behind is the custom tag it uses to identify previously processed items - I'm not aware of any use-cases that would cause this to break anything, but it may depend on a mod's implementation. If anyone is aware of concerns around this, please reach out!