Modding:Player Guide

From Stardew Valley Wiki
Revision as of 01:52, 8 January 2018 by Pathoschild (talk | contribs) (→‎Fix common error messages: + InvalidOperationException: This resource could not be created)
Jump to navigation Jump to search

Index

Do you want to play Stardew Valley with mods? This page is for you!

Intro

What are mods?

A mod is just a package of files which changes Stardew Valley in some way. Mods can add features (like showing NPCs on the map), change game mechanics (like making fences decay more slowly), make cosmetic changes (like making your house look like a hobbit home), and more.

There are generally two types of mods:

  • SMAPI mods use SMAPI (a modding API) to run code within the game. These mods are powerful and convenient. After installing SMAPI, you can install mods by dropping them into a folder and uninstall them by deleting their folder. You can use multiple SMAPI mods, and they'll rarely conflict. Ideally you would only use SMAPI mods.
  • XNB mods replace the game's data files (which have an .xnb extension, thus the name). These are harder to manage (you'll need to keep track of which files you overwrote and keep backups), and you can't use two mods that change the same files. These are often used to change images in the game, since they don't require any programming knowledge.

If you're just starting out, you should avoid XNB mods. It's easier for something to go wrong with those, and harder to fix when it does. However, you can use XNB and SMAPI mods together.

What is SMAPI?

SMAPI is a modding API — it launches the game with mod support and lets mods interact directly with the game code. It's safely installed alongside your normal game, and you can uninstall it anytime.

Can I use mods on Linux, Mac, Windows, or consoles?

Mod support for each platform:

Platform Mod support
Linux ✓ fully supported
Mac ✓ fully supported
Windows ✓ fully supported
Nintendo Switch ✖ no mod support
PS4 ✖ no mod support
XBox One ✖ no mod support

Almost all mods will work on any supported platform, since SMAPI rewrites them for compatibility.

Can mods corrupt my save?

Yes, but it's extremely rare. Only a few mods affect your save file at all (including GetDressed, Makeshift Multiplayer, and Save Anywhere). If you avoid those, mods are very unlikely to corrupt your save file. If you're worried, just back up your save files occasionally. That's strongly recommended even if you don't use mods, since save corruption is almost always caused by the game itself.

In most cases, you can fix save corruption by undoing the last save.

Can I stop using mods later?

Yep. With a few exceptions (see previous question), mods don't directly affect your save file so you can stop using them anytime.

Do mods disable Steam achievements?

Steam achievements work fine, as long as you launch SMAPI through Steam. Make sure you follow the install instructions to configure Steam on Windows (no Steam changes needed on Linux or Mac). If the Steam overlay works, the achievements should work too.

Using mods

Install SMAPI

Before you can use most mods, you need to install the SMAPI mod loader:

Find mods

If you're looking for mods, the most popular are a good place to start; see also this list of mod recommendations for a first playthrough.

You can find mods in a few places:

