Modding Discussion Modding Guides and General Modding Discussion--REDUX

Discussion in 'Mods' started by cantorsdust, Mar 10, 2016.

Thread Status:
Not open for further replies.
  1. cantorsdust

    cantorsdust Existential Complex

    The PNG and YAML need to have the same name. The YAML is what is packed first, and then the YAML tells the program to pack the graphic of the same name.
    • keyten

      keyten Cosmic Narwhal

      I have tried creating my NPC following Acrimonia's guide. My progress so far.
      Starting to think about making a black Robin mod.
        sivolobwho and Drogean like this.
      • Flareon

        Flareon Scruffy Nerf-Herder


        I've been attempting to make some basic recolor edits to my animals from scratch using the release of xnb_node you have listed in the OP and I'm having a really hard time. I can't seem to get the XNB files to convert to PNG properly. I'm not sure where I am going wrong so I'll outline my process here:

        1. Extract xnb_node to my Stardew Valley folder.
        2. Run CMD, use command: xnb_node.cmd extract Content/Animals/cat.xnb cat.png
        3. It succeeds and I get a file titled cat.png
        4. I open up Photoshop and I get the following error.

        I'm not sure what's up but I have tried various other files, too, and while it succeeds in extracting them, it doesn't seem to do it correctly? I'm not really sure what I'm doing wrong, could anyone possibly shed some light on this? I'd really like to make some mods of my own to share (And put my own kitty in the game, hehe), I'm really excited to give it a try. :)

        Some side notes: I am using windows 10.1, I have tried using both Paint Tool SAI and Photoshop CS, neither could open the files.

        (My apologies for posting on the old topic first - I removed that post and moved it here. ^ ^)

        Thank you in advance!
        • cantorsdust

          cantorsdust Existential Complex

          I just recreated the error using your instructions. You're right; for whatever reason, that extraction does not seem to work. What did work for me was extracting a directory--try placing cat.xnb into its own folder in your main Stardew Valley folder, like "input", then making a second folder there, "output". Put cat.xnb in input. Then run xnb_node.cmd extract input output. That worked for me and got me a working cat.png.

          Edit: I'll forward this on to draivin. Thank you for the clear and understandable error report!

          Edit edit: Thanks to Inari, try:

          xnb_node.cmd extract Content\Animals\cat.xnb cat.yaml

          What was happening was that it extracted the PNG, then went on to create the associated cat.yaml. Your command told it that cat.yaml should be named "cat.png", so that's what it named it, rewriting over your cat.png in the process. If you open your corrupt cat.png in notepad or whatever, you'll see the cat.yaml text.

          I'll update by XNB Node guide, too, as that's an oversight.
            Last edited: Mar 11, 2016
            Flareon likes this.
          • Flareon

            Flareon Scruffy Nerf-Herder

            Thank you for the in-depth response! That makes sense. :) Luckily, someone helped me on the other thread and their explanation fixed things for me. (Credit to Ravi - Thank you so much!) Here is the method that they explained to me:

            1. I created a folder (outside Stardew's folder, still on C drive) named "Kitty".
            2. Ran CMD and used the following command in my Star Valley folder: xnb_node.cmd extract C:\Kitty KittyKat

            This worked like a charm! :) It made the folder with .PNG and .YAML file as well.
            • cantorsdust

              cantorsdust Existential Complex

              Updated the XNB Node guide to reflect the later versions and corrected the mistake in explaining how to unpack individual files.

                Drogean and Flareon like this.
              • Flareon

                Flareon Scruffy Nerf-Herder

                I believe I very well could be the worst at this, haha. I finished making the edits to my little kitty but now I've hit another snag. I am using the commands you gave but I can't get my file to pack properly. I'll outline my steps here, I may be missing something very obvious. (Most likely answer lol!)

                1. I have cat.png & cat.yaml in the folder 'input' together.
                2. I run xnb_node.CMD and use the following commands:
                • xnb_node.cmd pack input\cat.yaml output\cat.xnb (Error feedback: Click!)
                • xnb_node.cmd pack input output (Error feedback: Click!)
                I don't know what I've done this time. xD I seem to have the worst luck and/or skill with this, haha. This is what my 'input' folder looks like. Also just realized my C drive insists its Win8 in its name even though its Win10. xD Odd little thing to notice 4 months later, lol!

                I'm sorry for all the questions and trouble. :( Thank you so much for being so helpful and so responsive, I truly do appreciate it! Ravi's method was the same as the one you explained - I just re-read your post and realized that. ^ ^ I had just returned from dinner when I read your post so I was still 95% brain-focused on food lol. The new modding sequence you uploaded is awesome, very easy to follow. :)

                Edit: Resolved this problem! I had accidentally named the PNG "cat.png.png" lol. I corrected the name and it worked fine. :)
                  Last edited: Mar 12, 2016
                • sivolobwho

                  sivolobwho Phantasmal Quasar

                  Hi! I'm not sure if this is exactly the right place to post this, but since it's a resource for modding I think it might have a home here! I made a base sprite sheet.
                  It's derived from Robin's walk cycle and the female MC sprites, but I think it could easily be used for male sprites as well (with or without some editing). I haven't seen anyone post a blank one of these bad boys yet. I made this for myself because I plan on making (copious amounts of) custom NPCs, but I'm happy to share! Credit is nice, but not required. :^) I do plan on adding animations in the future, including the kissing animation and the little surprised jump as well, and if anyone wants them I can post them! If anyone has any specific requests for animations (that already exist), I can probably do them.

                  Also, I know this is by no means perfect, so please feel free to edit it however you like! Happy modding!
                  • miryuo

                    miryuo Zero Gravity Genie

                    can someone make a simple program/interface to extract and repack texture files/xnb's ... working in the command panel always makes me nervous ^^;
                      izzy82 likes this.
                    • chibiistars

                      chibiistars Orbital Explorer

                      Hello, I have tried to add new dialogue for npc but it doesnt seems to work. Whenever I add a new dialogue and repacked it into .xnb file, the file only contain dialogue up to just before the new dialogue that I added. So if I insert a new dialogue into the middle of the file and repack it, half of my infomation is lost. What might cause this problem or it's just that I screwed up?
                      • cantorsdust

                        cantorsdust Existential Complex

                        Are you sure you're packing the right files? Dialogue is just text--there shouldn't be any problem repacking it. What happens when you extract your newly repacked XNB file? What happens when you try your new XNB file replacement in game? I need information about what steps you used to create the problem.
                        • chibiistars

                          chibiistars Orbital Explorer

                          I was editing the marriagedialogue file. I just added new line and repacked it, then reextract the new xnb file, I realise there's a lot lesser line in the new file. When I try out my new XNB file, I can't even start a conversation with the npc. For now I can only edit the existing npc dialogue without having any problem.

                            Attached Files:

                          • keyten

                            keyten Cosmic Narwhal

                            Yeah, I had similar problem with editing events. Looks like it is hardcoded into dlls.
                            Oh, I have found some nice list with special constants to use in dialogues.

                            dialogueHappy = "$h";
                            dialogueSad = "$s";
                            dialogueUnique = "$u";
                            dialogueNeutral = "$neutral";
                            dialogueLove = "$l";
                            dialogueAngry = "$a";
                            dialogueEnd = "$e";
                            dialogueBreak = "$b";
                            dialogueKill = "$k";
                            dialogueChance = "$c";
                            dialogueDependingOnWorldState = "$d";
                            dialogueQuickResponse = "$y";
                            dialoguePrerequisite = "$p";
                            dialogueSingle = "$1";
                            dialogueQuestion = "$q";
                            dialogueResponse = "$r";
                            breakSpecialCharacter = "{";
                            playerNameSpecialCharacter = "@";
                            genderDialogueSplitCharacter = "^";
                            quickResponseDelineator = "*";
                            randomAdjectiveSpecialCharacter = "%adj";
                            randomNounSpecialCharacter = "%noun";
                            randomPlaceSpecialCharacter = "%place";
                            spouseSpecialCharacter = "%spouse";
                            randomNameSpecialCharacter = "%name";
                            firstNameLettersSpecialCharacter = "%firstnameletter";
                            timeSpecialCharacter = "%time";
                            bandNameSpecialCharacter = "%band";
                            bookNameSpecialCharacter = "%book";
                            rivalSpecialCharacter = "%rival";
                            petSpecialCharacter = "%pet";
                            farmNameSpecialCharacter = "%farm";
                            favoriteThingSpecialCharacter = "%favorite";
                            eventForkSpecialCharacter = "%fork";
                            kid1specialCharacter = "%kid1";
                            kid2SpecialCharacter = "%kid2";

                            And $0,$1,$2 and etc seems to be number of portrait, so you can add more portraits.

                            According to this.setNewDialogue("MarriageDialogue", (Game1.isRaining ? "Rainy" : "Indoor") + "_Night_", random.Next(6) - 1, false, false);
                            adding new dialogue marriage variations will not work.

                            Edit edit:
                            Commands to use with tiles in map editor:

                              Last edited: Mar 13, 2016
                            • borsTiHD

                              borsTiHD Seal Broken

                              I have a short question.
                              Is it possible to get steam achievements after I use a mod? I mean, I'm starting a new *.exe right? Is it possible somehow?
                              I would love to use the time pause mod for inhouse levels, but I still want to get the achievements. :)

                              Thanks for helping.
                              • cantorsdust

                                cantorsdust Existential Complex

                                Steam achievements should be working with Storm. If they're not, post in the Storm thread to let them know.
                                • Kirbyarm

                                  Kirbyarm Scruffy Nerf-Herder

                                  Just to be clear I am using this version of XNB Node:

                                  I appreciate the response, the temporary workaround to extract it as yaml instead of png works for individual files.

                                  Now for repacking individual files I use this command and get this result in cmd:

                                  C:\Program Files (x86)\Steam\SteamApps\common\Stardew Valley>xnb_node.cmd pack t
                                  estout\LooseSprites\Cursors.png Cursors.xnb
                                  C:\Program Files (x86)\Steam\SteamApps\common\Stardew Valley\app\main.js:65
                                  throw e;
                                  TypeError: Cannot read property 'startsWith' of null
                                  at LineGenerator.indentLevel (C:\Program Files (x86)\Steam\SteamApps\common\
                                  Stardew Valley\app\typeyaml.js:138:19)
                                  at LineGenerator.nextGroup (C:\Program Files (x86)\Steam\SteamApps\common\St
                                  ardew Valley\app\typeyaml.js:93:31)
                                  at getObject (C:\Program Files (x86)\Steam\SteamApps\common\Stardew Valley\a
                                  at getObject (C:\Program Files (x86)\Steam\SteamApps\common\Stardew Valley\a
                                  at getObject (C:\Program Files (x86)\Steam\SteamApps\common\Stardew Valley\a
                                  at getObject (C:\Program Files (x86)\Steam\SteamApps\common\Stardew Valley\a
                                  at getObject (C:\Program Files (x86)\Steam\SteamApps\common\Stardew Valley\a
                                  at getObject (C:\Program Files (x86)\Steam\SteamApps\common\Stardew Valley\a
                                  at getObject (C:\Program Files (x86)\Steam\SteamApps\common\Stardew Valley\a
                                  at getObject (C:\Program Files (x86)\Steam\SteamApps\common\Stardew Valley\a

                                  Any help with this error would be appreciated.

                                  Also my other more important issue wasn't addressed and was hoping anyone could help me with it. I extracted the entire Stardew Valley content folder for v1.05 as well as extracted the single file Cursors.xnb to retrieve Cursors.png for modifications. It seems however that somewhere in the extraction process severely degrades the quality of the image and its sprites...

                                  Take a look here:

                                  Between the shipping bin and the doors you'll see snowflakes... that are red! Near the journey to prairie king logo you'll see the two window lighting sprites have black dots scattered all over them. You'll also notice the large water animation sprites at the very bottom have putrid green conveniently added to it.. I really want to alter the color of my cursor and horse face picture so I really would like some help to figure out what is wrong with the way I'm extracting this file.. If anyone else could upload the clean version I could perhaps download that, modify it and work from there. Thanks again for the time and work you guys put into this.

                                  View attachment 144519
                                  • The | Suit

                                    The | Suit Agent S. Forum Moderator

                                    Great resource - stickied.
                                    • cantorsdust

                                      cantorsdust Existential Complex

                                      You pack with the .yaml file as well. The .yaml tells XNB Node to pack the .png. As for your file, I agree, it looks corrupted. I tried with mine and got the exact same look--red dots in the snowflakes and green water. I have attached a non-corrupted version below, but it's from an older version of the game--I'm not sure if 1.05 changed the Cursors file or not. If I see draivin, I'll mention the problem.

                                      Thank you!

                                        Attached Files:

                                      • Kirbyarm

                                        Kirbyarm Scruffy Nerf-Herder

                                        Many thanks, cantorsdust. Being able to extract and pack single files is proving to be a huge help.

                                        The file you provided definitely has clean water, though I still notice some troublesome abnormalities, particularly in-game after packing it up. Snow almost blankets the entire screen to the point of invisibility, some text seems to look much less detailed (like MS Paint took over) and the numbers in the g/money meter are all messed up. The character sprite in menus looks strange at night. I'm sure I could find more.

                                        Really hoping Draivin comes back around and can make it work completely accurately with the transparency.
                                        • cantorsdust

                                          cantorsdust Existential Complex

                                          Yeah, I haven't seen him in a little bit. I suspect that this is related to the transparency fix for 0.2.1. You could always try an earlier version, I suppose. Still keeping an eye out for him...
                                          Thread Status:
                                          Not open for further replies.

                                          Share This Page