Stardew Valley
0 of 0

File information

Last updated

Original upload

Created by

aedenthorn

Uploaded by

aedenthorn

Virus scan

Safe to use

About this mod

Allows you to customize the location and tiles used for the outdoor spouse area for any vanilla or custom NPC using content packs.

Requirements
Permissions and credits
Changelogs
Notice: this mod is now obsolete, please use Custom Spouse Patio Redux instead.


This mod was originally part of Multiple Spouses, but it seems like it will be useful generally for any spouse, so I am moving it into this new mod (and making it better along the way!).

This mod is a simple framework. It doesn't do anything by itself; you will have to create and install a content pack for it. Either that or bug your custom NPC spouse's creator to create a custom spouse patio content pack for their NPC.

There is now a Custom Spouse Patio Wizard that will allow you to create simple spouse patios without any knowledge of JSON. Install it as well as this mod, and follow the instructions on that mod page. The wizard will not allow you to make advanced customization, but once you've set up simple tilesheets with it, you can edit the json file after to tweak it as you like.

NOTE: If you want help with this mod, please visit my Discord server. I can't help you in the Nexus posts, it's too awkward.

Simple Usage

For a single vanilla spouse, you can adapt the example content pack in the Files tab. Install this mod, install the content pack, then edit the content pack's content.json file, which looks like this:



{
    "areas": {
        "Emily": {
            location:
            {
                "X": 69,
                "Y": 7
            },
            "useDefaultTiles": true,
            "useTilesOf": "Emily"
        }
    }
}



This tells the mod to create a spouse area for Emily at tile 73,11, using her default patio area tiles. Just change the name and location coordinates to fit your spouse.

useTilesOf is an optional key that lets you specify a different set of default tiles to use. Just change this to some other VANILLA spouse's name.

Vanilla spouse areas are 3x3 tiles, and "location" refers to the top left tile.

You can also specify a custom NPC offset; you will have to do this for custom NPCs - vanilla spouses have default locations within the spouse area, but you can override them as well. Use npcOffset with X and Y values, just like location (see the example with Sophia below).

To find tile coordinates, you can use Debug Mode. You can check your json at https://smapi.io/json


Advanced Usage

For a more complex example, allowing for custom tiles, custom tile sheets, and multiple spouse patio areas take a look at the example content pack's content_complex.json (replace the content.json with it or just copy the contents over). That file has spouse areas for multiple spouses, including Sophia, and loads a custom tile sheet from a png:

{
    "areas": {
        "Emily": {
            "location": {
                "X": 73,
                "Y": 11
            },
            "useDefaultTiles": true,
            "useTilesOf": "Emily"
        },
        "Haley": {
            "location": {
                "X": 74,
                "Y": 7
            },
            "useDefaultTiles": true,
            "useTilesOf": "Haley"
        },
        "Sophia": {
            "location": {
                "X": 77,
                "Y": 11
            },
            "useDefaultTiles": false,
            "specialTiles": [
                {
                    "location": {
                        "X": 77,
                        "Y": 12
                    },
                    "layer": "Front",
                    "tilesheet": "CustomTileSheet",
                    "tileIndex": 0
                },
                {
                    "location": {
                        "X": 77,
                        "Y": 13
                    },
                    "layer": "Buildings",
                    "tilesheet": "CustomTileSheet",
                    "tileIndex": 4
                },
                {
                    "location": {
                        "X": 78,
                        "Y": 13
                    },
                    "layer": "Buildings",
                    "tilesheet": "CustomTileSheet",
                    "tileIndex": 6
                },
                {
                    "location": {
                        "X": 79,
                        "Y": 13
                    },
                    "layer": "Buildings",
                    "tilesheet": "CustomTileSheet",
                    "tileIndex": 7
                },
                {
                    "location": {
                        "X": 80,
                        "Y": 12
                    },
                    "layer": "Front",
                    "tilesheet": "CustomTileSheet",
                    "tileIndex": 1
                },
                {
                    "location": {
                        "X": 80,
                        "Y": 13
                    },
                    "layer": "Buildings",
                    "tilesheet": "CustomTileSheet",
                    "tileIndex": 5
                }
            ],
            "npcOffset": {
                "X": 1,
                "Y": 2
            },
            "npcAnimation": "Sophia_Farm1"
        }
    },
    "tileSheetsToAdd": {
        "CustomTileSheet": {
            "path": "assets/custom_tile_sheet.png",
            "width": 4,
            "height": 2,
            "tileWidth": 16,
            "tileHeight": 16
        }
    }
}


This tells the mod to do the following for Sophia:

  • create her spouse area at 77,11
  • don't use default tiles for her spouse area (she doesn't have any anyway),
  • add a list of special tiles at the given coordinates, on the given layer, using the given tile sheet name (see Custom Tile Sheets below)
  • place Sophia at an offset from 77,11 of 1,2 (i.e. at 78,13)
  • play an animation from the animations list called "Sophia_Farm1" (this is an animation provided by SVE).

Spouse areas will only show for NPCs married to the farmer, so there is no harm in creating a content pack for your NPC, in case the player marries them.


Custom Tile Sheets

The above example also adds a custom tile sheet called "CustomTileSheet" from a custom png included in the content pack, allowing the addition of custom tile graphics.

Custom tile sheets need to specify width and height in tiles, so this tile sheet is 64 pixes (4 x 16) wide and 32 pixels (2 x 16) tall. To refer to a tile index in a custom tile, count from left to right, starting at 0. So the tile indexes in the example tilesheet are:

0 1 2 3
4 5 6 7

You can take a look at the png file in the example content pack and compare it to Sophia's spouse area in the fall screenshot to understand more clearly.

You can also use the {season} tag in your tilesheet's path, e.g.

"path": "assets/custom_tile_sheet_{season}.png",

and then use four separate png files for the four seasons, i.e.:

assets/custom_tile_sheet_spring.png
assets/custom_tile_sheet_summer.png
assets/custom_tile_sheet_fall.png
assets/custom_tile_sheet_winter.png


If you are using Multiple Spouses, please use this mod as well, as I have removed this functionality from that mod in the latest version.


Technical:

Requires SMAPI, 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.

A list of all my mods for Stardew Valley is available at https://www.nexusmods.com/stardewvalley/articles/895.