[WOTC] Resource Cost Fixer
Fixes issues related to resource and artifact costs on items, research, facilities etc.
All items that are not persistent resources will get moved to ArtifactCosts and all persistent resources (supplies, intel, alien alloys, elerium crystals, ability points) will get put in ResourceCosts. Non-resource items in ResourceCosts are not handled properly by the game and it breaks some things.
Will also remove item stacks that have zero items from XCom HQ inventory which is one of the things that can happen due to these issues. Due to how the game checks for items in the inventory these zero item stacks can make it think you don’t have any of the item being checked if it runs into that zero item stack first.
Ensures that the persistent resource items have their one single item stack. If this item stack doesn’t exist the game will not actually add items with the AddResource function that is often used with resource items. Additionally, if there are multiple stacks for the same item the game only checks the first one it finds.
Config has toggles for:
- Ensure persistent resource items have one single stack
- Purge zero item stacks
- Remove zero or negative item quantities from costs
- Remove duplicate items from costs
- Combine duplicate item counts instead of removing extras (not enabled by default)
- Remove items that the game can’t find templates for from costs (not enabled by default)
Safe to add or remove any time.
Runs after all mods I know of that modify costs in OnPostTemplatesCreated so should be able to apply these fixes to all possible costs.
Most mods use existing template classes so this mod is able to modify those without issues.
Special handling included for Gene Mods. It is not a requirement for this mod.
Thanks to ReshiKillim for stepping on the rake that brought these issues to my attention.
Any suggestions welcome as always.
