Changes

Jump to navigation Jump to search
→‎Unpack game files: + StardewXnbHack
Line 29: Line 29:     
==<span id="unpacking">Unpack game files</span>==
 
==<span id="unpacking">Unpack game files</span>==
You can't edit an <tt>.xnb</tt> file itself, you need to edit the file that's inside it. Pulling out that inner file is called ''unpacking'', and putting it back is called ''packing''. You can do that using [https://github.com/LeonBlade/xnbcli/releases xnbcli], an [https://github.com/LeonBlade/xnbcli open-source] and natively cross-platform tool for packing and unpacking XNB files.
+
You can't edit an <tt>.xnb</tt> file itself, you need to edit the file that's inside it. Pulling out that inner file is called ''unpacking'', and putting it back is called ''packing''. There are two main XNB unpackers available.
 +
 
 +
===xnbcli===
 +
[https://github.com/LeonBlade/xnbcli#readme xnbcli] is an open-source and crossplatform tool for packing and unpacking XNB files. Note that it can't unpack XNB files containing data models (like <tt>Data\FishPondData</tt> or <tt>Data\Movies</tt>), and you'll need to edit data files manually to work with mods like Content Patcher.
    
Here's how:
 
Here's how:
    
<ol>
 
<ol>
<li>Download [https://github.com/LeonBlade/xnbcli/releases xnbcli]. (Make sure you download one for your OS, such as <tt>xnbcli-windows-x64.zip</tt>, not the source code!)</li>
+
<li>[https://github.com/LeonBlade/xnbcli/releases Download xnbcli]. (Make sure you download the file for your OS, such as <tt>xnbcli-windows-x64.zip</tt>, not the source code!)</li>
 
<li>Unpack the file for editing:
 
<li>Unpack the file for editing:
 
# Find the file you want to edit in the [[Modding:Player Guide/Getting Started#Find your game folder|game's <tt>Content</tt> folder]].
 
# Find the file you want to edit in the [[Modding:Player Guide/Getting Started#Find your game folder|game's <tt>Content</tt> folder]].
 
# Copy it into xnbcli's <tt>packed</tt> folder.
 
# Copy it into xnbcli's <tt>packed</tt> folder.
 
# Double-click <tt>unpack.bat</tt> (Windows), <tt>unpack.sh</tt> (Linux), or <tt>unpack.command</tt> (Mac).
 
# Double-click <tt>unpack.bat</tt> (Windows), <tt>unpack.sh</tt> (Linux), or <tt>unpack.command</tt> (Mac).
# Check the <tt>Unpacked</tt> folder for your unpacked files. (If you didn't unpack many files, it may just flash onscreen and disappear again, but that's normal! Check the folder for your changes, anyway. Note that 1.4 introduced a new data model format that current unpackers have not yet been updated to handle. For movie and fish pond data you will need a tool like [https://github.com/Pathoschild/StardewXnbHack XnbHack], which is less accessible but does the job.)
+
# Check the <tt>Unpacked</tt> folder for your unpacked files. (If you didn't unpack many files, it may just flash onscreen and disappear again, but that's normal! Check the folder for your changes, anyway. Note that 1.4 introduced a new data model format that current unpackers have not yet been updated to handle. For movie and fish pond data you will need to use [[#StardewXnbHack|StardewXnbHack]] instead.)
 
</li>
 
</li>
 
<li>Edit the unpacked file (see below).</li>
 
<li>Edit the unpacked file (see below).</li>
Line 86: Line 89:  
*# Repeat for <tt>pack.sh</tt> (Linux) or <tt>pack.command</tt> (Mac).
 
*# Repeat for <tt>pack.sh</tt> (Linux) or <tt>pack.command</tt> (Mac).
 
* If you get unrecognized command on Windows:
 
* If you get unrecognized command on Windows:
*# Make sure you didn't download the source code zip by mistake. If the folder path refers to "master", it's the wrong one!  
+
*# Make sure you didn't download the source code zip by mistake. If the folder path refers to "master", it's the wrong one!
 +
 
 +
===StardewXnbHack===
 +
[https://github.com/Pathoschild/StardewXnbHack#readme StardewXnbHack] is an open-source and crossplatform tool for packing XNB files. Note that you can't pack files back into <tt>.xnb</tt> using it (though you [[Modding:Content Patcher|rarely need to]]).
 +
 
 +
Here's how:
 +
 
 +
# [https://github.com/Pathoschild/StardewXnbHack/releases Download StardewXnbHack]. (Make sure you download the file for your OS, such as <tt>StardewXnbHack-*-for-windows.zip</tt>, not the source code!)
 +
# Unzip the download into [[Modding:Game folder|your game folder]], so <tt>StardewXnbHack.exe</tt> is in the same folder as <tt>StardewValley.exe</tt>.
 +
# Double-click <tt>StardewXnbHack.exe</tt> (on Windows), <tt>StardewXnbHack.sh</tt> (on Linux), or <tt>StardewXnbHack.command</tt> (on MacOS) to unpack your game's entire <tt>Content</tt> folder.
 +
 
 +
That's it! It'll unpack the files into a <tt>Content (unpacked)</tt> folder. The unpacked files will already be compatible with [[Modding:Content Patcher|Content Patcher]].
    
==Pack game files==
 
==Pack game files==
translators
8,401

edits

Navigation menu