Tool SMAPI: Stardew Modding API

Discussion in 'Mods' started by ClxS, Mar 6, 2016.

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

    RaulMarq Scruffy Nerf-Herder

    Just so you know, you can always use this link to get the latest stable update, it's a good idea to bookmark it.
     
    • NovelisticArtist

      NovelisticArtist Void-Bound Voyager

      Ah, thank you! That worked! Thank you so much, now i can actually play again!
       
      • Miyas

        Miyas Void-Bound Voyager

        Hi,
        Don't know if its the right place but I'm using SMAPI to create a mod which could indicate some informations when hovering above a portrait in the social tab of the menu (tastes, position, ...)
        And I can't find a way to know if I'm hovering a portrait and which one.
        Looking at working mods, I found some ideas that I tried to reproduce without any success

        For example, with these few lines I'm trying to get some values 'hoverText, descriptionText and slotPosition) but they always return an empty string :
        Code:
        SocialPage social = (SocialPage)((List<IClickableMenu>)typeof(GameMenu).GetField("pages", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(gameMenu))[GameMenu.socialTab];
        string hoverText = (string)typeof(SocialPage).GetField("hoverText", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(social);
        Log.Verbose("New hovertext = " + hoverText);
        string descriptionText = (string)typeof(SocialPage).GetField("descriptionText", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(social);
        Log.Verbose("New descriptionText = " + descriptionText);
        int slotPosition = (int)typeof(SocialPage).GetField("slotPosition", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(social);
        Log.Verbose("New slotPosition = " + slotPosition);
        
        Any idea ?
         
        • bulbaswat

          bulbaswat Scruffy Nerf-Herder

          I just tried playing Prairie King, and it wouldn't let me start it when I pressed space, or react to any other inputs. I checked the SMAPI window, and it was spamming this error:
          upload_2016-4-11_20-10-40.png

          I have no idea what could be causing this other than SMAPI, as the only mods I'm using that are non-xnb (none of my xnb mods should be changing anything related to Prairie King) are CJB item sell price and CJB item spawner. I'm using SMAPI-0.40.0-Pre-release, because that's the one the mod manager downloaded last.
           
          • Advize

            Advize Cosmic Narwhal

            Stardew Valley updated to 1.07, and you're still using an outdated version of SMAPI (0.39.4). Download the latest version of SMAPI (0.40.0) https://github.com/ClxS/SMAPI/releases/tag/0.40.0
             
            • Nurio

              Nurio Cosmic Narwhal

              What @Advize said. I find that the SDVMM is very buggy. It randomly searches in the wrong folder for Stardew Valley, deletes all your mods, can't remove XNB mods, doesn't always download updates, etc
               
              • Mucchan

                Mucchan Tentacle Wrangler

                Crossposting this in this thread. This is not exactly a SMAPI question, but for the life of me I can't figure out how to access methods and properties for 'Journey of the Prairie King'. Is it located under StardewValley.Minigames or somewhere else?
                 
                • Advize

                  Advize Cosmic Narwhal

                  StardewValley.Minigames.AbigailGame. You'll notice in the constructor for this class there is a boolean, the boolean you send the constructor determines if it's single player prairie king or not.

                  When you play the game in the bar, for example, it executes this code: Game1.currentMinigame = new AbigailGame(false);
                   
                    Mucchan likes this.
                  • Mucchan

                    Mucchan Tentacle Wrangler

                    Thanks Advize!
                     
                    • RoastedCoconutz

                      RoastedCoconutz Pangalactic Porcupine

                      Thank you so much for this! I couldn't figure out why two of my mods weren't working.
                       
                      • Yunix

                        Yunix Big Damn Hero

                        Okay, everything worked perfect. Now i just downloaded the 0.40.0 release and then this happend:
                        [​IMG]

                        I had 0.39.6 before. Everything worked fine. I have NET Framework 4.0 and 4.5 installed, propertys are set... and even if i remove all Mods it show up.
                        I play it on Steam, Game Version 1.07 and Windows 7.

                        No clue whats the problem...
                         
                          Last edited: Apr 13, 2016
                        • Nurio

                          Nurio Cosmic Narwhal

                          Hm, it says in the log that Die Datei oder Assembly "Microsoft.Xna.Framework.Graphics.dll" oder eine Abhängigkeit davon wurde nicht gefunden. Now, my German is a bit rusty, but I am very certain that means it can't find XNA. If you open your game folder, you'll find a "_CommonRedist" folder. From there, install XNA
                           
                          • Yunix

                            Yunix Big Damn Hero

                            Oh yeah, sorry that it is in german. In english it is like:
                            Unhandled exception: System.BadImageFormatException: The File or Assembly "Microsoft.Xna.Framework.Graphics.dll" or a pendency from it was not found. is no allowed Win32-Application. (Exception from HRESULT: 0x800700C1)
                            at StardewModdingAPI.Program.RunGame()
                            ...

                            I now was in "C:\Program Files (x86)\Steam\steamapps\common\Stardew Valley\_CommonRedist\XNA\4.0" and started the xnafx40_redist.exe and choosed to repair it. (Other option would be to remove it...) But didn't work. Same error.
                            Do i need to fully new install it or...?
                            Sorry if i sound stupid but i have no clue at all about this hole stuff.
                             
                            • Nurio

                              Nurio Cosmic Narwhal

                              I'd at least try it, yeah. Do you know how to uninstall programs from your computer?

                              EDIT: If installed correctly, the .dll it can't find should be located here:

                              C:\Windows\Microsoft.NET\assembly\GAC_32\Microsoft.Xna.Framework.Graphic
                               
                              • Yunix

                                Yunix Big Damn Hero

                                I knew it at Win XP, but 7 is total new for me, haha.

                                I now just stared the setup and choose to remove it. Then started it again and installed it. But nothing changed. Do i need to do something special to remove it right or...? Oh man, im such a noob at the computer. xD

                                EDIT: Lol, the game isnt even starting without SMAPI... wth?
                                 
                                • Nurio

                                  Nurio Cosmic Narwhal

                                  Can you check this folder: C:\Windows\Microsoft.NET\assembly\GAC_32\Microsoft.Xna.Framework.Graphic
                                  Does it have the .dll file?
                                   
                                  • Yunix

                                    Yunix Big Damn Hero

                                    At C:\Windows\Microsoft.NET\assembly\GAC_32\Microsoft.Xna.Framework.Graphics\v4.0_4.0.0.0__842cf8be1de50553 is the dll, yes.
                                    But why is it all about Win32? I have Win7 with 64 Bit... it this makes any difference.
                                     
                                    • Nurio

                                      Nurio Cosmic Narwhal

                                      Yeah, after some research, it appears there might be a 32-bit,64-bit mismatch. I'm still looking into how to fix that, though
                                      (I also run a 64-bit system and have no problems. Curiously, almost all people I see with this problem have German error logs...)

                                      Can you try running it from the Stardew Valley folder itself, and not through Steam? (This is assuming you have the Steam version) Do you know where to find that?

                                      EDIT: Also, what version of Stardew Valley are you running? Have you tried running the latest version 1.07?
                                       
                                      • Yunix

                                        Yunix Big Damn Hero

                                        At the moment i am removing NET Framework totaly and then install 4.0 and 4.5 again.

                                        I have Stardew Valley 1.07. I tryed to start game with steam and from the folder. Also even without SMAPI, so it seems not to be a problem with SMAPI, its my computer thats the jerk atm. I hope the total reinstall of NET Framework will fix this. Google lucky told me where to find the Software Manager. xD
                                         
                                        • Yunix

                                          Yunix Big Damn Hero

                                          Okay, i now have totaly reinstalled NET Framework... still a error, but a little different now... lol.
                                          [​IMG]

                                          English its something like:
                                          Unhandled Exception: System.TypeLoadException: The Type "Microsoft.Xna.Framework.Graphics.IGraphicsDeviceService" in the Assembly "Microsoft.Xna.Framework.Graphics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553" could not get loaded.
                                          at StardewModdingAPI.Program.RunGame()
                                          ...

                                          Still no idear what it wants. NET Framework is properly installed...
                                           
                                          Thread Status:
                                          Not open for further replies.

                                          Share This Page