Modding Help Problem with .XNB repackaging

Discussion in 'Mods' started by Zhairin, Apr 28, 2017.

  1. Zhairin

    Zhairin Scruffy Nerf-Herder

    Greetings people of the forums, I hope you're having a good day.

    I also hope someone can shed some light on an issue I'm having. So I've been working on a mod for a little while now, got most of the things working as I want now, but I need to make some edits to the xnb file with all the crops data in it to finish things up.

    Now I've unpacked the file sucesfully to a .yaml (and a .xml) file, opened it, read it, made my additions and saved the file. But when I go to repackage it into an xnb I run into an issue. My additions does not seem to stick. I get the file back ok, no errors, but when I check it in-game the data I'm looking for no longer exists. I unpackage the same file again and it's the original one, as in the one that comes with the game. My additions are no longer there. Now, I know the packaging itself works, I've made additions to the springobjects.png and seen that art in-game when I bought the object from Pierre, so I know that that part is not the issue.

    I plan on taking advantage of the AssetLoading event that's supposed to be in SMAPI 2.0, so eventually this might become a non-issue, but until then I think I need this data placed in the xnb for things to work.

    So if anyone have any ideas on what might be the problem here, I'm all ears :3.

    /Zhairin
     
    • RTGOAT

      RTGOAT Cosmic Narwhal

      Spaces, not tabs.
      We get this question at least once a month.
      Always turns out to be a formatting issue.
       
      • Zhairin

        Zhairin Scruffy Nerf-Herder

        Yeah, that was not as helpful as I imagine you thought it was. Where are you assuming I used tabs instead of spaces, and why are you so certain that's the case? If you could elaborate I would appreciate it.
         
        • Entoarox

          Entoarox Oxygen Tank

          because your exact issue occurs when you use tabs, the data is treated as corrupt and cut from the packaged file.
           
          • Zhairin

            Zhairin Scruffy Nerf-Herder

            So I went back and rewrote all my additions in the crops file, making sure not to use any tabs because that's what I assumed you meant, and I'm still getting the same issue. Again, if you could elaborate on where you assume I'm using tabs instead of spaces, do you mean in the .yaml file, in the additions I'm making or somewhere else, that would be appreciated.
             
            • Zhairin

              Zhairin Scruffy Nerf-Herder

              Ok, so I found it. It was a tab made automatically by notepad++ when I made a new row to add my additions. Changed that to spaces made it work. Thanks for the help.
               
                RTGOAT likes this.
              • RTGOAT

                RTGOAT Cosmic Narwhal

                Hard to not make the assumption, mate.

                As I said, we get this question all the time and its the same issue :p
                 
                • Entoarox

                  Entoarox Oxygen Tank

                  Did you not think about enabling visible control characters? yaml is very strict in what control characters are allowed, enabling visual representation for them by enabling `View > Show Symbol > Show All Characters` in np++ makes it very easy to see what characters are actually there.
                   

                  Share This Page