TysonCodes / PlanetCrafterPlugins

Repo to store all my mods (BepInEx plugins) for The Planet Crafter game.
MIT License
4 stars 7 forks source link

RecipeExportImport #1

Closed tommynanny closed 2 years ago

tommynanny commented 2 years ago

hey,

I can't seem to find any "BepInEx\plugins\Lathrey-RecipeExportImport\DataFiles\RecipesToModifyAndAdd.jsonc" by default. I was wondering if you could provide a sample "RecipesToModifyAndAdd.jsonc" ? I just want to make "PulsarQuartz" craftable.

Thanks

tommynanny commented 2 years ago

after checking the source code, I create the "RecipesToModifyAndAdd.jsonc"

{
    "Modifications": {
        "PulsarQuartz": {
            "id": "PulsarQuartz",
            "associatedGameObject": "PulsarQuartz",
            "icon": "PulsarQuartz",
            "recipeIngredients": [
                "Alloy",
                "Alloy",
                "Alloy",
                "Alloy",
                "Zeolite",
                "Zeolite",
                "Zeolite",
                "Zeolite"
            ],
            "hideInCrafter": false,
            "unlockingWorldUnit": 0,
            "unlockingValue": 0.0,
            "terraformStageUnlock": "None",
            "inventorySize": 0,
            "value": 0,
            "craftableInList": [
                3
            ],
            "equipableType": 0,
            "usableType": 0,
            "itemCategory": 0,
            "growableGroup": "None",
            "associatedGroups": [],
            "assignRandomGroupAtSpawn": false,
            "replaceByRandomGroupAtSpawn": false,
            "unitMultiplierOxygen": 0.0,
            "unitMultiplierPressure": 0.0,
            "unitMultiplierHeat": 0.0,
            "unitMultiplierEnergy": 0.0,
            "unitMultiplierBiomass": 0.0
        }
    }
}

but the BepInEx log gives some errors: Unsupported override 'id'

