This page is a work in progress and information will be added as needed regularly.
If your mod adds custom storage that involves you manually saving the item data in each slot, then you may run into issues with custom items added using TR Tools. If a modded item is placed in your storage, then the standard vanilla itemID won't be an accurate value to save. To avoid these issues, follow the instructions below.
First, you should save a string value instead of the itemID. You can get this string with the following function: TRItems.GetSaveableItemID(int ItemID)
Calling this function and passing in the standard itemID of the item in a particular slot will return the string that you should save. If the item is vanilla, it will merely be the standard itemID in string form. If it is a custom item, it will be the custom item's unique ID instead.
Then, when loading data, you can call this next function to get the standard itemID of the saved value:TRItems.GetLoadableItemID(string savedID)
This function takes in the saved value that was previous returned by GetSaveableItemID(). If it reads that as simply being a vanilla item, it gets that item's ID. If it's a custom item, then it searches for that custom item. If the custom item exists, then it gives you that item ID. In either case, it is giving you the standard item ID for the item. This can vary with each load of the game if mod load order is changed or mods are removed.
If a there is an issue reading the savedID or the mod that added the custom item has been uninstalled, then the returned value will be ‘-2’. I recommend checking if the returned value is ≥ 0 before trying to add it to the slot.