Hi, I'm interested in drawing my own portraits for the game but was wondering how to change the in-game portraits to be my own. I don't know the first thing about creating mods haha Thank-you
first you need tool extract file Xnb to PNG : XNB Node (0.1.2) by Draivin. RECOMMENDED FOR XNB PACKING, UNPACKING (now packs/unpacks PNG and text (YAML) data). and follow this guide : Step by Step Guide with Pictures for Unpacking and Repacking Mods by cantorsdust
Get https://mega.nz/#!hVMgXSLI!mtXgWAQcgGjaB1RLq4Mr45p5M8tuS3c0B2c7qwhUNm8 Unrar it and put the app folder & xnb_node.cmd in C:\Program Files (x86)\Steam\SteamApps\common\Stardew Valley (or whatever your default SV folder is), Open up Command Prompt. Type "cd C:\Program Files (x86)\Steam\SteamApps\common\Stardew Valley" (or default folder). Type "xnb_node.cmd extract Content\Portraits\xx.xnb xx.png" with xx being the name of the person you wanna mod. Type "xnb_node.cmd extract Content\Portraits\xx.xnb xx.yaml" with xx being the name of the person you wanna mod. You should have xx..png, xx.png, and xx.yaml in your Stardew Valley folder now. Open the ..png (the one with pictures you can see) in SAI or Photoshop or whatever you use and make the portraits look like whatever. Make sure you save the picture as xx..png, not .png, and make sure it's transparent. Make 2 more folders. You can name them whatever you want. I calls em Test and Testas. Drag and drop the xx..png, xx.png, and xx.yaml into Test. Back in Command Prompt, type "xnb_node.cmd pack test testas". If you did everything right, inside Testas you should have xx.xnb. That's the mod. Just put it back into Content\Portraits and overwrite the old one and test it out in game. Make sure you backup your default files.
I don't know why but this kinda doesn't work for me x__x No matter what I do, it doesn't do anything!
Hello, if anyone is still on this thread, I keep getting stuck on the second to last step, where you have to type "xnb_node.cmd pack test testas". The command prompt keeps giving me the error, "'. app\node' is not recognized as an internal or external command, operable program or batch file".
Hopefully I can explain this well. https://www.dropbox.com/s/jbewl3nzh3golt1/XNBExtract.rar?dl=0 <download and extract this somewhere, it'll be where you do your modding. Look in the Stardew assets for the character portrait.xnb that you want and place it in the packed folder, then run the unpack.batch. The unpacked files should show up in the unpacked folder. Simply edit these and stay within the border, when done save your work and then run the pack.batch. The edited files should now be in the xnb, which you can either use to replace your own files (if you just want them in your game) or in a mod! If its a mod, place the edited xnb files in a folder named assets, then in a folder of your mod name. Then open up a notepad (Notepad++ is especially good) and put something like this in { "Format": "1.0", "Changes": [ // Portrait { "Action": "Load", "Target": "content/assets/portraits/abigail.xnb", "FromFile": "assets/abigail.xnb" } ] } And name it whatever.json This tells the game to use your files (the location on the bottom) instead of the original files (location on top). If you have any questions feel free to ask! I'm not an expert but I do know a bit. You may also need a manifest.json.
Portraits are stored in WhereverSteamRunsFromOnYourMachine:\Steam\steamapps\common\Stardew Valley\Content\Portraits. Inside that folder, you will see [character name].xnb. Before you do anything else, copy the original XNB to some other location as a backup in case you mess something up or change your mind or whatever. It's always good to have the originals on hand just in case something weird happens. Such is the nature of any type of computer work; something weird is ALWAYS happening. XNB is a special kind of file that can't be opened in notepad or whatever; that's because it's a file that contains other files. Think of it like some sort of archive, I guess. Almost like a zip. Thus, in order to see the files inside the XNB, you need a special program to "unpack" it. I use xnbcli for that. You'll need to install it in some easy-to-reach spot on your computer. Make sure you can find wherever you put it. Once you have that all set up and squared away, you'll notice that the xnbcli has some files and other folders in its folder. You'll want to copy the XNB you want to open into the folder called "packed". Then, you'll click the file that says "unpack.bat". That will extract the files within the XNB into the folder called "unpacked". So then, look inside the "unpacked" folder to find the image file you want to modify. Then modify it to suit your liking! Go nuts; if you mess up, that's what the backup you made earlier is for! I used MS Paint to modify mine. I zoomed in to make everything really big and then meticulously placed pixels where I wanted them. The eyedropper is great for getting a particular color that already exists. Then, I use the pencil, and make sure the width is one pixel. Once you are done with modifying the portrait sprite sheet, you'll have to save it and close it. Delete the XNB in the "packed" folder. Then you'll want to click on the file that says "pack.bat". That will make your sprite sheet into a new XNB file, which will be placed in the "packed" folder. Replace the original XNB in the game with the new one you made! Ta-da! Then you're all done!
It is strongly suggested though that instead of replacing XNB files, you create a content patcher pack instead. That way the original files of the game are not compromised and things are less likely to break if ths game updates. That way you can even leave files as like... png files or whatever instead of converting them to XNB files. This will explain more. https://community.playstarbound.com/threads/migrating-xnb-mods-to-content-patcher-packs.141577/
umm how do do this using a macbook? and do i have to use the original portrait as a base? what if i were to make a non pixelated portrait.. is it possible?