Tutorial: Making a Mod When There's No Tutorial

From The Stardew Modding Wiki
Jump to navigation Jump to search

The wiki aims to demystify the process of making mods for Stardew Valley, but even if enough time has gone by since this writing that the Tutorials:Index page is filled with hundreds of links, you will eventually come up with an idea for which no tutorial exists. What do?

Future infobox info: CopperSun, May 1 2021

Finding an Example[edit | edit source | hide | hide all]

  1. First, see if you can find any existing mod that is similar to your idea. There are so many mods now on NexusMods and ModDrop odds are good at least one of them does something similar to what you want to do.
    1. A "similar" mod here is one that does a similar kind of thing, not necessarily a mod that edits the same thing. For example, if you want to change the appearance of Alex's house and find a mod that changes Haley's house, that mod will be more useful for you to look at than a mod that moves Alex's house to the beach.
  2. Download the similar mod(s) and extract the contents somewhere. You don't have to put them in your Stardew Valley\Mods folder if you don't want to, though it can help to see how they work by running the game with them installed.
  3. What's in the folder?

If the mod uses json files[edit | edit source | hide]

  1. If the mod contains json files, like content.json or shops.json, you can easily open them in a text editor (I suggest Notepad++) and see how they work.
  2. A json file is a fancy text file that can be read by a framework. A framework is a kind of mod that does all the code for you - very handy! You just have to provide a few specifics, like the name of a shop to be edited or what dialogue you want to change.
  3. If you're not sure which framework(s) is being used by the mod, just check the requirements section on NexusMods or wherever you got it from.
  4. Once you know what kind of framework you're dealing with, you can look up the documentation for it. It's easiest to do this by going to the NexusMods page for that framework and reading the description. Somewhere will be a link to where you can learn all about how to use it.
  5. With a framework in mind, like Category:Content Patcher or Category:Json Assets, it becomes easier to look up more examples. Just go back to good ol' NexusMods and click requirements again, this time to look at the (probably long) list of mods that use the framework. Download any more you can find that might be good examples.
  6. Continue reading in section When and Where to Ask For Help.

If the mod uses dll files[edit | edit source | hide]

  1. If the mod contains a .dll file, that's going to be a little harder to investigate. A dll and/or a pdb file means code needed to be written for the mod (as opposed to json files which rely on frameworks that handle the code for you). These mods are often written using Harmony.
    1. If you have never coded anything before in your life, I highly suggest starting with a simpler mod than whatever really cool idea you have in mind. It might be less interesting, but it's a good idea to learn how to make a simple mod run correctly than spend hours/days/weeks trying to learn C# at the same time you're trying to decipher Stardew Valley's sometimes-arcane code structure and running into all sorts of new and interesting problems.
      1. But if you're really, really determined to make your very first project a coding/Harmony mod, start with a beginners C# tutorial before you try and implement your mod. It will help if you understand things like includes and methods.
    2. If you have coded before, preferably in C# or a similar object-oriented language like Java, then go ahead and open up that dll in Visual Studio and take a look.
  2. If you're going to make your mod using Harmony, you want to absolutely devour the documentation for Stardew Valley's code on the official wiki. There's a lot of great information there that has been carefully documented so you can create the mod of your dreams.

When and Where to Ask for Help[edit | edit source | hide]

  1. You are almost certain to get stuck while making your mod, no matter how easy it seems like it should be or how much debugging you do. When this happens, ask for help. SDV modders are very kind and very helpful, and they will not laugh at you when it turns out you missed a comma and that's why your entire mod has been failing because that exact situation has happened to literally everyone.
  2. As of this writing, the best place to ask for modding help is on the Stardew Valley Discord. Make sure you explain both your mod idea and what problem(s) you're having. If they don't know the answer, they'll almost certainly be able to point you at someone else who does, or offer suggestions for you to try.
  3. You can also try Reddit or the other places listed in Modding:Community on the official wiki.

After You've Succeeded[edit | edit source | hide]

It's done! You've made the mod of your dreams, and you did it without anyone leading you step by step. Now that you've blazed the trail, why not show it to others so they can make mods of their own? Pay forward the helpfulness of the Stardew Valley modding community. :)

To make a tutorial, you don't need to know "wiki style" or even how to write very well. (In fact, you don't need to know how to write at all if you make your tutorial a video.) Just create a new page on this wiki, call it "Tutorial: How to do this thing," and start dropping advice, link to a video or blog post, or otherwise share what you learned. That's it!