0 of 0

File information

Last updated

Original upload

Created by

aedenthorn

Uploaded by

aedenthorn

Virus scan

Safe to use

About this mod

Lets you create custom renovations outside of the farmhouse using Content Patcher.

Requirements
Permissions and credits
Donations
This mod is a framework that allows modders to create renovations to any GameLocation outside of the FarmHouse using a single Content Patcher mod.

Renovations will be included in the renovations menu at Robin's store.

Here's a test using debug renovate:



You can download the above renovation mod as a template here.


Creating Renovations

A CP renovation mod needs at least a content.json file and a map file with the renovation tiles.

Here's a sample content.json file:

{
    "Format": "1.23.0",
    "Changes": [
        {
            "Action": "EditData",
            "Target": "Strings/Locations",
            "Entries": {
                "Greenhouse_Renovation_Plots": "Greenhouse Tree Plots/Gives the greenhouse some tree plots./Select an area for the renovation.",
                "Greenhouse_Renovation_Plots_Remove": "Remove Greenhouse Plots/Remove extra tree plots from the greenhouse./Select an area for the renovation."
            }
        },
        {
            "Action": "Load",
            "Target": "Maps/Greenhouse_Renovation",
            "FromFile": "assets/Greenhouse_Renovation.tmx"
        },
        {
            "Action": "EditData",
            "Target": "CustomRenovations",
            "Entries": {
                "greenhouse_renovation": {
                    "gameLocation": "Greenhouse",
                    "mapPath": "Greenhouse_Renovation"
                }
            }
        },
        {
            "Action": "EditData",
            "Target": "Data/HomeRenovations",
            "Entries": {
                "greenhouse_renovation": {
                    "TextStrings": "Strings\\Locations:Greenhouse_Renovation_Plots",
                    "AnimationType": "destroy",
                    "CheckForObstructions": true,
                    "Requirements": [
                        {
                            "Type": "Mod",
                            "Key": "GameLocation",
                            "Value": "Greenhouse"
                        },
                        {
                            "Type": "Mail",
                            "Key": "greenhouse_renovation",
                            "Value": "0"
                        }
                    ],
                    "RenovateActions": [
                        {
                            "Type": "Mail",
                            "Key": "greenhouse_renovation",
                            "Value": "1"
                        }
                    ],
                    "RectGroups": [
                        {
                            "Rects": [
                                {
                                    "X": 4,
                                    "Y": 7,
                                    "Width": 12,
                                    "Height": 3
                                },
                                {
                                    "X": 4,
                                    "Y": 20,
                                    "Width": 12,
                                    "Height": 3
                                },
                                {
                                    "X": 1,
                                    "Y": 9,
                                    "Width": 3,
                                    "Height": 12
                                },
                                {
                                    "X": 16,
                                    "Y": 9,
                                    "Width": 3,
                                    "Height": 12
                                }
                            ]
                        }
                    ],
                    "SpecialRect": null
                },
                "greenhouse_unrenovation": {
                    "TextStrings": "Strings\\Locations:Greenhouse_Renovation_Plots_Remove",
                    "AnimationType": "destroy",
                    "CheckForObstructions": true,
                    "Requirements": [
                        {
                            "Type": "Mod",
                            "Key": "GameLocation",
                            "Value": "Greenhouse"
                        },
                        {
                            "Type": "Mail",
                            "Key": "greenhouse_renovation",
                            "Value": "1"
                        }
                    ],
                    "RenovateActions": [
                        {
                            "Type": "Mail",
                            "Key": "greenhouse_renovation",
                            "Value": "0"
                        }
                    ],
                    "RectGroups": [
                        {
                            "Rects": [
                                {
                                    "X": 4,
                                    "Y": 7,
                                    "Width": 12,
                                    "Height": 3
                                },
                                {
                                    "X": 4,
                                    "Y": 20,
                                    "Width": 12,
                                    "Height": 3
                                },
                                {
                                    "X": 1,
                                    "Y": 9,
                                    "Width": 3,
                                    "Height": 12
                                },
                                {
                                    "X": 16,
                                    "Y": 9,
                                    "Width": 3,
                                    "Height": 12
                                }
                            ]
                        }
                    ],
                    "SpecialRect": null
                }
            }
        }
    ]
}

The above example adds two renovations, one that adds tree plots around the greenhouse and another that removes them.

Strings/Locations entries add the UI text; keys should match the value in the "TextStrings" key of the entry in Data/HomeRenovations

CustomRenovations is the path used by all CP renovation packs to tell this mod about their renovations. "mapPath" is the name of the map under the Maps folder (usually provided by the mod using a Load entry like the one above).  "gameLocation" is the case-sensitive name of the game location to apply the renovation to. You can also provide sourceRect and destRect rectangles in this object, but I'm not quite sure what those do if anything.

Data/HomeRenovations entries follow the syntax for that file, with the exception of adding a new requirement (ignored by the vanilla game) as above. The type should be "Mod", the key should be "GameLocation" and the value is the case-sensitive name of the game location to apply the renovation to.


Technical

Requires SMAPI and Content Patcher, uses Harmony.

Compatible with Mod Updater for automatic updates.

Code is at https://github.com/aedenthorn/StardewValleyMods.

If you want to complain or ask for help or help me test my mods, you can visit my Discord server.