This wiki is a read-only version of the Stardew Valley Wiki. The official editable wiki maintained by ConcernedApe can be found at stardewvalleywiki.com

Changes

Jump to: navigation, search

Modding:Content Patcher

1,216 bytes added, 21:49, 25 September 2019
Get started: + content format
==Get started==
===Create example mod===
First let's get our basic content pack up and running:
<ol>
If you did everything correctly so far, you should see the new mod under "Loaded X content packs" in the SMAPI console. (If not, review the above steps or [[Modding:Community|ask for help]].)
 
===Content format===
The <tt>content.json</tt> file you created above is what tells Content Patcher what to change. This has two main fields:
 
* <tt>Format</tt>: the format version. You should always use the latest version (currently 1.9) to enable the latest features and avoid obsolete behavior.
* <tt>Changes</tt>: the changes you want to make. Each entry is called a ''patch'', and describes a specific action to perform: replace this file, copy this image into the file, etc. You can list any number of patches.
 
You can list any number of patches in the <tt>Changes</tt> field, each surrounded by <code>{</code> and <code>}</code>. See the next section for more info, but here's a quick example:
<source lang="javascript">
{
"Format": "1.9",
"Changes": [
{
"Action": "Load",
"Target": "Animals/Dinosaur",
"FromFile": "assets/dinosaur.png"
},
 
{
"Action": "EditImage",
"Target": "Maps/springobjects",
"FromFile": "assets/fish-object.png"
},
]
}
</source>
 
(There are other fields like <tt>ConfigSchema</tt> and <tt>DynamicTokens</tt> for more advanced usage; these are covered in the full readme.)
==Next steps==
Protected, translators
5,421
edits

Navigation menu