Changes

Jump to navigation Jump to search
→‎Unpack game files: show simpler option first, tweak wording, use {{github}}
Line 30: Line 30:  
==<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''. There are two main XNB unpackers available.
 
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.
 +
 +
===StardewXnbHack===
 +
{{github|Pathoschild/StardewXnbHack#readme|StardewXnbHack}} is an open-source and crossplatform tool for unpacking XNB files. It can't pack files back into <tt>.xnb</tt>, but you [[Modding:Content Patcher|rarely need to]].
 +
 +
Here's how:
 +
 +
# {{github|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]].
    
===xnbcli===
 
===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.
+
{{github|LeonBlade/xnbcli#readme|xnbcli}} is an open-source and crossplatform tool for packing and unpacking XNB files. 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>[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>{{github|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 to use [[#StardewXnbHack|StardewXnbHack]] instead.)
+
# 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 xnbcli can't handle; for some data files you'll need to use [[#StardewXnbHack|StardewXnbHack]] instead.)
 
</li>
 
</li>
 
<li>Edit the unpacked file (see below).</li>
 
<li>Edit the unpacked file (see below).</li>
<li>If this is a data file (not an image or map), there's one more step if you want to replace the file with {{nexus mod|1915|Content Patcher}}'s <tt>Action: Load</tt>: removing the XNB metadata. Your current JSON file should look something like this:
+
<li>If this is a data file (not an image or map), there's one more step if you want to replace or edit the file with [[Modding:Content Patcher|Content Patcher]]: removing the XNB metadata. Your current JSON file should look something like this:
 
<source lang="js">
 
<source lang="js">
 
{
 
{
Line 90: Line 101:  
* 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 unpacking 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,403

edits

Navigation menu