Difference between revisions of "Modding:Content packs"

From Stardew Valley Wiki
Jump to navigation Jump to search
m (Add zh link)
m (Added BusLocations, [BL] to the List.)
Line 3: Line 3:
 
A '''content pack''' is a collection of files loaded by a specific [[Modding:Content pack frameworks|content pack framework]] (essentially a sub-mod). Content packs can contain any files, but usually consist of JSON files and images.
 
A '''content pack''' is a collection of files loaded by a specific [[Modding:Content pack frameworks|content pack framework]] (essentially a sub-mod). Content packs can contain any files, but usually consist of JSON files and images.
  
==For players==
+
== For Players ==
 
If you want to use a content pack, install it just like a SMAPI mod (see [[Modding:Player Guide/Getting Started|player guide]]). Make sure you install the mod it needs too.
 
If you want to use a content pack, install it just like a SMAPI mod (see [[Modding:Player Guide/Getting Started|player guide]]). Make sure you install the mod it needs too.
  
==For modders==
+
== For Modders ==
===Create a content pack===
+
=== Creating a Content Pack ===
 
# Decide which [[Modding:Content pack frameworks|content pack framework]] you'll use (each framework defines the particular files you need).
 
# Decide which [[Modding:Content pack frameworks|content pack framework]] you'll use (each framework defines the particular files you need).
 
# [[Modding:Player Guide/Getting Started#Getting started|Install SMAPI]].
 
# [[Modding:Player Guide/Getting Started#Getting started|Install SMAPI]].
Line 17: Line 17:
 
# Launch the game, and make sure your new content pack appears under "Loaded X content packs" in the SMAPI console.
 
# Launch the game, and make sure your new content pack appears under "Loaded X content packs" in the SMAPI console.
  
===Release your content pack===
+
=== Releasing Your Content Packs ===
 
# Add an [[Modding:Modder Guide/APIs/Manifest#Update checks|update key]] to your manifest (if you haven't already).
 
# Add an [[Modding:Modder Guide/APIs/Manifest#Update checks|update key]] to your manifest (if you haven't already).
 
# Update the <tt>Version</tt> field in the manifest. (Increase it for each release! SMAPI will use it for update and compatibility checks.)
 
# Update the <tt>Version</tt> field in the manifest. (Increase it for each release! SMAPI will use it for update and compatibility checks.)
Line 50: Line 50:
 
|-
 
|-
 
| <code>[AHM]</code>
 
| <code>[AHM]</code>
| {{nexus mod|1538|Animal Husbandry Mod}}
+
| {{Nexus mod|1538|Animal Husbandry Mod}}
 
|-
 
|-
 
| <code>[BAGI]</code>
 
| <code>[BAGI]</code>
| {{nexus mod|2080|Better Artisan Goods Icons}}
+
| {{Nexus mod|2080|Better Artisan Goods Icons}}
 
|-
 
|-
 
| <code>[BFAV]</code>
 
| <code>[BFAV]</code>
| {{nexus mod|3296|Better Farm Animal Variety}}
+
| {{Nexus mod|3296|Better Farm Animal Variety}}
 +
|-
 +
| <code>[BL]</code>
 +
| {{Nexus Mod|2905|Bus Locations}}
 
|-
 
|-
 
| <code>[CF]</code>
 
| <code>[CF]</code>
| {{nexus mod|1254|Custom Furniture}}
+
| {{Nexus mod|1254|Custom Furniture}}
 
|-
 
|-
 
| <code>[CFR]</code>
 
| <code>[CFR]</code>
| {{nexus mod|991|Custom Farming Redux}}
+
| {{Nexus mod|991|Custom Farming Redux}}
 
|-
 
|-
 
| <code>[CM]</code>
 
| <code>[CM]</code>
| {{nexus mod|3043|Custom Music}}
+
| {{Nexus mod|3043|Custom Music}}
 
|-
 
|-
 
| <code>[CP]</code>
 
| <code>[CP]</code>
| {{nexus mod|1915|Content Patcher}}
+
| {{Nexus mod|1915|Content Patcher}}
 
|-
 
|-
 
| <code>[FR]</code>
 
| <code>[FR]</code>
| {{nexus mod|3731|Farmhouse Redone}}
+
| {{Nexus mod|3731|Farmhouse Redone}}
 
|-
 
|-
 
| <code>[FTM]</code>
 
| <code>[FTM]</code>
| {{nexus mod|3231|Farm Type Manager}}
+
| {{Nexus mod|3231|Farm Type Manager}}
 
|-
 
|-
 
| <code>[JA]</code>
 
| <code>[JA]</code>
| {{nexus mod|1720|Json Assets}}
+
| {{Nexus mod|1720|Json Assets}}
 
|-
 
|-
 
