Difference between revisions of "Modding:Modder Guide/Release"

From Stardew Valley Wiki
Jump to navigation Jump to search
(→‎Create the Git repository: remove 'using SMAPI' in suggested description so it applies for content packs too)
(ES link)
 
(17 intermediate revisions by 4 users not shown)
Line 4: Line 4:
  
 
==Prepare the release package==
 
==Prepare the release package==
The 'release package' for a SMAPI mod is just a <tt>.zip</tt> file containing a mod with your compiled files, <tt>manifest.json</tt>, any <tt>i18n</tt> files, etc. The NuGet package will create it for you automatically.
 
  
===Generate package===
+
===For SMAPI mods===
# Edit your mod's <tt>manifest.json</tt> to increase the version.
+
The 'release package' for a SMAPI mod is just a <samp>.zip</samp> file containing a mod with your compiled files, <samp>manifest.json</samp>, any <samp>i18n</samp> files, etc. The NuGet package will create it for you automatically.
 +
 
 +
====Generate package====
 +
# Edit your mod's <samp>manifest.json</samp> to increase the version.  See [http://semver.org/ semantic version] for more information on version numbering.
 
# Click ''Build > Rebuild Solution'' (Visual Studio) or ''Build > Rebuild All'' (MonoDevelop) to make sure the project is compiled.
 
# Click ''Build > Rebuild Solution'' (Visual Studio) or ''Build > Rebuild All'' (MonoDevelop) to make sure the project is compiled.
# Open your mod project's <tt>bin/Debug</tt> or <tt>bin/Release</tt> folder (depending on your build configuration).
+
# Open your mod project's <samp>bin/Debug</samp> or <samp>bin/Release</samp> folder (depending on your build configuration).
# There should be a <tt>.zip</tt> file there for your mod version.
+
# There should be a <samp>.zip</samp> file there for your mod version.
  
That <tt>.zip</tt> file is the release package for your mod, ready to upload.
+
That <samp>.zip</samp> file is the release package for your mod, ready to upload.
  
===Troubleshoot package===
+
====Troubleshoot package====
Here's how to fix common issues with the generated <tt>.zip</tt> file.
+
Here's how to fix common issues with the generated <samp>.zip</samp> file.
  
* The <tt>.zip</tt> file is missing:
+
* The <samp>.zip</samp> file is missing:
** Make sure you're looking at the right folder (either <tt>bin/Debug</tt> or <tt>bin/Release</tt>).
+
** Make sure you're looking at the right folder (either <samp>bin/Debug</samp> or <samp>bin/Release</samp>).
 
** Make sure there are no build errors.
 
** Make sure there are no build errors.
  
Line 28: Line 30:
 
** If it's a mod file: right-click on the file in Visual Studio or MonoDevelop, choose ''Properties'', and change 'Copy to Output Directory' to 'do not copy'.
 
** If it's a mod file: right-click on the file in Visual Studio or MonoDevelop, choose ''Properties'', and change 'Copy to Output Directory' to 'do not copy'.
 
** If it's an assembly reference: right-click on the reference in Visual Studio or MonoDevelop, choose ''Properties'', and change 'Copy Local' or 'Local Copy' to false.
 
** If it's an assembly reference: right-click on the reference in Visual Studio or MonoDevelop, choose ''Properties'', and change 'Copy Local' or 'Local Copy' to false.
 +
 +
===For content pack mods===
 +
The 'release package' for a content pack mod is just a <samp>.zip</samp> file containing a mod with your files, which must include at least a <samp>manifest.json</samp> and a <samp>content.json</samp>.  See the specific guidelines for your framework mod that you are using.
 +
 +
====Create a content pack====
 +
# Create a folder with the name you want (see [[Modding:Content_packs#Folder name|folder naming convention]]).
 +
# Inside the folder:
 +
#* Add a <samp>manifest.json</samp> file with the <samp>ContentPackFor</samp> field (see [[Modding:Modder Guide/APIs/Manifest|manifest format]]).
 +
#* Add the files needed by the mod that will read it. (See the instructions for the mod for which you're creating the content pack.)
 +
# Launch the game, and make sure your new content pack appears under "Loaded X content packs" in the SMAPI console.
 +
 +
====Release your content pack====
 +
# Add an [[Modding:Modder Guide/APIs/Manifest#Update checks|update key]] to your manifest (if you haven't already).
 +
