How do I open .xnb files and edit the textures?

Discussion in 'Mods' started by General_Durandal, Feb 19, 2017.

  1. General_Durandal

    General_Durandal Big Damn Hero

    There are a couple mods I want to use that use the cursors.xnb file, and want to use them both.
     
    • ghomerghamer

      ghomerghamer Void-Bound Voyager

      start with XNB Node. get it at this link:

      http://www.mediafire.com/file/4c0g0fk3tza384o/XNBExtract.zip

      extract and install it, it will go quick, as it is only a couple of BAT files and a CMD file.

      in command prompt, navigate to your game's folder. in my system, the address looks like this:
      "c:\progra~2\steam\steamapps\common\stardew valley"

      once you are in that folder in command prompt, use XNB Node to extract the game's files so you can edit:
      "xnb_node.cmd extract content extractedcontent"

      XNB Node will then go to your "content" folder and extract all of the XNB files into a new folder called "extractedcontent." it will also be in your "stardew valley" folder, so it wont get lost. inside there is all of the dialogue and pictures used within the game. the dialogue will all be in YAML files, which can be edited using Notepad++, and all of the pictures will be PNG, which i use Paint.Net to edit. the pictures will need to have transparency, so windows paint cannot be used, since windows paint does not support transparency.

      NOTE: before you make ANY changes to ANY files for the game, make sure you make a copy of the "content" folder someplace safe, like your documents folder or something. that way, if you mess up a file, you will still have the original files available to copy back in place. if you don't do that, youll end up posting on here asking for someone to share a copy of the original file.

      once you have done your editing, go back to command prompt and use XNB Node to re-pack everything. it will be in the same location as before, your "stardew valley" folder:
      "xnb_node.cmd pack extractedcontent content"

      XNB Node then will take everything in the extractedcontent folder and re-pack it. if it errors out, the last file it tried to pack will be the file that is causing the problem. in your case, it would be the cursors files, since that is what you want to edit. that one likes to glitch for no reason with some of the transparent particle effects, so playing with it can be tricky. again, keep a copy of the entire content folder just in case something breaks. youll always have a backup

      edit: you do NOT need to unpack the content folder every time you want to work on a file, unless you delete the extractedcontent folder every time. you can simply change your file, then re-pack overtop the files when you want to make changes. packing will be much slower than unpacking because XNB Node will have to check each PNG and YAML against a few javascript files to make sure the files fit the game's structure. you will probably want a multi-core processor, and a solid state drive if you plan on doing a lot of this, it will save a TON of time
       
        General_Durandal likes this.
      • AwesomelyToad

        AwesomelyToad Void-Bound Voyager

        If you're on a mac, I just found a tool created for terraria that works for Stardew xnb files. I haven't figured out how to repack the files though so if you plan on editing mods it may not be the best... Anyway, it's at this link if you want to check it out
         

        Share This Page