Jump to content

Inventory Rebuilder: Mod Uninstall Utility 0.1


1 Screenshot

About This File

WARNING: THIS DOES NOT WORK OUT OF THE BOX.  YOU NEED TO EDIT IT TO SUIT YOUR NEEDS.

Have you uninstalled a mod that added pills and now you're stuck with unusable things in your inventory?

I've got the mod for you!

Inventory Rebuilder is a utility mod designed to tear apart your Pill Inventory, remove/replace the old pills, and stitch it back together.

 

How to use:

1: Load up the save file in question.

2: Use the debug console (opened with ~`), type in $pill_inventory and press enter.

This will bring up a table of your Pill Inventory, separated into the Pill Names, and the amount you have.

3: Take note of the pills you want removed.  Ensure you copy them exactly as they are shown in the table, including capitalization and spelling.

 

4: Open Inventory Rebuilder.twee

You can use Visual Studio Code, Notepad++, or (if you have nothing else) Notepad.

 

Edit the mod to insert what you want.  There are comments in it to help describe it, or see what's in the spoiler if you want the full explanation.

Spoiler

The mod has three things to edit, we'll start with the Remove list.  

The Remove List will simply delete the listed pills from your inventory and the amount you had will be lost.  It's defined on line 15 with:

(set:_removeList to (a:"R1", "R2", "R3"))
Obviously, "R1" "R2" and "R3" are just examples.  
Replace them with the Pills that you want deleted from your inventory (don't add them here if you want to swap/refund them).

Make sure they're separated by commas and encased in quotation marks.

For example:  if a mod added 2 pills called Red and Yellow and you needed to delete them, you would change the line to:

(set:_removeList to (a:"Red", "Yellow"))

 

Next up, we have the Convert List.  This one will remove the pills you list, and exchange what you had for other pills.

It's defined on lines 17-21 with:

(set:_convertList to (dm:
    "Old1", "New1",
    "Old2", "New2",
    "Old3", "New3"
))

Similar to before, replace Old with the pill you want replaced, and New with the ones you want them switched to.

Example again: If a mod added 4 pills called Green, Yellow, Red, and Black, and you wanted to swap them out for regular X-Change pills, you'd change it to:

(set:_convertList to (dm:
    "Green", "Basic",
    "Yellow", "Breeder",
    "Red", "Basic",
    "Black", "X-Tra Strength"
))

In this example, and Reds and Greens you have will be swapped out for X-Change Basic, Yellows will become Breeders, and Blacks will become X-Tra Strength.

 

Lastly, the Refund List.  This one will remove the pills you list, and give you money for them.

It's defined on lines 23-27 with:
(set:_refundList to (dm:
    "Ref1", 100,
    "Ref2", 200,
    "Ref3", 1000
))

Again, replace the Ref examples with Pill names and their Prices.  Don't put the prices in quotation marks.

Example:  This uninstalled mod only added one pill: Rainbow.  You bought 3 of them for $5,000 each, and now they're useless.

(set:_refundList to (dm:
    "Rainbow", 5000
))

This will make the mod tear through your inventory, delete those Rainbow Pills, and add $15,000 to your character.

 

The mod goes through these lists in the following order: Refund, Convert, Remove.

If a Pill is on the Refund List, It'll be gone before Convert or Remove take effect.

 

 

5: Save your work!

6: Load the edited Inventory Rebuilder.twee with the mod loader.

7: Load up the game, load your save.

8: Success! (Hopefully)

9: (Optional) disable Inventory Rebuilder.  Unless you have more saves to strip.

 

 

 

Are you a Mod Author looking to rename your pills?  See the Code in the Spoiler below for a version update script that works the same way!

 

Spoiler
:: <MODID> Version update script [init_new]
(set:_current to <VERSION NUMBER HERE>)
(if:$<MODID>_version < _current)[
  (set:_updateList to (dm:
      "Old1", "New1",
      "Old2", "New2",
      "Old3", "New3"
  ))
  (set:_pillNames to (dm-names:$pill_inventory))
  (set:_pillQuant to (dm-values:$pill_inventory))
  (for: each _i, ...(range:1,_pillNames's length))[(set:_x to _i of _pillNames)(if: _updateList contains _x)[(set:(_i of _pillNames) to (_x of _updateList))]]
  (set:_rebuild to (dm:))
  (for: each _i, ...(range:1,_pillNames's length))[(set:_rebuild to it + (dm: _i of _pillNames, _i of _pillQuant))]
  (set:$pill_inventory to _rebuild)
  (if:_updateList contains $pill_taken)[(set:$pill_taken to $pill_taken of _updateList)]
  (set:$<MODID>_version to _current)
]

 

 

Edited by LadyWhiskers413
Forgot the last steps



×
×
  • Create New...