Stardew Valley

File information

Last updated

Original upload

Created by

aedenthorn

Uploaded by

aedenthorn

Virus scan

Safe to use

Tags for this mod

About this mod

Hitches a traveling cart to your horse that you can enter, decorate, store things, and even sleep in. You can also unhitch it and leave it in any persistent map.

Requirements
Permissions and credits
Changelogs
Donations
This mod adds a customizable cart to horses with a customizable interior you can enter, decorate, store things, and even sleep in!

By default, the cart looks like that of the Traveling Merchant, and the interior is a 3x12 decoratable location that allows you to place all kinds of furniture including beds.





To ride in the cart, mount your horse as usual. To enter the cart, you must be already riding and then click on the cart body.

You can also detach the cart from the horse to park it in a specific location by pressing the hitch button while riding (default Backspace). To reattach the cart, move the horse into the cart's hitch area and press the hitch button again.

To use this mod with the default cart, you do not need a Content Patcher content pack, but I have included a content pack in the Optional Files that you can install and modify to customize the cart as you like, or use as a template to make your own content pack.

If multiple content packs are installed, they must have unique dictionary keys. To cycle between carts, use the Page Up and Page Down keys while riding in the cart.

This mod theoretically works in multiplayer. Probably it has bugs.


Customization

The mod checks for Content Patcher entries to its dictionary. An example content.json looks like this:

{
    "Format": "1.23.0",
    "Changes": [
        {
            "Action": "EditData",
            "Target": "aedenthorn.PersonalTravellingCart/dictionary",
            "Entries": {
                "PTCAedenthornCP": {
                    "mapPath": "aedenthorn.PTCAedenthornCP/map",
                    "spriteSheetPath": "aedenthorn.PTCAedenthornCP/cart",
                    "entryTile": {
                        "X": 6,
                        "Y": 6
                    },
                    "left": {
                        "backRect": {
                            "X": 0,
                            "Y": 0,
                            "Width": 128,
                            "Height": 128
                        },
                        "frontRect": {
                            "X": 0,
                            "Y": 128,
                            "Width": 128,
                            "Height": 128
                        },
                        "clickRect": {
                            "X": 17,
                            "Y": 26,
                            "Width": 95,
                            "Height": 57
                        },
                        "hitchRect": {
                            "X": 0,
                            "Y": 63,
                            "Width": 19,
                            "Height": 13
                        },
                        "cartOffset": "40, -296",
                        "playerOffset": "-74, -20",
                        "frames": 2,
                        "framerate": 64
                    },
                    "right": {
                        "backRect": {
                            "X": 0,
                            "Y": 256,
                            "Width": 128,
                            "Height": 128
                        },
                        "frontRect": {
                            "X": 0,
                            "Y": 384,
                            "Width": 128,
                            "Height": 128
                        },
                        "clickRect": {
                            "X": 17,
                            "Y": 26,
                            "Width": 95,
                            "Height": 57
                        },
                        "hitchRect": {
                            "X": 110,
                            "Y": 63,
                            "Width": 19,
                            "Height": 13
                        },
                        "cartOffset": "-444, -296",
                        "playerOffset": "73, -20",
                        "frames": 2,
                        "framerate": 64
                    },
                    "up": {
                        "backRect": {
                            "X": 0,
                            "Y": 512,
                            "Width": 128,
                            "Height": 128
                        },
                        "frontRect": {
                            "X": 0,
                            "Y": 640,
                            "Width": 128,
                            "Height": 128
                        },
                        "clickRect": {
                            "X": 42,
                            "Y": 27,
                            "Width": 44,
                            "Height": 87
                        },
                        "hitchRect": {
                            "X": 52,
                            "Y": 0,
                            "Width": 23,
                            "Height": 27
                        },
                        "cartOffset": "-204, -60",
                        "playerOffset": "0, -320",
                        "frames": 0
                    },
                    "down": {
                        "backRect": {
                            "X": 0,
                            "Y": 768,
                            "Width": 128,
                            "Height": 128
                        },
                        "frontRect": {
                            "X": 0,
                            "Y": 896,
                            "Width": 128,
                            "Height": 128
                        },
                        "clickRect": {
                            "X": 42,
                            "Y": 14,
                            "Width": 44,
                            "Height": 87
                        },
                        "hitchRect": {
                            "X": 52,
                            "Y": 229,
                            "Width": 23,
                            "Height": 27
                        },
                        "cartOffset": "-204, -472",
                        "playerOffset": "0, 192",
                        "frames": 0
                    }
                }
            }
        },
        {
            "Action": "Load",
            "Target": "aedenthorn.PTCAedenthornCP/cart",
            "FromFile": "assets/cart.png"
        },
        {
            "Action": "Load",
            "Target": "aedenthorn.PTCAedenthornCP/map",
            "FromFile": "assets/Cart.tmx"
        }
    ]
}

Each dictionary value is an object with the following keys:

  • mapPath - fake path to the map for Content Patcher
  • spriteSheetPath - fake path to the spritesheet for Content Patcher
  • entryTile - the tile of the interior to warp to
  • left - see below
  • right - see below
  • up - see below
  • down - see below

The four directions provide data for drawing the cart and farmer depending on which direction they are facing.

  • backRect - the part of the spritesheet to draw behind the farmer and horse
  • frontRect - the part of the sprite sheet to draw in front of the farmer and horse
  • clickRect - the part of the above rectangles to use for clicking to entering the cart interior
  • cartOffset - pixel offset to draw the cart
  • playerOffset - pixel offset to draw the farmer
  • frames - for animated sprites, frames should be horizontally tiled (set to 0 for unanimated sprites)
  • framerate - movement required to switch frame (higher is slower)

If you turn on Debug in the config, you can manually adjust the cart and player offsets in-game using the arrow keys while riding in the cart. Hold down shift to move the farmer, and hold down alt to move quicker. To get the coordinates for modified offsets, press F7 to save to a JSON file in the mod's assets folder. Press F5 to reload data from that file. You can copy data from that file to your content pack to make the changes permanent.


Technical

Requires SMAPI, uses Harmony.

Implements a Generic Mod Config Menu interface to change config settings in-game.

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.