XCOM 2
35 ratings
[WOTC] Resource Cost Fixer
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
153.285 KB
11 Jan @ 2:21pm
22 Jan @ 11:31pm
6 Change Notes ( view )
You need DLC to use this item.

Subscribe to download
[WOTC] Resource Cost Fixer

In 1 collection by Zelfana
Bugfixes by Zelfana
12 items
Description
Overview
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.

Configuration
<Steam>\steamapps\workshop\content\268500\3137225733\Config\XComZelfFixResourceCosts.ini

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)

Compatibility
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.

Credits
Thanks to ReshiKillim for stepping on the rake that brought these issues to my attention.

Notes
Any suggestions welcome as always.
9 Comments
Deacon Ivory 23 Jan @ 2:05am 
Huge shout out for creating this mod, and then jumping over rakes only to land in a rabbit hole of Firaxis spaghetti. :steamhappy:

Players who truly want their games to run well should check out Zelfana's collections of fixes and standard mods.
Zelfana  [author] 22 Jan @ 2:18pm 
Actually, I just automated the fix after finding more similar items added by mods.
Zelfana  [author] 22 Jan @ 11:38am 
Heads up, if you used up the shared XCOM Ability Points and they went to zero and broke before this latest update you have to fix it manually by adding the item to your inventory with this console command (you can use any quantity you want if you lost out on some AP):

AddItem AbilityPoint 10
LeyShade 15 Jan @ 8:00am 
Thanks to Reshi for stepping on the rake, thanks to Zelfana for putting it back in the shed 👍👍
Dragon32 13 Jan @ 11:32am 
@Zelfana
Thanks for the detailed reply. I guess I've been lucky and not seen the sort of thing you describe. I guess I won't at all now if I subscribe to the mod. Thanks for publishing it.
Zelfana  [author] 13 Jan @ 10:03am 
These issues shouldn't be common if people did things right.

The most common things this mod fixes are duplicate items in costs that some mods have. Like Weapon and Item Overhaul having 1 Elerium Core twice in Proving Ground armor projects.

Others have completely invisibly broken costs like per difficulty config not working because of some quirk in the game itself and this mod can fix those.

And then the mentioned issue with putting non-resource items in ResourceCosts which I have no idea how common it is but it definitely happens. This is not a problem until you run out of an item and it leaves behind that zero item stack in the inventory so you may not run into it at all.

So yeah, a bunch of small issues that you may not realize are happening. Should be no harm enabling this mod all the time (apart from then not knowing what was broken and got fixed without enabling logging and looking in the log).
Dragon32 13 Jan @ 2:08am 
Is what this fixes a common occurrence? I'm struggling to understand what it does.

Do some mod-added Engineering projects call for a negative number of some resource or something? Is that what items and item stacks are in this case?
Zelfana  [author] 11 Jan @ 5:08pm 
No, that sounds like a problem the mods themselves have to fix or you're missing Musashi's Mods Fixes that fixes it for Musashi's mods that are not getting updated.

Can't be automatically fixed for every mod doing the part wrong that breaks it.
Skarsatai 2.0 11 Jan @ 4:41pm 
Does it Help against the Main weapon cycle Problem? The Problem when a Mod not correctly use a Template and puts several weapons/armors/items in one Slot? Result IS the cycling weapon.