| <code>[MFM]</code>
 
| <code>[MFM]</code>
| {{nexus mod|1536|Mail Framework Mod}}
+
| {{Nexus mod|1536|Mail Framework Mod}}
 
|-
 
|-
 
| <code>[MTN]</code>
 
| <code>[MTN]</code>
| {{nexus mod|2256|More Than Necessary}}
+
| {{Nexus mod|2256|More Than Necessary}}
 
|-
 
|-
 
| <code>[PFM]</code>
 
| <code>[PFM]</code>
| {{nexus mod|4970|Producer Framework Mod}}
+
| {{Nexus mod|4970|Producer Framework Mod}}
 
|-
 
|-
 
| <code>[PP]</code>
 
| <code>[PP]</code>
| {{nexus mod|4703|Pond Painter}}
+
| {{Nexus mod|4703|Pond Painter}}
 
|-
 
|-
 
| <code>[STF]</code>
 
| <code>[STF]</code>
| {{nexus mod|5005|Shop Tile Framework}}
+
| {{Nexus mod|5005|Shop Tile Framework}}
 
|-
 
|-
 
| <code>[TMX]</code>
 
| <code>[TMX]</code>
| {{nexus mod|1820|TMX Loader}}
+
| {{Nexus mod|1820|TMX Loader}}
 
|}
 
|}
  
===Folder structure===
+
=== Folder structure ===
 
The folder should contain your <code>manifest.json</code>, the <code>content.json</code> (or the correct json for your framework), and an <code>assets</code> folder that contains any other files your mod uses.  This may include pngs, other json files, or tbin files, among others.  The assets folder may use further subfolders if you wish, though it is not required.
 
The folder should contain your <code>manifest.json</code>, the <code>content.json</code> (or the correct json for your framework), and an <code>assets</code> folder that contains any other files your mod uses.  This may include pngs, other json files, or tbin files, among others.  The assets folder may use further subfolders if you wish, though it is not required.
  
 
[[Category:Modding]]
 
[[Category:Modding]]
 
 
[[zh:模组:内容包]]
 
[[zh:模组:内容包]]

Revision as of 08:38, 25 April 2021

Index

A content pack is a collection of files loaded by a specific content pack framework (essentially a sub-mod). Content packs can contain any files, but usually consist of JSON files and images.

For Players

If you want to use a content pack, install it just like a SMAPI mod (see player guide). Make sure you install the mod it needs too.

For Modders

Creating a Content Pack

  1. Decide which content pack framework you'll use (each framework defines the particular files you need).
  2. Install SMAPI.
  3. Create the generic content pack format (identical for all frameworks):
    1. Open your game's Mods folder (located in your game folder).
    2. Add a subfolder with the name you want (see folder naming convention).
    3. In the subfolder, add a manifest.json file with the ContentPackFor field (see manifest format).
  4. Add the files needed by the content pack framework (see its mod page for details).
  5. Launch the game, and make sure your new content pack appears under "Loaded X content packs" in the SMAPI console.

Releasing Your Content Packs

  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.)
  3. Create a .zip file containing the content pack's folder.
  4. Upload that file to Nexus Mods.

In your mod description, providing clear install steps will help reduce support questions. Example BBCode:

[size=5]Install[/size]
[list=1]
[*][url=https://smapi.io]Install the latest version of SMAPI[/url].
[*][url=<url of required mod>]Install <name of required mod>[/url].
[*]Download this mod and unzip it into [font=Courier New]Stardew Valley/Mods[/font].
[*]Run the game using SMAPI.
[/list]

Consume a content pack

If you're writing a SMAPI mod which will read content packs, see Modding:Modder Guide/APIs/Content Packs.

Conventions

These are recommended practices, but they're not required.

Folder name

The folder name should use upper camel case with a prefix showing which mod it's for. For example, a folder named [CP] SampleName is a content pack for Content Patcher.

Here are some common prefixes:

prefix for mod
[AHM] Animal Husbandry Mod
[BAGI] Better Artisan Goods Icons
[BFAV] Better Farm Animal Variety
[BL] Template:Nexus Mod
[CF] Custom Furniture
[CFR] Custom Farming Redux
[CM] Custom Music
[CP] Content Patcher
[FR] Farmhouse Redone
[FTM] Farm Type Manager
[JA] Json Assets
[MFM] Mail Framework Mod
[MTN] More Than Necessary
[PFM] Producer Framework Mod
[PP] Pond Painter
[STF] Shop Tile Framework
[TMX] TMX Loader

Folder structure

The folder should contain your manifest.json, the content.json (or the correct json for your framework), and an assets folder that contains any other files your mod uses. This may include pngs, other json files, or tbin files, among others. The assets folder may use further subfolders if you wish, though it is not required.