Line 6: |
Line 6: |
| ===What are XNB files?=== | | ===What are XNB files?=== |
| The game stores data, maps, and textures in a compressed format with the <samp>.xnb</samp> file extension inside its <samp>Content</samp> folder. For example, Abigail's portrait shown during dialogue is from <samp>Content\Portraits\Abigail.xnb</samp>. Unpacking that file gives you an <samp>Abigail.png</samp> like this:<br />[[File:Modding - creating an XNB mod - example portraits.png]] | | The game stores data, maps, and textures in a compressed format with the <samp>.xnb</samp> file extension inside its <samp>Content</samp> folder. For example, Abigail's portrait shown during dialogue is from <samp>Content\Portraits\Abigail.xnb</samp>. Unpacking that file gives you an <samp>Abigail.png</samp> like this:<br />[[File:Modding - creating an XNB mod - example portraits.png]] |
− |
| |
− | (When using xnbcli, you may get an extra <samp>Abigail.json</samp> file. That's only used to convert it back into an <samp>.xnb</samp> later, and you generally won't need to change it.)
| |
| | | |
| ===How do I get my changes in the game?=== | | ===How do I get my changes in the game?=== |
Line 25: |
Line 23: |
| {{github|Pathoschild/StardewXnbHack#readme|StardewXnbHack}} is an open-source and crossplatform tool for unpacking XNB files. It can't pack files back into <samp>.xnb</samp>, but you [[Modding:Content Patcher|rarely need to]]. | | {{github|Pathoschild/StardewXnbHack#readme|StardewXnbHack}} is an open-source and crossplatform tool for unpacking XNB files. It can't pack files back into <samp>.xnb</samp>, but you [[Modding:Content Patcher|rarely need to]]. |
| | | |
− | Here's how:
| + | To unpack files: |
| | | |
| # [[Modding:Player Guide/Getting Started|Install SMAPI]]. | | # [[Modding:Player Guide/Getting Started|Install SMAPI]]. |
| # {{github|Pathoschild/StardewXnbHack/releases|Download StardewXnbHack}}. (Make sure you download the file for your OS, such as <samp>StardewXnbHack-*-for-windows.zip</samp>, not the source code!) | | # {{github|Pathoschild/StardewXnbHack/releases|Download StardewXnbHack}}. (Make sure you download the file for your OS, such as <samp>StardewXnbHack-*-for-windows.zip</samp>, not the source code!) |
− | # Unzip the download into [[Modding:Game folder|your game folder]], so <samp>StardewXnbHack.exe</samp> is in the same folder as <samp>StardewValley.exe</samp>. | + | # Unzip the download into [[Modding:Player Guide/Getting Started#Find your game folder|your game folder]], so {{executable name|StardewXnbHack}} is in the same folder as {{executable name|StardewValley}}. |
− | # Double-click <samp>StardewXnbHack.exe</samp> (on Windows), <samp>StardewXnbHack.sh</samp> (on Linux), or <samp>StardewXnbHack.command</samp> (on MacOS) to unpack your game's entire <samp>Content</samp> folder. | + | # Double-click {{executable name|StardewXnbHack}} (on Windows), <code>StardewXnbHack.sh</code> (on Linux), or <code>StardewXnbHack.command</code> (on MacOS) to unpack your game's entire <samp>Content</samp> folder. |
| | | |
| That's it! It'll unpack the files into a <samp>Content (unpacked)</samp> folder. The unpacked files will already be compatible with [[Modding:Content Patcher|Content Patcher]]. | | That's it! It'll unpack the files into a <samp>Content (unpacked)</samp> folder. The unpacked files will already be compatible with [[Modding:Content Patcher|Content Patcher]]. |
| | | |
| ===xnbcli=== | | ===xnbcli=== |
− | {{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 <samp>Data\FishPondData</samp> or <samp>Data\Movies</samp>), 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. |
| + | |
| + | This supports XNB files for other games too, but it can't handle some files specific to Stardew Valley. [[#StardewXnbHack|StardewXnbHack]] is recommended instead. |
| + | |
| + | {{collapse|content= |
| + | Special notes: |
| + | * It can't unpack XNB files containing data models (like <samp>Data\FishPondData</samp> or <samp>Data\Movies</samp>); use [[#StardewXnbHack|StardewXnbHack]] if you need those. |
| + | * You'll need to edit unpacked data files manually to work with mods like Content Patcher. |
| + | * When unpacking an image with xnbcli, you'll get extra <samp>.json</samp> file next to the image. That's only used to convert it back into an <samp>.xnb</samp> later, and you generally don't need to change it. |
| | | |
− | Here's how:
| + | To unpack files: |
| | | |
| <ol> | | <ol> |
Line 93: |
Line 99: |
| * 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! |
| + | }} |
| | | |
| ==Pack game files== | | ==Pack game files== |
− | There's no need to repack game files if you're using [[Modding:Content Patcher|Content Patcher]]! Just use the <samp>.json</samp>, <samp>.png</samp>, or <samp>.tbin</samp> file directly in your <samp>content.json</samp>. | + | There's no need to repack game files if you're using [[Modding:Content Patcher|Content Patcher]]! Just use the <samp>.json</samp>, <samp>.png</samp>, <samp>.tmx</samp>, or <samp>.tbin</samp> file directly in your <samp>content.json</samp>. |
| | | |
| If you really want to repack the files, you'll need to use [[#xnbcli|xnbcli]]: | | If you really want to repack the files, you'll need to use [[#xnbcli|xnbcli]]: |
Line 157: |
Line 164: |
| |- | | |- |
| | [https://krita.org/en/ Krita] | | | [https://krita.org/en/ Krita] |
− | | Free | + | | Free and $9.99 on Steam |
| | Windows, macOS, Linux | | | Windows, macOS, Linux |
| | | | | |
Line 192: |
Line 199: |
| |- | | |- |
| | [https://code.visualstudio.com/ Visual Studio Code] | | | [https://code.visualstudio.com/ Visual Studio Code] |
− | | Free
| |
− | | Windows, macOS, Linux
| |
− | |
| |
− | |-
| |
− | | [https://atom.io/ Atom]
| |
| | Free | | | Free |
| | Windows, macOS, Linux | | | Windows, macOS, Linux |
Line 205: |
Line 207: |
| [[Category:Modding]] | | [[Category:Modding]] |
| | | |
| + | [[es:Modding:Edición de archivos XNB]] |
| + | [[pt:Modificações:Editando arquivos XNB]] |
| [[ru:Модификации:Редактирование XNB файлов]] | | [[ru:Модификации:Редактирование XNB файлов]] |
| [[zh:模组:编辑 XNB 文件]] | | [[zh:模组:编辑 XNB 文件]] |