# Update the <samp>Version</samp> field in the manifest. (Increase it for each release! SMAPI will use it for update and compatibility checks.)  See [http://semver.org/ semantic version] for more information on version numbering.
 +
# Create a <samp>.zip</samp> file containing the content pack's folder.
 +
# Upload that file to your chosen release site.  See below guide to sites.
  
 
==Release the mod==
 
==Release the mod==
===Create a mod page===
+
===Using Nexus Mods===
 +
 
 +
====Create a mod page====
 
If you haven't already, create a mod page on [http://www.nexusmods.com/stardewvalley Nexus Mods]. Ideally your mod description should...
 
If you haven't already, create a mod page on [http://www.nexusmods.com/stardewvalley Nexus Mods]. Ideally your mod description should...
 
* explain what the mod does and how to use it;
 
* explain what the mod does and how to use it;
Line 58: Line 78:
 
[size=5]Compatibility[/size]
 
[size=5]Compatibility[/size]
 
[list]
 
[list]
[*]Works with Stardew Valley 1.3 beta on Linux/Mac/Windows.
+
[*]Works with Stardew Valley 1.5.6 on Linux/macOS/Windows.
[*]Works in single player and multiplayer. If there are multiplayer limitations, explain them here.
+
[*]Works in single player, multiplayer, and split-screen mode. If there are multiplayer limitations, explain them here.
 
[/list]
 
[/list]
  
Line 76: Line 96:
 
</ol>
 
</ol>
  
===Add update keys to your manifest===
+
====Add update keys to your manifest====
 
