Modding Help Help with recompiling Stardew

Discussion in 'Mods' started by jivex5k, Mar 15, 2016.

  1. jivex5k

    jivex5k Intergalactic Tourist

    So I want to alter keg recipes. Well, turns out they are coded into the exe file. Figured I'd look into decompiling exe files, found ILSpy works fairly well. I've converted the exe into a csproj file and opened it in Visual Studio.

    I managed to find the all missing references except for GalaxyCSharp, which is most likely related to GOG's galaxy platform and the achievements. No luck in finding source files to compile for this like I did with Steamworks.

    Anyway, the other big issue is ILSpy outputting the following code:
    Code:
    if (!<PrivateImplementationDetails>{AD34A724-DBC5-4A0E-9081-B5356A51BC86}.$$method0x6000f65-1.TryGetValue(key, out num))
                    {
                        goto IL_4CC;
                    }
    
    The <PrivateImplementationDetails> spiel seems to be a reference to an unknown object. It's occurring in more than one place and causing a lot of errors and warnings.

    Looking into this it seems like I'll need to guess what these objects are? I'm not sure, kind of stuck at this point and just looking for any information that will point me in the right direction here.

    Thanks in advance!
     
    • hathor

      hathor Seal Broken

      I decompiled it and then tried switching the references to monogame. I also updated xTile to where it now compiles against monogame. I got SDV to compile and launch, but it doesn't work quite as expected. https://gfycat.com/ShallowSneakyBoubou
       
      • Entoarox

        Entoarox Oxygen Tank

        Switch the keg out with a object of your own after saving, then switch it back with a normal keg just before saving.

        Why you'd go the difficult route when you can use the easy one idk....
         
        • Jinxiewinxie

          Jinxiewinxie Farmer Fashionista

          If you use DotPeek instead of ILSpy, you'll be able to see what was actually there. When I'm looking through the base-game code to find something, I use both ILSpy and DotPeek because some things decompile oddly in one or the other.
           
          • rockinrolla

            rockinrolla Scruffy Nerf-Herder

            Used the decompiled code on github worked flawlessly. Changed buildings to use pixelzoom so that when I use my custom hd mod it'll change res like the other assets.
             
            • Jinxiewinxie

              Jinxiewinxie Farmer Fashionista

              Can you share a link to that?
               
                XaviiKinz likes this.
              • foghorn

                foghorn Pangalactic Porcupine

                Jinxiewinxie likes this.
              • Jinxiewinxie

                Jinxiewinxie Farmer Fashionista

              • Entoarox

                Entoarox Oxygen Tank

                Custom HD mods arent possible, the best you'd be able to do is force the zoom further then vanilla allows, and that'd just make things ugly....
                 
                • Jinxiewinxie

                  Jinxiewinxie Farmer Fashionista

                  I wanted the link to the decompiled base-game code on github =P
                   
                  • Entoarox

                    Entoarox Oxygen Tank

                    It legally shouldnt be there.... Since decompiling is a pretty gray area world-wide in the first place, but making it public is a big nono...
                     
                    • Jinxiewinxie

                      Jinxiewinxie Farmer Fashionista

                      Which is why I was doubtful it was there and wanted the link =P
                       
                      • rockinrolla

                        rockinrolla Scruffy Nerf-Herder

                        Simple change all assets including tbin maps to use 32x32 base and change pixelzoom to use 2 instead of 4, not true hd d but better than nes.
                         
                        • rockinrolla

                          rockinrolla Scruffy Nerf-Herder

                          Use an deobfusticator like http://de4dot.com/ to clear up the code a bit. and a decompiler like ilspy to get a working project.
                           
                          • ClxS

                            ClxS Pangalactic Porcupine

                            A deobfusticator isn't needed, since the code isn't at all obfusticated. ILSpy/DotPeek alone works perfectly fine, but it fails to handle certain functions. DotPeek isn't able to properly interpret the SaveGame.cs' Save and Load methods properly. You might need to use something like Mono.Cecil to inspect the IL for those functions, or just guess how it's done, and reimplement it yourself.

                            If you're wanting this for the sake of a distributable mod I really recommend against it. There are better ways than this... It'll have to be redone every time the game updates, and there's no guarantee things wont break due to your changes.
                             
                              Last edited: May 11, 2016
                              Androxilogin likes this.

                            Share This Page