Modding Discussion Modding Guides and General Modding Discussion--REDUX

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

  1. peroxidewren

    peroxidewren Poptop Tamer

    Hey guys, I've been trying to figure out how to edit xnb files for Stardew Valley for a while now but despite all of the wonderful tutorials I have found (and those listed in this thread), I can't seem to get anything to work on my Linux OS. I have Wine installed and am trying to get various extractors/ converters (XNB Node, XNB Mod Toolkit, SPVM) to work through it to no avail. I really don't know what I'm doing wrong or if there's perhaps a better way to go about all of this. Any suggestions would be greatly appreciated.
     
    • MysticTempest

      MysticTempest Scruffy Nerf-Herder

      Hey Peroxidewren! I explained it pretty well for a Mac user here: http://community.playstarbound.com/threads/help-w-xnb-modding-on-mac.128801/#post-3088068

      I'm on Linux as well; so I know XNBnode works, because that's what I use for creating my mods. Basically, assuming you have everything else set up correctly. You'll need to use "wine cmd", otherwise Wine will try to launch XNBnode as a graphical program; which it's not, and will fail.
       
        peroxidewren likes this.
      • peroxidewren

        peroxidewren Poptop Tamer

        Thanks so much for clarifying this for me. I was doing something very similar before but I must have been messing something up somewhere. Somewhat frustratingly it still isn't quite working and I'm getting this error message:
        Code:
        Can't recognise '.\app\node .\app\main.js  extract Packed/ Unpacked' as an internal or external command, or batch script.
        
        I'm poking about the internet at the moment to see if I can figure it out but I'll ask any way just in case :D


        EDIT: Okay, I was being dumb, I had to type 'xnb_node.cmd'. Unfortunately this has actually lead me to get the same error that I was getting in the first place:

        Code:
        getsockopt: (10042) Unknown errorwine: Unhandled page fault on write access to 0x00000000 at address 0x56e51f (thread 0025), starting debugger...
        
        I'm really not sure what to do about it :/
         
          Last edited: Feb 16, 2017
        • MysticTempest

          MysticTempest Scruffy Nerf-Herder

          That looks like you're running it the old way, or using the Mac version that Maxiner linked on the other post. Those methods are a bit outdated.

          Use the one I linked: http://www.mediafire.com/file/fwg3p0rmp3q2v36/xnb_node.0.2.2.7z
          And, then after using 'wine cmd' to drop you down to a Windows-like terminal; it's a simple command of the following(without quotes):

          To unpack:
          "xnb_node extract Packed/ Unpacked/"
          To pack:
          "xnb_node pack Unpacked/ Packed/"

          Edit:
          Can you post a screenshot of your terminal, or copy/paste everything in the terminal window including what you're typing and the output?
           
            Last edited: Feb 16, 2017
          • peroxidewren

            peroxidewren Poptop Tamer

            Okay, so here's what I've got in the terminal:
            Code:
            ren@ren-p7-1040uk:~/.wine/drive_c/Program Files/Modding/xnb_node.0.2.2$ wine cmdWine CMD Version 6.2.9200 (1.6.2)
            
            C:\Program Files\Modding\xnb_node.0.2.2>xnb_node.cmd extract Packed/ Unpacked/
            getsockopt: (10042) Unknown errorwine: Unhandled page fault on write access to 0x00000000 at address 0x56e51f (thread 0025), starting debugger...
            Unhandled exception: page fault on write access to 0x00000000 in 32-bit code (0x0056e51f).
            Register dump:
            CS:0023 SS:002b DS:002b ES:002b FS:0063 GS:006b
            EIP:0056e51f ESP:0033f8c8 EBP:0033fd08 EFLAGS:00210246(  R- --  I  Z- -P- )
            EAX:00000000 EBX:00000000 ECX:009ab989 EDX:00000000
            ESI:7ed37a80 EDI:00000060
            Stack dump:
            0x0033f8c8:  00000000 0056ed0a 00f1f6a8 0000005c
            0x0033f8d8:  0033f900 00000274 00000000 7bcbe000
            0x0033f8e8:  0033f9d8 7bc7c7ed 00000000 7bcbe000
            0x0033f8f8:  0033f9d8 7bc7c7ed 00110000 00000000
            0x0033f908:  00000000 7bcbe000 00000002 00220000
            0x0033f918:  0033f940 0033fa28 7bcbe000 00000000
            Backtrace:
            =>0 0x0056e51f in node (+0x16e51f) (0x0033fd08)
              1 0x0055524f in node (+0x15524e) (0x00554aa0)
              2 0xec83f8e4 (0x83ec8b55)
            0x0056e51f: movb    $0xff,0x00000000
            Modules:
            Module    Address            Debug info    Name (61 modules)
            PE      400000-  f84000    Export          node
            ELF    7b800000-7ba54000    Deferred        kernel32<elf>
              \-PE    7b810000-7ba54000    \               kernel32
            ELF    7bc00000-7bcda000    Deferred        ntdll<elf>
              \-PE    7bc10000-7bcda000    \               ntdll
            ELF    7bf00000-7bf04000    Deferred        <wine-loader>
            ELF    7e304000-7e30b000    Deferred        libxfixes.so.3
            ELF    7e30b000-7e316000    Deferred        libxcursor.so.1
            ELF    7e316000-7e329000    Deferred        libxi.so.6
            ELF    7e329000-7e32d000    Deferred        libxcomposite.so.1
            ELF    7e32d000-7e33a000    Deferred        libxrandr.so.2
            ELF    7e33a000-7e346000    Deferred        libxrender.so.1
            ELF    7e346000-7e34d000    Deferred        libxxf86vm.so.1
            ELF    7e34d000-7e351000    Deferred        libxinerama.so.1
            ELF    7e351000-7e358000    Deferred        libxdmcp.so.6
            ELF    7e358000-7e35c000    Deferred        libxau.so.6
            ELF    7e35c000-7e382000    Deferred        libxcb.so.1
            ELF    7e382000-7e4cd000    Deferred        libx11.so.6
            ELF    7e4cd000-7e4e2000    Deferred        libxext.so.6
            ELF    7e500000-7e58d000    Deferred        winex11<elf>
              \-PE    7e510000-7e58d000    \               winex11
            ELF    7e5e8000-7e612000    Deferred        libexpat.so.1
            ELF    7e612000-7e65b000    Deferred        libfontconfig.so.1
            ELF    7e65b000-7e686000    Deferred        libpng12.so.0
            ELF    7e686000-7e6a1000    Deferred        libz.so.1
            ELF    7e6a1000-7e751000    Deferred        libfreetype.so.6
            ELF    7e76f000-7e787000    Deferred        userenv<elf>
              \-PE    7e770000-7e787000    \               userenv
            ELF    7e787000-7e79b000    Deferred        psapi<elf>
              \-PE    7e790000-7e79b000    \               psapi
            ELF    7e79b000-7e7c0000    Deferred        iphlpapi<elf>
              \-PE    7e7a0000-7e7c0000    \               iphlpapi
            ELF    7e7c0000-7e7ea000    Deferred        msacm32<elf>
              \-PE    7e7d0000-7e7ea000    \               msacm32
            ELF    7e7ea000-7e866000    Deferred        rpcrt4<elf>
              \-PE    7e800000-7e866000    \               rpcrt4
            ELF    7e866000-7e995000    Deferred        ole32<elf>
              \-PE    7e880000-7e995000    \               ole32
            ELF    7e995000-7ea01000    Deferred        advapi32<elf>
              \-PE    7e9a0000-7ea01000    \               advapi32
            ELF    7ea01000-7eb18000    Deferred        gdi32<elf>
              \-PE    7ea10000-7eb18000    \               gdi32
            ELF    7eb18000-7ec66000    Deferred        user32<elf>
              \-PE    7eb30000-7ec66000    \               user32
            ELF    7ec66000-7ed1e000    Deferred        winmm<elf>
              \-PE    7ec70000-7ed1e000    \               winmm
            ELF    7ed1e000-7ed52000    Deferred        ws2_32<elf>
              \-PE    7ed30000-7ed52000    \               ws2_32
            ELF    7ed52000-7ed65000    Deferred        libnss_files.so.2
            ELF    7ed65000-7ed72000    Deferred        libnss_nis.so.2
            ELF    7ed72000-7ed8d000    Deferred        libnsl.so.1
            ELF    7ef8d000-7efe2000    Deferred        libm.so.6
            ELF    7efe7000-7f000000    Deferred        version<elf>
              \-PE    7eff0000-7f000000    \               version
            ELF    f7339000-f733e000    Deferred        libdl.so.2
            ELF    f733e000-f74f4000    Deferred        libc.so.6
            ELF    f74f5000-f7512000    Deferred        libpthread.so.0
            ELF    f7515000-f751f000    Deferred        libnss_compat.so.2
            ELF    f7530000-f76e5000    Dwarf           libwine.so.1
            ELF    f76e7000-f770c000    Deferred        ld-linux.so.2
            ELF    f770e000-f770f000    Deferred        [vdso].so
            Threads:
            process  tid      prio (all id:s are in hex)
            00000008 cmd.exe
                00000009    0
            0000000e services.exe
                0000001e    0
                0000001d    0
                00000014    0
                00000010    0
                0000000f    0
            00000012 winedevice.exe
                0000001c    0
                00000019    0
                00000017    0
                00000013    0
            0000001a plugplay.exe
                00000020    0
                0000001f    0
                0000001b    0
            00000021 explorer.exe
                00000023    0
                00000022    0
            00000024 (D) C:\Program Files\Modding\xnb_node.0.2.2\xnb-node\node.exe
                00000025    0 <==
            
            C:\Program Files\Modding\xnb_node.0.2.2>
            
             
            • MysticTempest

              MysticTempest Scruffy Nerf-Herder

              Hrm, you could try updating Wine. I'm using Wine 1.7.18

              You could also try setting up a 32bit prefix, and see if that helps:
              Code:
              WINEARCH=win32 WINEPREFIX=~/.wine32 winecfg
              
              WINEARCH=win32 WINEPREFIX=~/.wine32 wine cmd
              
              I haven't seen that error before; but your commands look correct.

              Edit: Just adding in the extra part to test if you try a 32bit prefix.
               
                Last edited: Feb 16, 2017
                peroxidewren likes this.
              • peroxidewren

                peroxidewren Poptop Tamer

                I uninstalled Wine and reinstalled the binary packages for Ubuntu and after giving it another whirl, it worked like a charm! Thank you for all of your help with this, I've been tearing my hair out trying to figure out how to use Linux after only ever knowing Windows and this was absolutely driving me up the wall! Time to get modding I think :3

                Edit: I really should have tried this first (it's one of those "have you tried turning it off and on again?" moments :facepalm:) Thank you again!
                 
                  MysticTempest likes this.
                • MysticTempest

                  MysticTempest Scruffy Nerf-Herder

                  Ah yea, no prob! I'm glad I could help some; have fun!! :)
                   
                    peroxidewren likes this.
                  • Entoarox

                    Entoarox Parsec Taste Tester

                    This is linux, it is never a "have you tried turning it off and on again?" moment, it is always a "have you tried <three chapters of techobabble here>?" moment :p
                     
                      springacres and peroxidewren like this.
                    • peroxidewren

                      peroxidewren Poptop Tamer

                      Haha, it is rather complicated, but now that I know how to do this small task I do feel like I'm in the Matrix so it was kind of worth it :p
                       
                      • SterlingLuster

                        SterlingLuster Starship Captain

                        Can you use xnb mods with SMAPI?
                         
                        • Kirbyarm

                          Kirbyarm Void-Bound Voyager

                          Does anyone know if they have fixed the pixel graphical errors when extracting the cursors.xnb file yet? Or is the unpacker the same as it was about a year ago when I played it?
                           
                          • Karmylla

                            Karmylla Scruffy Nerf-Herder

                            Hey guys, I'm having issues with changing Willy's schedule. I posted a thread but maybe come of you guys can help me out.
                            Basically, I want to change his initial position when each day starts. Please go to my thread where I've posted the code and the updates of all my attempts on figuring this out.
                            Thank you!
                             
                            • MattyToo

                              MattyToo Poptop Tamer

                              Hi, I've been trying to make some major changes to the farmer_base png file, and I've run into a problem.

                              the sprite's draw position seems to move up and down when performing the run animation, regardless of the height of the actual sprite. triple checked the sprites were lined up correctly. When I tried to over-correct to stop the sprite from appearing to "bounce", the bottom of the sprite gets chopped off. Is this something I can change by making a smapi mod? Or is this hard coded and unchangeable?

                              Edit: this gif shows what is happening
                              [​IMG]
                               
                                Last edited: Feb 27, 2017
                              • crymblade

                                crymblade Orbital Explorer

                                Is this where we talk about modpacks or sets of mods that fit a certain theme or difficulty level?
                                 
                                • Entoarox

                                  Entoarox Parsec Taste Tester

                                  Your problem, with SMAPI you can do a lot, but completely revamping integral parts like that is currently not a easy task, so unless you are already familiar with SMAPI modding and the many, many, many, different workarounds needed, you are unlikely to be able to manage it...
                                   
                                    MattyToo likes this.
                                  • AtomosomotA

                                    AtomosomotA Starship Captain

                                    Can anyone tell me what file I can edit to adjust the prices of Farmhouse upgrades? I swear I've looked over every file multiple times but can't tell what it may be under...
                                     
                                    • Hammurabi

                                      Hammurabi Zero Gravity Genie

                                      They're hardcoded.

                                      Code:
                                        private void houseUpgradeAccept()
                                        {
                                        switch (Game1.player.houseUpgradeLevel)
                                        {
                                        case 0:
                                        if (Game1.player.Money >= 10000 && Game1.player.hasItemInInventory(388, 450, 0)) <-- 10,000 gold & 450 wood for the first upgrade
                                        {
                                        Game1.player.daysUntilHouseUpgrade = 3;
                                        Game1.player.Money -= 10000;
                                        Game1.player.removeItemsFromInventory(388, 450);
                                        Game1.getCharacterFromName("Robin", false).setNewDialogue(Game1.content.LoadString("Data\\ExtraDialogue:Robin_HouseUpgrade_Accepted"), false, false);
                                        Game1.drawDialogue(Game1.getCharacterFromName("Robin", false));
                                        break;
                                        }
                                        if (Game1.player.Money < 10000)
                                        {
                                        Game1.drawObjectDialogue(Game1.content.LoadString("Strings\\UI:NotEnoughMoney3"));
                                        break;
                                        }
                                        Game1.drawObjectDialogue(Game1.content.LoadString("Strings\\Locations:ScienceHouse_Carpenter_NotEnoughWood1"));
                                        break;
                                        case 1:
                                        if (Game1.player.Money >= 50000 && Game1.player.hasItemInInventory(709, 150, 0)) <-- 50,000 gold & 150 hardwood for the second upgrade
                                        {
                                        Game1.player.daysUntilHouseUpgrade = 3;
                                        Game1.player.Money -= 50000;
                                        Game1.player.removeItemsFromInventory(709, 150);
                                        Game1.getCharacterFromName("Robin", false).setNewDialogue(Game1.content.LoadString("Data\\ExtraDialogue:Robin_HouseUpgrade_Accepted"), false, false);
                                        Game1.drawDialogue(Game1.getCharacterFromName("Robin", false));
                                        break;
                                        }
                                        if (Game1.player.Money < 50000)
                                        {
                                        Game1.drawObjectDialogue(Game1.content.LoadString("Strings\\UI:NotEnoughMoney3"));
                                        break;
                                        }
                                        Game1.drawObjectDialogue(Game1.content.LoadString("Strings\\Locations:ScienceHouse_Carpenter_NotEnoughWood2"));
                                        break;
                                        case 2:
                                        if (Game1.player.Money >= 100000) <-- 100,000 gold for the third upgrade
                                        {
                                        Game1.player.daysUntilHouseUpgrade = 3;
                                        Game1.player.Money -= 100000;
                                        Game1.getCharacterFromName("Robin", false).setNewDialogue(Game1.content.LoadString("Data\\ExtraDialogue:Robin_HouseUpgrade_Accepted"), false, false);
                                        Game1.drawDialogue(Game1.getCharacterFromName("Robin", false));
                                        break;
                                        }
                                        if (Game1.player.Money >= 100000)
                                        break;
                                        Game1.drawObjectDialogue(Game1.content.LoadString("Strings\\UI:NotEnoughMoney3"));
                                        break;
                                        }
                                        }
                                      
                                       
                                      • AtomosomotA

                                        AtomosomotA Starship Captain

                                        I was afraid of that... So there is absolutely no way to alter this? Would it even be possible to use Smapi to change it I wonder..? Thank you for your help btw, Hammurabi.
                                         
                                        • Hammurabi

                                          Hammurabi Zero Gravity Genie

                                          Not without a lot of work. Even then, I'm not sure if it's really possible.

                                          You might be able to cheat a little bit by just adding money and/or resources back to the player's inventory if you're just lowering the costs (though I'm not sure how best to check for the upgrade dialog; maybe just compare the daysUntilHouseUpgrade to its previous value each time the location changes?), but I don't think that you'd be able to actually have that option be conditional on them having additional resources, or more of the same type of resources or money.
                                           
                                            AtomosomotA likes this.

                                          Share This Page