Update keys tell SMAPI where your mod is released, so it can let players know when a new version is available. This requires your mod ID, which is available as soon as you create the mod page (before uploading the mod files). See the [[Modding:Modder Guide/APIs/Manifest#Update checks|update check docs]] for more info.
 
Update keys tell SMAPI where your mod is released, so it can let players know when a new version is available. This requires your mod ID, which is available as soon as you create the mod page (before uploading the mod files). See the [[Modding:Modder Guide/APIs/Manifest#Update checks|update check docs]] for more info.
  
===Upload the mod release===
+
====Upload the mod release====
 
[[File:Modding - Nexus new-file screen.png|thumb|Nexus 'new file' screen.]]
 
[[File:Modding - Nexus new-file screen.png|thumb|Nexus 'new file' screen.]]
  
Line 85: Line 105:
 
# From your mod page, go to ''Manage > Files''.
 
# From your mod page, go to ''Manage > Files''.
 
# Fill in the form:
 
# Fill in the form:
#* 'File name' should have the mod name and version (like <tt>PineapplesEverywhere 1.0</tt>).
+
#* 'File name' should have the mod name and version (like <samp>PineapplesEverywhere 1.0</samp>).
#* 'File version' field should match the version in your <tt>manifest.json</tt>! If it doesn't, players may get incorrect update alerts.
+
#* 'File version' field should match the version in your <samp>manifest.json</samp>! If it doesn't, players may get incorrect update alerts.
 
#* Tick the "this is the latest version" checkbox so players get update alerts.
 
#* Tick the "this is the latest version" checkbox so players get update alerts.
 
#* 'File description' is up to you. You can mention the minimum SMAPI version (if any), what changed, link to release notes, etc.
 
#* 'File description' is up to you. You can mention the minimum SMAPI version (if any), what changed, link to release notes, etc.
# Upload the <tt>.zip</tt> file [[#Prepare the release package|you prepared above]].
+
# Upload the <samp>.zip</samp> file [[#Prepare the release package|you prepared above]].
  
==Go open-source==
+
===Using ModDrop===
===Common questions===
 
; What is 'open source'?
 
: Open source means your mod's code is public and others can change ''a copy of it'' subject to a license you choose. You still have full control of your original code and mod pages; nobody can change those without your approval! However, open source lets others create unofficial updates or publish their own versions.
 
  
; Do I have to go open-source?
+
====Release via webpage====
: No, but it's strongly recommended. Making mods open-source is important for the long-term health of the modding community — when you're away or lose interest, others can still update your mods for the latest versions. 66% of SMAPI mods have source code available, which contributes to over 90% of tracked SMAPI mods being updated after major game updates.
+
<ol>
 +
<li>Go to [https://www.moddrop.com/stardew-valley/ ''ModDrop''] and choose <samp>Upload Your Mod</samp>.</li>
 +
<li>Confirm that the mod is yours to publish to proceed.</li>
 +
<li>Choose <samp>Upload a File from Your Computer</samp>.</li>
 +
<li>Choose a name for your mod and upload the <samp>.zip</samp> file [[#Prepare the release package|you prepared above]]. Page will display a green check next to the mod name if that name is available to use.</li>
 +
<li>Choose the name of the mod file you want to display, the version number, release status (alpha, beta, release), add a description ([[Modding:Modder_Guide/Release#Create_a_mod_page|see the Nexus description tips]]), and optionally add patch notes or notes for yourself.</li>
 +
<li>Upload an image for your mod.</li>
 +
<li>You'll now have a chance to create a more detailed mod page, including links to other pages where your mod can be found.  You may also add more files, images, videos, and notices to be displayed to users.  You can also choose a category for your mod.  If you are uploading on someone else's behalf (with permission), there is also a section to provide credit.</li>
 +
<li>Confirm again that you have permission to upload the mod to publish.  You may cancel out of this page and resume at a later time.</li>
 +
</ol>
  
; What is Git? What's a repository?
+
====Release via app====
: Git is software that helps track changes to your code, and a ''repository'' is a folder containing your mod files plus special files for Git tracking. You don't really need to know how it works at this point; we'll walk you through getting your code up and making changes (and you can look up Git tutorials if you want to dig deeper).
+
<ol>
 
+
<li>Open [https://www.moddrop.com/app/ ''ModDrop app''] and click on your username (top right corner). Choose <samp>Forge</samp>.</li>
; Doesn't this only apply for SMAPI mods?
+
<li>Choose <samp>Publish a new mod</samp>.</li>
: Nope! Although content packs aren't compiled, other modders can't legally make changes without a code license. Note that 'permissions' options on sites like Nexus are legally iffy (e.g. who has copyright on derivatives? Can derivatives be relicensed?), so it's a good idea to have a code license for content packs too. That also lets other modders contribute pull requests and updates.
+
<li>Follow the same steps as listed above for the site.</li>
 
+
</ol>
===First-time setup===
 
This looks like a lot of steps, but don't worry: it's pretty straightforward. If you need help, come ask in [[Modding:Community#Discord|#modding on the Stardew Valley Discord]]. :)
 
 
 
====Create the Git repository====
 
First, let's create the public repository which will contain your code.
 
  
 +
====Sync Nexus mods to ModDrop====
 
<ol>
 
<ol>
<li>Create a [https://github.com/ GitHub] account.</li>
+
<li>Open [https://www.moddrop.com/app/ ''ModDrop app''] and click on your username (top right corner).  Choose <samp>Forge</samp>.</li>
<li>Install [https://www.sourcetreeapp.com/ SourceTree] (Mac/Windows) or [https://www.gitkraken.com/ GitKraken] (Linux). When asked, link it to your GitHub account.</li>
+
<li>Choose <samp>Sync my mods from another site</samp>.</li>
<li>[https://help.github.com/articles/create-a-repo/ Create the repository on GitHub].
+
<li>Follow the prompts to add your Nexus API key.</li>
 
+
<li>Choose <samp>Find new mods to sync</samp> and follow the prompts.</li>
Suggested settings (see [[:File:Modding - create GitHub repo.png|screenshot]]):
+
<li>Confirm that the mod is yours to publish and that ModDrop is allowed to sync updates from your Nexus account.</li>
# Repository name: consider ''StardewMods'' if you'll put all your mods in the same repository, otherwise use the name of your mod.
+
<li>You will receive a confirmation that the request is complete. ModDrop reviews all submissions, so it may take some time for your mod to appear on the app/site.</li>
# Description: consider ''Mods for Stardew Valley.''
 
# Initialize ... with a README: enable this option.
 
# Add <tt>.gitignore</tt>: leave this blank; we'll add our own later.
 
# Add a license: [https://choosealicense.com/ choose a license] (MIT License is a good choice if you're undecided), and select it here.
 
# Click 'Create repository'.
 
</li>
 
<li>On the repository page that appears, click the green "Clone or download" button and copy the URL:<br />[[File:Modding - copy GitHub repo URL.png]]</li>
 
<li>In SourceTree, click ''File > Clone'' and paste the URL. Choose a destination path that's easy to access (like <tt>C:\source\StardewMods</tt>), and click 'Clone'.</li>
 
 
</ol>
 
</ol>
  
That's the hard part done! Now you have a repository on GitHub that's synced with the folder on your computer.
+
====Add update keys to your manifest====
 +
Update keys tell SMAPI where your mod is released, so it can let players know when a new version is available. This requires your mod ID, which can be found after creating the mod page. See the [[Modding:Modder Guide/APIs/Manifest#Update checks|update check docs]] for more info.
  
====Add the mod files====
+
==Go open-source==
Next, let's add your files to the repository.
+
Making your mods open-source is highly recommended; see [[Modding:Open source]] for more info.
 
 
# Open the repository folder (the destination path you entered in step 5 above).
 
# Unzip [https://github.com/StardewModders/Files/raw/master/template%20repo/gitattributes%20and%20gitignore.zip this zip file] into the folder. This will add two files to the root of your folder: <tt>.gitattributes</tt> (which normalises line endings between Linux/Mac/Windows) and <tt>.gitignore</tt> (which hides files which shouldn't be committed from Git). You just need to have them in your folder, you won't need to change them.
 
# Copy your mod files (including the <tt>.sln</tt> file) into the folder.
 
# Commit your changes in SourceTree:
 
## Click Commit at the top.
 
## Click Stage All to add the files to your commit.
 
## Enter a human-readable description for you changes in the textbox. The format is up to you, but "add initial mod files" is fine for now.
 
## Make sure "Push changes immediately" is ticked.
 
## Click "Commit".
 
 
 
That's it: all your files will appear on GitHub. Your mod is now open-source!
 
 
 
===Making changes===
 
The steps above are all first-time setup. When you want to make changes, it's much easier:
 
 
 
# Edit your code in the repository folder.
 
# In SourceTree, commit and push your changes (see step 4 in the previous section).
 
  
{{modding guide footer
+
[[es:Modding:Guía del Modder/Lanzamiento]]
|prev = [[Modding:Modder Guide/Test and Troubleshoot|Test and Troubleshoot]]
 
|next = [[Modding:Modder Guide/Game Fundamentals|Game Fundamentals]]
 
}}
 

Latest revision as of 17:26, 1 February 2022

Creating SMAPI mods SMAPI mascot.png


Modding:Index

Once you're ready to share your mod, it's time to release it!

Prepare the release package

For SMAPI mods

The 'release package' for a SMAPI mod is just a .zip file containing a mod with your compiled files, manifest.json, any i18n files, etc. The NuGet package will create it for you automatically.

Generate package

  1. Edit your mod's manifest.json to increase the version. See semantic version for more information on version numbering.
  2. Click Build > Rebuild Solution (Visual Studio) or Build > Rebuild All (MonoDevelop) to make sure the project is compiled.
  3. Open your mod project's bin/Debug or bin/Release folder (depending on your build configuration).
  4. There should be a .zip file there for your mod version.

That .zip file is the release package for your mod, ready to upload.

Troubleshoot package

Here's how to fix common issues with the generated .zip file.

  • The .zip file is missing:
    • Make sure you're looking at the right folder (either bin/Debug or bin/Release).
    • Make sure there are no build errors.
  • Some mod files aren't in the package:
    • If it's a mod file: right-click on the file in Visual Studio or MonoDevelop, choose Properties, and change 'Copy to Output Directory' to 'copy if newer'.
    • If it's an assembly reference: right-click on the reference in Visual Studio or MonoDevelop, choose Properties, and change 'Copy Local' or 'Local Copy' to true.
  • Some mod files that shouldn't be in the package are included:
    • If it's a mod file: right-click on the file in Visual Studio or MonoDevelop, choose Properties, and change 'Copy to Output Directory' to 'do not copy'.
    • If it's an assembly reference: right-click on the reference in Visual Studio or MonoDevelop, choose Properties, and change 'Copy Local' or 'Local Copy' to false.

For content pack mods

The 'release package' for a content pack mod is just a .zip file containing a mod with your files, which must include at least a manifest.json and a content.json. See the specific guidelines for your framework mod that you are using.

Create a content pack

  1. Create a folder with the name you want (see folder naming convention).
  2. Inside the folder:
    • Add a manifest.json file with the ContentPackFor field (see manifest format).
    • Add the files needed by the mod that will read it. (See the instructions for the mod for which you're creating the content pack.)
  3. Launch the game, and make sure your new content pack appears under "Loaded X content packs" in the SMAPI console.

Release your content pack

  1. Add an update key to your manifest (if you haven't already).
  2. Update the Version field in the manifest. (Increase it for each release! SMAPI will use it for update and compatibility checks.) See semantic version for more information on version numbering.
  3. Create a .zip file containing the content pack's folder.
  4. Upload that file to your chosen release site. See below guide to sites.

Release the mod

Using Nexus Mods

Create a mod page

If you haven't already, create a mod page on Nexus Mods. Ideally your mod description should...

  • explain what the mod does and how to use it;
  • provide clear install steps;
  • explain which version of the game it works with;
  • say whether it works in multiplayer (and list any multiplayer limitations);
  • link to release notes, source code, discussion thread, etc if applicable.

Here's a recommended template for the mod description:

  1. Click the "[BBCODE]" button above the mod description on Nexus. This will switch to raw text mode.
  2. Paste this template in:
    This mod adds pineapples everywhere in the game. Replace this line with a few sentences explaining your mod.
    
    [size=5]Install[/size]
    [list=1]
    [*][url=https://smapi.io]Install the latest version of SMAPI[/url].
    [*]Download this mod and unzip it into [font=Courier New]Stardew Valley/Mods[/font].
    [*]Run the game using SMAPI.
    [/list]
    
    [size=5]How to use[/size]
    Provide a few sentences explaining how to use your mod. For example, the default buttons to press, where to find a menu, etc. You can remove this section if it's self-evident.
    
    [size=5]Compatibility[/size]
    [list]
    [*]Works with Stardew Valley 1.5.6 on Linux/macOS/Windows.
    [*]Works in single player, multiplayer, and split-screen mode. If there are multiplayer limitations, explain them here.
    [/list]
    
    [size=5]See also[/size]
    Add links below for your mod, and remove any that don't apply. Don't forget to remove this sentence.
    
    [list]
    [*]Official discussion thread
    [*]Release notes
    [*]Source code
    [/list]
    
  3. Click the "[BBCODE]" button to switch back to the formatted view.
  4. Edit the template for your mod.

Add update keys to your manifest

Update keys tell SMAPI where your mod is released, so it can let players know when a new version is available. This requires your mod ID, which is available as soon as you create the mod page (before uploading the mod files). See the update check docs for more info.

Upload the mod release

Nexus 'new file' screen.

To upload a file to Nexus:

  1. From your mod page, go to Manage > Files.
  2. Fill in the form:
    • 'File name' should have the mod name and version (like PineapplesEverywhere 1.0).
    • 'File version' field should match the version in your manifest.json! If it doesn't, players may get incorrect update alerts.
    • Tick the "this is the latest version" checkbox so players get update alerts.
    • 'File description' is up to you. You can mention the minimum SMAPI version (if any), what changed, link to release notes, etc.
  3. Upload the .zip file you prepared above.

Using ModDrop

Release via webpage

  1. Go to ModDrop and choose Upload Your Mod.
  2. Confirm that the mod is yours to publish to proceed.
  3. Choose Upload a File from Your Computer.
  4. Choose a name for your mod and upload the .zip file you prepared above. Page will display a green check next to the mod name if that name is available to use.
  5. Choose the name of the mod file you want to display, the version number, release status (alpha, beta, release), add a description (see the Nexus description tips), and optionally add patch notes or notes for yourself.
  6. Upload an image for your mod.
  7. You'll now have a chance to create a more detailed mod page, including links to other pages where your mod can be found. You may also add more files, images, videos, and notices to be displayed to users. You can also choose a category for your mod. If you are uploading on someone else's behalf (with permission), there is also a section to provide credit.
  8. Confirm again that you have permission to upload the mod to publish. You may cancel out of this page and resume at a later time.

Release via app

  1. Open ModDrop app and click on your username (top right corner). Choose Forge.
  2. Choose Publish a new mod.
  3. Follow the same steps as listed above for the site.

Sync Nexus mods to ModDrop

  1. Open ModDrop app and click on your username (top right corner). Choose Forge.
  2. Choose Sync my mods from another site.
  3. Follow the prompts to add your Nexus API key.
  4. Choose Find new mods to sync and follow the prompts.
  5. Confirm that the mod is yours to publish and that ModDrop is allowed to sync updates from your Nexus account.
  6. You will receive a confirmation that the request is complete. ModDrop reviews all submissions, so it may take some time for your mod to appear on the app/site.

Add update keys to your manifest

Update keys tell SMAPI where your mod is released, so it can let players know when a new version is available. This requires your mod ID, which can be found after creating the mod page. See the update check docs for more info.

Go open-source

Making your mods open-source is highly recommended; see Modding:Open source for more info.