Modding Discussion Migrating XNB mods to Content Patcher packs

Discussion in 'Mods' started by Pathoschild, Mar 5, 2018.

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

    minervamaga Pangalactic Porcupine

    A second update for A Toned Down Stardew Valley is now ready! I've stripped the outdoors tilesheets of the Eemie's Recolour changes, leaving just the ATDSV changes. This now makes the outdoor changes completely compatible with other recolors. I have also created seasonal world maps, based on zanderb's Eemie World Map Recolor and added a few config options; see below for config details. LavenderLight, the OP of ATDSV gave a blessing for these updates, but I am waiting to hear back from them on transitioning to Nexus. Please enjoy in the meantime!

    Download link - removed, new official version is now live here: https://www.nexusmods.com/stardewvalley/mods/4080

    CONFIG OPTIONS


    -TownInteriorColor - choose between four color schemes, defaults to standard. Choices are:
    --Standard
    --White
    --Warm
    --WarmWhite
    -InteriorOnly - toggles if you want the outdoor changes or not, using true/false. Default to true.
    -TreesEnabled - toggles the Eemie style trees, if you want to use those over the ones in your base recolor. Uses true/false, defaults to false.
    -BushesEnabled - toggles the modified Eemie style bushes, again overriding your base recolor. Uses true/false, defaults to false.
    -HoeDirtEnabled - toggles the darker dirt color when using the hoe. Uses true/false, defaults to false.
    -UseWorldMapRecolor - choose if you want to use the world map recolor with True/False. Defaults to "true". If you use NPC Map Locations by Bouhm, that mod includes a compatible map by default; this mod will automatically disable the edit if Bouhm's mod is detected.
     
      Last edited: Jun 14, 2019
      Orokana and Maaki like this.
    • kittycat925

      kittycat925 Void-Bound Voyager

      Hey there! So I've noticed an issue with ATDSV that's popped up in my play through, and I've tried yesterday's and the previous update and it happens with both.
      When it's snowing during winter, the map seems to flash between two different palettes every couple of seconds when trying to use the world map recolor/exterior colors.
      Right now the only real solution I've had is to turn interior recoloring back to true because it's fairly hard on the eyes with it constantly shifting in shades. I tried looking at the config and content JSONs but haven't figured out quite how it's being caused.
       
      • hatmouse

        hatmouse Phantasmal Quasar

        @Bondzgurl Glad you got it working! May I suggest you continue your journey with learning to unpack XNB files ? One of the big advantages of using Content Patcher is never having to pack anything to XNB again, and passing around PNGs and tbins and such is easier for other people that might want to edit, too :) You would just unpack the XNBs you are currently using in your conversion, replace them with PNGs, and edit your content.json to refer to .png in source files, instead of .xnb.
         
          minervamaga likes this.
        • minervamaga

          minervamaga Pangalactic Porcupine

          Most likely the recolor you are using with ATDSV also has a winter recolor. I'll add a config option to turn off the winter edits, but it might be a bit before I can get to it.
           
            kittycat925 likes this.
          • onikabluebell

            onikabluebell Space Spelunker

            @coldazrael Could you help me out? I place the CP of Classy new interior, and placing it exactly into my mods folder I had loaded my game up and looked to see if there was hopefully going to work. It happen to not do so, as I saw it hasn't changed the look of the bed or the kitchen in my stardew valley. ;-;
             
            • minervamaga

              minervamaga Pangalactic Porcupine

              Can you upload your SMAPI log to https://log.smapi.io/ (see instructions on that page) and share the link here?
               
              • onikabluebell

                onikabluebell Space Spelunker

                https://log.smapi.io/9AXAkGTN Here you go, it did say it went through but.. Not really having to done anything.. I do have one mod that changes the bed and kitchen, but by putting false I thought it wouldn't likely get in the way.

                Edit 1: I had this one mod that helps me to go to links and see which is outdated or needs to be updated, and it told me that.. "The update key 'Nexus: 854' matches a mod with invalid semantic version '1' "
                 
                  Last edited: May 17, 2019
                • Bondzgurl

                  Bondzgurl Intergalactic Tourist

                  I am definitely interested in doing so, and do plan on learning how to do it (some of it because I would love to be able to change the colours for this mod to be a little more....me, for personal use of course!) and must say thank you for the link! Definitely helps give me something to do while I'm sitting at home waiting to go into labour!
                   
                  • pepoluan

                    pepoluan Big Damn Hero

                    Yup, unpacking the .xnb and providing the mods as plain .png or .tbin will greatly help you in maintaining your mod... if you want to 'tweak' something, you no longer have to go through all the unpack-pack XNB steps.
                    Whoaaa... you're "on the final lap" already?

                    Good luck! Best wishes for you and the baby!
                     
                    • pepoluan

                      pepoluan Big Damn Hero

                      Okay, I've figured out how to download from Naver...

                      Now, what do you want me to do? ;)

                      Edit: Try attached file, see if it works. It is a quickie job, so it's possible there are glitches/quirks. Please inform me if such.
                       

                        Attached Files:

                        Last edited: May 17, 2019
                        SleepyzTime, younegg and Astrobella like this.
                      • minervamaga

                        minervamaga Pangalactic Porcupine

                        The update key thing is fine, someone just goofed when they typed it in. And from your log it does indeed look like the pack loaded, along with Zosa's furniture.
                        Can you do these steps to provide more info?
                        1. Load your save and view the content that should be patched.
                        2. Type patch summary directly into the SMAPI window and press enter.
                        3. Upload your SMAPI log to https://log.smapi.io/ (see instructions on that page).
                        4. Post the log link here.
                         
                        • Bondzgurl

                          Bondzgurl Intergalactic Tourist

                          Thanks so much! 33 weeks and counting down every day, I can't wait haha.

                          Would someone be able to explain how to set up the FromArea and ToArea if, for example, I wanted to edit the colour of the void eggs and mayo to match the chickens? I feel like the mod is incomplete without it. I know that they're located in the maps/springobjects.xnb file, and I've unpacked it and created the .png files I would like to use to replace them, I'm just a little lost on how to implement it. TIA!
                           
                            Last edited: May 17, 2019
                          • onikabluebell

                            onikabluebell Space Spelunker

                            https://log.smapi.io/umEcsGKh Here you go, thank you so much for helping me out with this problem as well! >~<
                             
                            • MouseyPounds

                              MouseyPounds Cosmic Narwhal

                              The FromArea is the location (upper left corner) and size of your replacement texture. So if you have the void egg texture in its own file that is 16x16 you would use the following:

                              Code:
                              "FromArea": {"X":0, "Y":0, "Width":16, "Height": 16 }
                              Note that in this situation the FromArea is technically optional, but as a learning experience it is clearer to fully specify it.

                              The ToArea is the location (upper left corner) and size of the original texture on the game's files. For the void egg, the location is 272, 192 (see image in spoiler below) So we would use the following ToArea:

                              Code:
                              "ToArea": {"X":272, "Y":192, "Width":16, "Height": 16 }
                              springobjectsExample.png
                              This is a cropped version of springobjects without transparency (and with some added shading) to show the location of the void egg. The void mayo is 3 objects further right on the same row so it has an X coordinate of 320 and the same Y coordinate


                              Also, feel free to stop by the #modding channel on the Stardew Discord if you have questions about creating Content Packs and we'll be happy to answer them.
                               
                                hatmouse and minervamaga like this.
                              • minervamaga

                                minervamaga Pangalactic Porcupine

                                Oh boy, that's a lot of patches. I think we would have an easier time helping you in the SDV Discord, as we might have to fiddle with the content pack a bit for you. Come swing by #modding there with a copy of the full log file (not just the summary) and one of us should be able to help you out.
                                 
                                • onikabluebell

                                  onikabluebell Space Spelunker

                                  I do not know where the discord of the SDV is at x'D.. But I will try to find the link if I can. Thank you again for trying to help me out >w<
                                   
                                  • Bondzgurl

                                    Bondzgurl Intergalactic Tourist

                                    Thanks for the help @MouseyPounds and @pepoluan! It is much appreciated!
                                     
                                    • pepoluan

                                      pepoluan Big Damn Hero

                                      Just to add: You can use one "FromFile" for multiple patches.

                                      Let's say you want to change 2 objects that are not side-by-side in the original, but using only one PNG.

                                      So you'll do it like this:

                                      Code:
                                      {
                                        "Action": "EditImage",
                                        "Target": "some/target",
                                        "FromFile": "assets/replacer.png",
                                        "FromArea": { "X": 0, "Y": 0, "Width": 16, "Height": 16 },
                                        "ToArea": { "X": 64, "Y": 16, "Width": 16, "Height": 16 }
                                      },
                                      {
                                        "Action": "EditImage",
                                        "Target": "some/target",
                                        "FromFile": "assets/replacer.png",  // <== also, same fromfile
                                        "FromArea": { "X": 16, "Y": 0, "Width": 16, "Height": 16 },
                                        "ToArea": { "X": 16, "Y": 80, "Width": 16, "Height": 16}
                                      }
                                      
                                      The "Target" doesn't have be the same. The example above shows replacement of two sprites in the same target, however there's no stopping you from patching different files from one "FromFile". It might be a bit jarring and/or confusing, though, if the replacement file contains sprites of widely varying nature :D

                                      This also works for maps using CP 1.8's new "EditMap" action. So if you ever decided to do some map editing, you can focus on the part you want to edit and replace that part only. The "FromArea"/"ToArea" coordinates and size will be slightly different: Instead of pixel based, they will be tile based.

                                      (In fact, my mod "Clean & Block for Barns & Coops" has been rewritten to use EditMap instead of Load, for future compatibility with mapmods that also use EditMap. And if you take a peek inside its content.json, you can see me doing two patches per barn map because the areas I want to patch were not contiguous.)
                                       
                                      • Bondzgurl

                                        Bondzgurl Intergalactic Tourist


                                        That, I think for now, feels more advanced than my brain could handle! But I managed to add the eggs and void mayo with all the original colours, as well as with 2 new colours!

                                        I would love to publish it, but am wondering as well about whether I need permission from the original creator or not, since I've added so much to the mod. Opinions or rules on this?
                                         
                                        • pepoluan

                                          pepoluan Big Damn Hero

                                          Well, you should try to contact the original creator if you added to their mod.

                                          Unless you want to release only the changed part, in which you can simply release as-is. IIRC CP will apply patches in alphabetical directory order, so as long as your mod sorts to later than the mod you're patching against, your mod will win the "patch war".

                                          Of course the ideal outcome would be for the original creator to give you permission to (re-)release their mod, likely with clear attribution/credit pointing to the original modder.
                                           
                                          Thread Status:
                                          Not open for further replies.

                                          Share This Page