site description
Nexus Mods Most mods are released here.
(Registering an account is free, just don't choose a package when you register.)
Chucklefish mods Some mods are released here (most are also on Nexus).
ModDrop Pretty new. Not many mods yet, but you can install those it has very quickly through their (Windows-only) client.
Stardew Valley forums Some mods are posted directly in the forums. Some hidden gems are only here, but finding them can be a challenge.

Before you download a mod...

  • Does it work with the latest version of the game? (SMAPI will automatically disable most incompatible SMAPI mods, but you're on your own with XNB mods. Try checking the mod description or comments.)
  • Don't download from stardewvalleymods.net. (Mods here are usually outdated, since the site republishes mods without permission for ad revenue.)

Add or remove mods

To install a mod, just unzip it into the Mods folder inside your game folder. Make sure each mod has its own subfolder; for example, if you have a PineapplesEverywhere mod, you should have a file structure like this:

Stardew Valley/
   Mods/
      PineapplesEverywhere/
         PineapplesEverywhere.dll
         manifest.json

To uninstall a mod, just remove it from the Mods folder.

Configure mods

Some mods have a config.json file in their mod folder. It might be created the first time you launch the game with that mod. This file lets you customise the mod settings.

To edit the config.json file, just open it in a text editor. Make sure the game isn't running when you edit it, or your changes might not take effect. See a basic guide to JSON; basically make sure your values are surrounded by quotes (like "value"). You can use this JSON validator to make sure the format is correct.

Finding the game files

Save files

See Saves.

Game folder

The "game folder" is the folder that contains the Stardew Valley.exe (Windows) or StardewValley.exe (Linux/Mac) file. Here's how to find it:

  1. Check the default location:
    Platform Path
    Windows GOG: C:\Program Files (x86)\GalaxyClient\Games\Stardew Valley
    Steam: C:\Program Files (x86)\Steam\steamapps\common\Stardew Valley
    Linux GOG: ~/GOG Games/Stardew Valley/game
    Steam: ~/.local/share/Steam/steamapps/common/Stardew Valley
    Mac GOG: /Applications/Stardew Valley.app/Contents/MacOS
    Steam: ~/Library/Application Support/Steam/steamapps/common/Stardew Valley/Contents/MacOS
  2. If your game wasn't there, try this:
    • If you have the GOG version:
      1. Open the GOG Galaxy client.
      2. In the game sidebar, right-click on Stardew Valley.
      3. Choose Manage Installation > Show Folder to open the game folder.
    • If you have the Steam version:
      1. Open the Steam client.
      2. Right-click on Stardew Valley.
      3. Click Properties.
      4. Click the Local Files tab.
      5. Click the Browse Local Files... button to open the game folder.

SMAPI log

The SMAPI log has useful info for troubleshooting problems (like your versions, mods, game path, errors, etc).

Here's how to share it:

  1. Find the log file here:
    Platform Path
    Windows %appdata%\StardewValley\ErrorLogs\SMAPI-latest.txt
    (Paste "%appdata%" into the address bar, Windows knows where it is.)
    Linux ~/.config/StardewValley/ErrorLogs/SMAPI-latest.txt
    (The folder is hidden by default. From Files, click Go » Enter Location and enter "~/.config".)
    Mac ~/.config/StardewValley/ErrorLogs/SMAPI-latest.txt
    (The folder is hidden by default. From Finder, click Go » Go to Folder and enter "~/.config".)
  2. Upload the file to log.smapi.io and share the link.

Troubleshooting

Fix common error messages

"Oops! SMAPI can't find the game."
  • Make sure you're running StardewModdingAPI.exe in your game folder (see the install instructions).
  • Did you install SMAPI manually (not using install.exe)? Make sure you copied the right files: internal/Windows for Windows, or internal/Mono for Linux/Mac.
"Oops! SMAPI doesn't seem to be compatible with your game."
Make sure you have Stardew Valley 1.2.30 or later.
"Skipped '...' because it doesn't have a manifest.json"
SMAPI couldn't find the manifest.json file for the mod in that folder. That usually means it's not a SMAPI mod, so it won't work from the Mods folder. See that mod's documentation for install instructions.
"InvalidOperationException: This resource could not be created"
This usually means you have no speakers or headphones plugged in, which the game can't handle. Make sure you plug in an audio device (but it can be muted).
"SEHException: External component has thrown an exception"
The game crashed while preparing its audio, usually due to computer usage during the audio startup. This isn't caused by SMAPI directly, though SMAPI uses some extra resources during startup.
Common solutions:
  • Make sure your audio is plugged in (e.g. speakers or headphones).
  • Restart your computer.
  • Close your browsers and any open apps before playing. (You can reopen them once the game is started.)
  • Remove any mods that change the game's audio (e.g. mods which add more music).

SMAPI files disappear or your antivirus complains

Your antivirus might remove or complain about some SMAPI files. This is based on heuristic detection — SMAPI rewrites mods so they work on your computer, and rewriting files is something malware also does, so your antivirus got suspicious. SMAPI doesn't have a trojan — you can check by reading the code, decompiling the download, or uploading it to VirusTotal. You just need to tell your antivirus that SMAPI is okay; try searching online for your antivirus name with the words "add exception" to find instructions.

Check your versions

  1. Make sure you have the latest version of SMAPI.
    The SMAPI version is shown at the top of the SMAPI console window.
  2. Make sure you have Stardew Valley 1.2.30 or later.
    Click the "?" button on the title screen, and the version will appear in the bottom-left.

Reset your content files

Many problems are caused by broken files in the game's Content folder (especially if you use XNB mods). You can reset your game files to fix that.

Option 1: reset all files (recommended)
  1. See instructions for Steam or for GOG Galaxy. Any XNB mods will be removed, but SMAPI mods won't be affected.
  2. If you use SMAPI on Linux/Mac, reinstall SMAPI to fix the launcher.
Option 2: create retroactive backup to reset any file
If you installed XNB mods and want to reset one file you know is broken, you can just restore the original file. If you forgot to back it up, here's how to recover the original files without losing your modded ones:
  1. Copy your game's Content folder to Content-modded.
  2. Reset your game files (see instructions for Steam or for GOG Galaxy).
  3. Copy your (now reset) Content folder to Content-backup.
  4. Move Content-modded back to Content.
Now your content files are still modded, but you have a backup of the original files.
Option 3: troubleshoot XNB mods
If you installed XNB mods, you're not sure which caused the problem, and you don't want to remove all your XNB mods, here's how to figure out which one is causing the problem.
  1. Back up any XNB mods you want to keep.
  2. Reset your game files (see instructions for Steam or for GOG Galaxy). Any XNB mods will be removed, but SMAPI mods won't be affected.
  3. If you use SMAPI on Linux/Mac, reinstall SMAPI to fix the launcher.
  4. Launch the game to see if the problem is fixed.
  5. Reinstall your XNB mods one at a time. After each install, test the game to make sure the mod doesn't cause problems.

Other problems

Run the game without SMAPI by launching Stardew Valley.exe (on Windows) or StardewValley-original (on Linux/Mac) in your game folder.

Asking for help

Find help

For help with a mod, the mod author is the best person to ask. These are the best ways to contact them:

  1. the discussion thread linked to on the mod page (if any);
  2. the 'bugs' section on the Nexus mod page (if any);
  3. otherwise contact the author directly (e.g. use the 'Contact' button on the Nexus mod page).

For help with SMAPI, or if you can't ask the mod author, post in this thread or ask the community.

What to include in a bug report

Figuring out why something went wrong for someone else can be tough, so it helps if you include as much information as possible. Here's the most useful information you can give.

  1. Describe your problem:
    • Which mod has an issue?
    • What is the problem? Be as descriptive as possible. (Does the game freeze or close? Does the screen go black? Does nothing at all happen?)
    • What were you doing when it broke? Did you notice a pattern? For example, maybe it always breaks when you do a certain thing.
  2. Describe your context:
    • Do you use a mod manager? If so, which one?
    • Do you play on Linux, Mac, or Windows?
  3. Cause the problem again (so any details are in the log), then attach a copy of the latest log file (see next section).