[Info :RecipeExportImport] Logging craftables list to D:\Steam\steamapps\common\The Planet Crafter\BepInEx\plugins\Lathrey-RecipeExportImport\DataFiles\CraftableList.txt
[Info :RecipeExportImport] Modifying 'PulsarQuartz'
[Warning:RecipeExportImport] Unsupported override 'id'
[Info :RecipeExportImport] Overriding 'associatedGameObject'
[Info :RecipeExportImport] Overriding 'icon'
[Info :RecipeExportImport] Overriding 'recipeIngredients'
[Info :RecipeExportImport] Overriding 'hideInCrafter'
[Info :RecipeExportImport] Overriding 'unlockingWorldUnit'
[Info :RecipeExportImport] Overriding 'unlockingValue'
[Info :RecipeExportImport] Overriding 'terraformStageUnlock'
[Warning:RecipeExportImport] Attempt to set 'terraformStageUnlock' to unknown stage 'None'
[Info :RecipeExportImport] Overriding 'inventorySize'
[Info :RecipeExportImport] Overriding 'value'
[Info :RecipeExportImport] Overriding 'craftableInList'
[Info :RecipeExportImport] Overriding 'equipableType'
[Info :RecipeExportImport] Overriding 'usableType'
[Info :RecipeExportImport] Overriding 'itemCategory'
[Info :RecipeExportImport] Overriding 'growableGroup'
[Error :RecipeExportImport] Caught exception 'The given key was not present in the dictionary.' trying to apply modifications/additions.
tommynanny commented 2 years ago
{
    "Modifications": {
        "PulsarQuartz": {
            "recipeIngredients": [
                "Alloy",
                "Alloy",
                "Alloy",
                "Alloy",
                "Zeolite",
                "Zeolite",
                "Zeolite",
                "Zeolite"
            ],
            "craftableInList": [
                1,
                2,
                3,
                4,
                5,
                6
            ]
        }
    },
    "ItemsToAdd": {},
    "BuildingsToAdd": {}
}
[Message:   BepInEx] BepInEx 5.4.19.0 - Planet Crafter (5/16/2022 5:18:50 AM)
[Info   :   BepInEx] Running under Unity v2020.3.26.7510196
[Info   :   BepInEx] CLR runtime version: 4.0.30319.42000
[Info   :   BepInEx] Supports SRE: True
[Info   :   BepInEx] System platform: Bits64, Windows
[Message:   BepInEx] Preloader started
[Info   :   BepInEx] Loaded 1 patcher method from [BepInEx.Preloader 5.4.19.0]
[Info   :   BepInEx] 1 patcher plugin loaded
[Info   :   BepInEx] Patching [UnityEngine.CoreModule] with [BepInEx.Chainloader]
[Message:   BepInEx] Preloader finished
[Message:   BepInEx] Chainloader ready
[Message:   BepInEx] Chainloader started
[Info   :   BepInEx] 10 plugins to load
[Info   :   BepInEx] Loading [Advanced_mode 0.0.1]
[Info   :   BepInEx] Loading [Better JetPack 0.1.1]
[Info   :   BepInEx] Loading [Craft From Containers 0.3.0]
[Info   :   BepInEx] Loading [Quick Store 0.3.3]
[Info   :   BepInEx] Loading [Show Next Unlockable Goal 0.1.0]
[Info   :   BepInEx] Loading [Storage Customization 0.3.2]
[Info   :   BepInEx] Loading [PluginFramework 2.1.0]
[Info   :PluginFramework] Plugin Lathrey-PluginFramework is loaded!
[Info   :   BepInEx] Loading [ImprovePerformance 2.5.0]
[Info   :ImprovePerformance] Plugin Lathrey-ImprovePerformance is loaded!
[Info   :   BepInEx] Loading [OreExtractorTweaks 2.1.0]
[Info   :OreExtractorTweaks] Plugin Lathrey-OreExtractorTweaks is loaded!
[Info   :   BepInEx] Loading [RecipeExportImport 2.2.0]
[Info   :RecipeExportImport] Plugin Lathrey-RecipeExportImport is loaded!
[Message:   BepInEx] Chainloader startup complete
[Info   :PluginFramework] Created index of previous group data. Size = 202
[Info   :RecipeExportImport] Logging craftables list to D:\Steam\steamapps\common\The Planet Crafter\BepInEx\plugins\Lathrey-RecipeExportImport\DataFiles\CraftableList.txt
[Info   :RecipeExportImport] Modifying 'PulsarQuartz'
[Info   :RecipeExportImport]    Overriding 'recipeIngredients'
[Info   :RecipeExportImport]    Overriding 'craftableInList'
tommynanny commented 2 years ago

nvm, I manage to make it work by adding "unlockingWorldUnit": 1, for anyone else who wants to modify the craft, here is the sample "RecipesToModifyAndAdd.jsonc" file, place it inside "BepInEx\plugins\Lathrey-RecipeExportImport\DataFiles" ad restart the game :)

{
    "Modifications": {
        "PulsarQuartz": {
            "recipeIngredients": [
                "Alloy",
                "Alloy",
                "Alloy",
                "Alloy",
                "Zeolite",
                "Zeolite",
                "Zeolite",
                "Zeolite"
            ],
            "unlockingWorldUnit": 1,
            "craftableInList": [
                1,
                2,
                3,
                4,
                5,
                6
            ]
        }
    },
    "ItemsToAdd": {},
    "BuildingsToAdd": {}
}
TysonCodes commented 2 years ago

I added the example jsonc file that I ship in the Lathrey-AllPlugins.zip file. You can find it on the master branch here: https://github.com/TysonCodes/PlanetCrafterPlugins/blob/master/RecipeExportImport_Plugin/RecipesToModifyAndAdd.jsonc

It has comments on what to do for modifications or additions.