Tool SMAPI: Stardew Modding API

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

Thread Status:
Not open for further replies.
  1. joyous.ariella

    joyous.ariella Space Penguin Leader

    So I am about to try to make my first SMAPI mod and I am just starting to look at tutorials. I just wanted to say A++++++ work.
    Also, at http://canimod.com/guides/creating-a-smapi-mod, I lol'd at the "determination" part. Is that a nod to Undertale? :p
    Thanks so much for your dedication to modding Stardew Valley @Pathoschild <3
     
      Pathoschild likes this.
    • Pathoschild

      Pathoschild Tiy's Beard

      I did love Undertale. ;) I'm glad the documentation is useful! Feel free to ask if you have any questions.
       
        joyous.ariella likes this.
      • Pathoschild

        Pathoschild Tiy's Beard

        [edit: this response is for a comment that was later deleted]

        Hi @LamchopxChan. When the guide says open a terminal in the extracted folder, on Mac that means...
        1. Download the latest SMAPI release.
        2. Unzip the download (so you have a directory like "SMAPI-1.3").
        3. Open the Terminal app.
        4. Type "cd " (without quotes).
        5. Drag & drop the new directory onto the Terminal app to paste in the path.
        6. Hit enter to navigate to that directory in Terminal.
         
          Last edited: Dec 6, 2016
        • MitcheII

          MitcheII Void-Bound Voyager

          Hey Pathoschild, did you still need people to test out Mod Compatibility on Mac? I've got a bunch installed already (more than on the compatibility list thus far) but It'd be super easy to just download essentially every mod and see what does/doesn't work if you'd like.
           
          • Pathoschild

            Pathoschild Tiy's Beard

            Hi @MitcheII. Mac support is still new, so that'd be helpful. I can follow up with any mod authors if their mods don't work.
             
            • Pathoschild

              Pathoschild Tiy's Beard

              Two users reported that Windows Defender wrongly detects trojan-like behaviour in SMAPI 1.3. That's probably because SMAPI rewrites DLLs (for Linux/Mac compatibility), which is something some trojans also do.

              If you're affected and willing to help, please:
              1. Go to Microsoft Malware Protection: submit a sample.
              2. In step 3:
                1. choose "I believe this file should not be detected as malware";
                2. add a comment like this:
                3. and upload the file.
              3. You should see a page like this:
                upload_2016-12-6_18-31-18.png
              4. Reply here with a screenshot of that page.
              That will help in several ways:
              • The "SHA1" tells me whether the file changed.
              • The "Detection Status" tells me whether their servers also detected a trojan.
              • This will help Microsoft refine Windows Defender.
               
              • MitcheII

                MitcheII Void-Bound Voyager

                @Pathoschild, alrighty well I went ahead and went through all 659 Mods on Nexus and downloaded all the ones that were SMAPI Mods (from what I could see from the description), if I've missed any either on Nexus or hosted elsewhere feel free to either link me (or if you're not allowed to do that tell me the name so I can find it myself). The mods I've got installed (based on folder names in the Mods folder) are as follows:
                • Animal Mood Fix
                • Build Health
                • Chests Anywhere
                • CJB Automation
                • Cooking Skill (It seems like this is the only Mod that's having issues tbh)
                • Experience Bars
                • Horse Whistle
                • M007's Extended Fridge
                • Museum Rearranger Mod
                • NPC Map Locations
                • Rush Orders
                • Save Anywhere
                • Skill Prestige
                • Skip Intro
                • Skull Cave Saver
                • SMAPI Health Bar Mod
                • StardewCJB (Show Item Sell Price Mod)
                • StarDust Core
                • Three Heart Dance Partner
                • Trainer Mod
                • Skill Prestige Cooking Adapter
                I've attached the log from the Terminal Output from running the StardewValley executable in MacOS, wouldn't let me upload an .rtf so I had to compress it sorry. If there's anything else you need from me just ask and I'll get to it :) I'll be actually trying out the mods now in-game to see what does/doesn't work and let you know, might be a little while though.
                 

                  Attached Files:

                  • Log.zip
                    File size:
                    3.4 KB
                    Views:
                    1
                • MitcheII

                  MitcheII Void-Bound Voyager

                  Okay I've gone through all the mods, findings are as follows:
                  • Skip Intro: Working
                  • Experience Bars: Working
                  • StardewCJB (Show Item Sell Price): Working
                  • NPC Map Locations: Working
                  • Horse Whistle: Working
                  • Chests Anywhere: Working
                  • M007’s Extended Fridge: Working
                  • CJB Automation: Working
                  • Rush Orders: Working
                  • Museum Rearranger: Working
                  • SMAPI Health Bars Mod: Working
                  • Trainer Mod: Working
                  • Three Heart Dance Partner: Working
                  • Skull Cave Saver: Working
                  • Build Health: Appears to be working, unsure of how to test.
                  • Animal Mood Fix: Appears to be working, unsure of how to test.
                  • StarDustCore: Appears to be working, unsure of how to test.
                  • Skill Prestige Cooking Adapter: Appears to be working, unsure of how to test.
                  • Save Anywhere: Working, However Pam won’t move to the Bus Stop upon Load (might be out of the Mod's Scope).
                  • Cooking Skill: Semi-Working, Can Gain EXP for Cooking however no Cooking Icon in the Skills Menu or the Experience Bar interface and causes tooltips to appear under the Cooking Level Bar.
                  • Skill Prestige: Not working, Prestige button alignment is way to the bottom right, barely clickable, can prestige a skill to get a prestige point but attempting to spend prestige points causes a crash, log attached, error message repeats itself multiple times per second infinitely.
                   

                    Attached Files:

                  • Pathoschild

                    Pathoschild Tiy's Beard

                    @MitcheII: great work, thanks! It's encouraging to see that most mods are working fine on Mac, given how new Mac support is. (By the way, SMAPI saves a log file that includes more details, and you can upload it without zipping it. :))

                    With regards to the issues you found:
                    • Cooking Skill seems to have a crossplatform bug, but it doesn't look like one SMAPI can patch automatically. Can you post a message in the Cooking Skill thread with a screenshot of the display issues, and your SMAPI log file? Here's the related error I noticed in your first log:
                      Code:
                      System.InvalidOperationException: This image format is not supported
                      ---> System.TypeInitializationException: The type initializer for 'System.Drawing.GDIPlus' threw an exception.
                      ---> System.DllNotFoundException: libgdiplus.dylib
                        at (wrapper managed-to-native) System.Drawing.GDIPlus:GdiplusStartup (ulong&,System.Drawing.GdiplusStartupInput&,System.Drawing.GdiplusStartupOutput&)
                        at System.Drawing.GDIPlus..cctor () <0x1138eadb0 + 0x001d9> in <filename unknown>:0
                        --- End of inner exception stack trace ---
                        at System.Drawing.Image.InitFromStream (System.IO.Stream stream) <0x1138ea930 + 0x00139> in <filename unknown>:0
                        at System.Drawing.Image.LoadFromStream (System.IO.Stream stream, Boolean keepAlive) <0x1138ea7a0 + 0x00030> in <filename unknown>:0
                        at System.Drawing.Image.FromStream (System.IO.Stream stream) <0x1138ea770 + 0x00016> in <filename unknown>:0
                        at Microsoft.Xna.Framework.Graphics.Texture2D.PlatformFromStream (Microsoft.Xna.Framework.Graphics.GraphicsDevice graphicsDevice, System.IO.Stream stream) <0x1138ea1d0 + 0x00040> in <filename unknown>:0
                        at Microsoft.Xna.Framework.Graphics.Texture2D.FromStream (Microsoft.Xna.Framework.Graphics.GraphicsDevice graphicsDevice, System.IO.Stream stream) <0x1138ea100 + 0x0002c> in <filename unknown>:0
                        --- End of inner exception stack trace ---
                        at Microsoft.Xna.Framework.Graphics.Texture2D.FromStream (Microsoft.Xna.Framework.Graphics.GraphicsDevice graphicsDevice, System.IO.Stream stream) <0x1138ea100 + 0x000b1> in <filename unknown>:0
                        at CookingSkill.CookingSkillMod.gameLoaded (System.Object sender, System.EventArgs args) <0x1138e9440 + 0x00203> in <filename unknown>:0
                      [10:45:14 ERROR SMAPI] A mod failed handling the GameEvents.LoadContent event:
                      System.InvalidOperationException: This image format is not supported ---> System.TypeInitializationException: The type initializer for 'System.Drawing.GDIPlus' threw an exception. ---> System.DllNotFoundException: libgdiplus.dylib
                        at (wrapper managed-to-native) System.Drawing.GDIPlus:GdiplusStartup (ulong&,System.Drawing.GdiplusStartupInput&,System.Drawing.GdiplusStartupOutput&)
                        at System.Drawing.GDIPlus..cctor () <0x1138eadb0 + 0x001d9> in <filename unknown>:0
                        --- End of inner exception stack trace ---
                        at System.Drawing.Image.InitFromStream (System.IO.Stream stream) <0x1138ea930 + 0x00139> in <filename unknown>:0
                        at System.Drawing.Image.LoadFromStream (System.IO.Stream stream, Boolean keepAlive) <0x1138ea7a0 + 0x00030> in <filename unknown>:0
                        at System.Drawing.Image.FromStream (System.IO.Stream stream) <0x1138ea770 + 0x00016> in <filename unknown>:0
                        at Microsoft.Xna.Framework.Graphics.Texture2D.PlatformFromStream (Microsoft.Xna.Framework.Graphics.GraphicsDevice graphicsDevice, System.IO.Stream stream) <0x1138ea1d0 + 0x00040> in <filename unknown>:0
                        at Microsoft.Xna.Framework.Graphics.Texture2D.FromStream (Microsoft.Xna.Framework.Graphics.GraphicsDevice graphicsDevice, System.IO.Stream stream) <0x1138ea100 + 0x0002c> in <filename unknown>:0
                        --- End of inner exception stack trace ---
                        at Microsoft.Xna.Framework.Graphics.Texture2D.FromStream (Microsoft.Xna.Framework.Graphics.GraphicsDevice graphicsDevice, System.IO.Stream stream) <0x1138ea100 + 0x000b1> in <filename unknown>:0
                        at SkillPrestige.SkillPrestigeMod.LoadSprites (System.Object sender, System.EventArgs args) <0x113818d00 + 0x00149> in <filename unknown>:0
                        at StardewModdingAPI.Framework.InternalExtensions.SafelyRaisePlainEvent (IMonitor monitor, System.String name, IEnumerable`1 handlers, System.Object sender, System.EventArgs args) <0x1129f4130 + 0x00127> in <filename unknown>:0
                      Setting breakpad minidump AppID = 413150
                      Steam_SetMinidumpSteamID:  Caching Steam ID:  76561198097902138 [API loaded no]
                      Invalid type System.Xml.XmlStreamNodeWriter for instance field System.Xml.XmlBaseWriter:nodeWriter
                      Invalid type System.Xml.XmlUTF8NodeWriter for instance field System.Xml.XmlCanonicalWriter:writer
                      Invalid type System.Xml.XmlCanonicalWriter for instance field System.Xml.XmlCanonicalWriter+AttributeSorter:writer
                      Invalid type System.Xml.XmlCanonicalWriter for instance field System.Xml.XmlSigningNodeWriter:signingWriter
                      Invalid type System.Data.ProviderBase.DbConnectionInternal[] for instance field System.Collections.Generic.List`1[System.Data.ProviderBase.DbConnectionInternal]:_items
                      Invalid type System.Data.SqlClient.SqlConnection for instance field System.Data.SqlClient.SqlTransaction:connection
                      Invalid type System.Data.ProviderBase.DbConnectionInternal for instance field System.Data.ProviderBase.DbConnectionFactory+<TryGetConnection>c__AnonStorey0:oldConnection
                      Invalid type System.Data.ProviderBase.DbConnectionFactory/<TryGetConnection>c__AnonStorey0 for instance field System.Data.ProviderBase.DbConnectionFactory+<TryGetConnection>c__AnonStorey1:<>f__ref$0
                    • The Save Anywhere issue seems like a general bug that probably happens on any platform. You can report it on the Save Anywhere mod page.
                    • Can you comment in the Cooking Skill and Skill Prestige threads with screenshots of their display issues and your SMAPI log file?
                    If you're willing to do more testing, here are a few more SMAPI mods:
                    Thanks again!
                     
                    • MitcheII

                      MitcheII Void-Bound Voyager

                      Hey @Pathoschild, gone and posted some screenshots and my error log on those two threads, just downloading and testing out those mods you linked now and I'll get back to you. I'll attach my error log here as well for you just in-case you want to see it. Also question on an unrelated note, is there a mod for changing zoom distance that you know of (further away hopefully)?
                       

                        Attached Files:

                      • MitcheII

                        MitcheII Void-Bound Voyager

                        Alrighty, I've gone and installed all of those mods and got Stardew Running.
                        • Lookup Anything: Working
                        • Extended Minecarts: Working
                        • Harvest with Scythe: Working
                        • Faster Paths: Working (Despite the EntoaroxFramework Mod that Faster Paths depends on throwing up an error in the Logs).
                        • Seasonal Buildings: It seems like it's working? I don't see any issues with my house but I don't have any of the seasonal houses images and I can't find a folder for them in the Mod's folder nor in the Resources folder with the other xnb's.
                        • Get Dressed: Not Working, doesn't spawn the Dresser into the corner of the room as well as not adding the 109 Accessories to Clothing Customisation.
                        • CJB Item Spawner: Not working, the "P" hotkey isn't opening any interface.
                        Attached the new Log, hit me up if there's anything else you need :)
                         

                          Attached Files:

                        • TenkoKuugen

                          TenkoKuugen Scruffy Nerf-Herder

                          I've recently, after the 1.3 SMAPI update(I did go back and made sure to download it again, in case of new commits, and test this out and yes, still happening), run into an... interesting issue that I could reproduce but only in a strange way.
                          Seemingly at random, opening one of the selection screens of the community center bundles would just CTD me instantly. If I could open them once it would persist fine but upon rebooting the game, it was a throw of the dice all over. I am talking about the screen that pops up when you hit the glowing boxes on the floor, not individual bundles.
                          I do a fair bit of modding games myself, so I suspected the game just ran out of memory to assign but with nearly 4GB of RAM open, that doesn't really sound likely. (Still, seen stranger things)

                          The meaningful part of the log would be this

                          [21:05:05 ERROR SMAPI] An error occured in the overridden draw loop: System.ObjectDisposedException: Cannot access a disposed object.
                          Object name: 'Texture2D'.
                          at Microsoft.Xna.Framework.Helpers.CheckDisposed(Object obj, IntPtr pComPtr)
                          at Microsoft.Xna.Framework.Graphics.TextureCollection.set_Item(Int32 index, Texture value)
                          at Microsoft.Xna.Framework.Graphics.SpriteBatch.RenderBatch(Texture2D texture, SpriteInfo[] sprites, Int32 offset, Int32 count)
                          at Microsoft.Xna.Framework.Graphics.SpriteBatch.Flush()
                          at Microsoft.Xna.Framework.Graphics.SpriteBatch.End()
                          at StardewModdingAPI.Inheritance.SGame.Draw(GameTime gameTime) in D:\source\SMAPI\src\StardewModdingAPI\Inheritance\SGame.cs:line 753


                          Full log is at
                          http://pastebin.com/pvyVLdaa
                          (the lot of ALL errors are thrown by the mod clean up crew)
                          (The Game Room ALL error is from an extended cellar mod.)
                          Full mod list at http://imgur.com/a/P2Lac

                          I tried removing the entire mods folder and that got rid of the error. Because it is so unreliable to trigger (but so devastating when it happens) it makes it difficult to tell when exactly I removed the right mod since it might just be a lucky attempt and the CTD might not trigger.
                           
                          • joyous.ariella

                            joyous.ariella Space Penguin Leader

                            Woagh. You guys are awesome.

                            Not sure where to mention this, or even if this tutorial was created by @Pathoschild, but at http://canimod.com/guides/creating-a-smapi-mod#creating-a-minimal-mod there are instructions on how to change the .NET framework in Visual Studios which is outdated (you can't right-click on the project tab to get to the Applications tab in Visual Studios 2015). Here is a link to the current instructions which you may want include :3

                            https://msdn.microsoft.com/en-us/library/bb772098(v=vs.90).aspx

                            Screenshot of the instructions from the Microsoft page:
                            upload_2016-12-7_16-31-8.png

                            Screenshots of how it looks in Visual Studios 2015:
                            upload_2016-12-7_16-33-43.png
                            upload_2016-12-7_16-34-58.png

                            You can also get to it by double-clicking the Properties tab in the Solution Explorer:
                            properties.JPG
                            Hope that helps modders which may be unfamiliar with VS 2015! (Like me lol. I'm a "Notepad++ for everything" kind of gal) :)
                             
                              Last edited: Dec 7, 2016
                            • joyous.ariella

                              joyous.ariella Space Penguin Leader

                            • Pathoschild

                              Pathoschild Tiy's Beard

                              Thanks again! At a glance:
                              • The EntoaroxFramework error doesn't have enough details; I'll attach a preview of SMAPI 1.4 which fixes that.
                              • Seasonal Buildings seems to have a compatibility bug on Mac. I posted a message in the Seasonal Buildings thread.
                              • Get Dressed needs a small fix for compatibility with Linux/Mac. It seems the author was willing to update the mod for Linux/Mac and was just waiting for the dust to settle on Mac support; I posted a message in the Get Dressed thread.
                              • CJB Item Spawner has no errors in the log, but maybe it broke because of the other errors.
                              I attached a preview build of the upcoming SMAPI 1.4 release, which adds more details for one of the errors in your log. (It also revamps how SMAPI rewrites mods for Linux and Mac, and fixes the SMAPI terminal not appearing by default on Mac.)

                              Please...
                              1. Remove Get Dressed and Seasonal Buildings.
                              2. Install the attached version of SMAPI.
                              3. Try using CJB Item Spawner again.
                              4. Reply with your latest log file. Also, did a SMAPI terminal window open alongside your game?
                               

                                Attached Files:

                              • Pathoschild

                                Pathoschild Tiy's Beard

                                Unfortunately the error isn't specific enough to pinpoint a specific mod. Try this:
                                • Remove half of your mods.
                                  • a. If that fixes the issue, put them back and remove the other half.
                                    • a-i. If that also fixes the issue, then it's probably not a specific mod. It might be a memory issue like you said, or maybe an interaction between mods.
                                    • a-ii. If that doesn't fix the issue, one of the mods in the first half is probably at fault.
                                  • b. If that doesn't fix the issue, put them back and remove the other half.
                                    • b-i. If that fixes the issue, one of the mods in the second half is probably at fault.
                                    • b-ii. If that doesn't fix the issue, it's probably not a specific mod. We'll need to investigate further.
                                Ideally the answer to that will help narrow down the issue.
                                 
                                • Pathoschild

                                  Pathoschild Tiy's Beard

                                  You can get to the applications tab by right-clicking, but I accidentally left out a step. That should be fixed now. I also updated the wiki to link to canimod. Thanks for pointing these out! :)
                                   
                                    joyous.ariella likes this.
                                  • joyous.ariella

                                    joyous.ariella Space Penguin Leader

                                    @Pathoschild no problem! Glad you weren't like "geez this girl :urgh:" lol
                                    I only mean to be of help :3
                                     
                                      Pathoschild likes this.
                                    • TenkoKuugen

                                      TenkoKuugen Scruffy Nerf-Herder

                                      As I said before, it isn't that easy as I wasn't able to reliably trigger the issue even with all mods running. An easy way to circumvent the issue, I found, is to use save anywhere in front of the center since I didn't see the error come up anywhere else. (Although the movement mod did thoroughly break special events and I removed that since. It also broke the save anywhere functionality that put you back to where you saved)
                                      I'd rather restart the game the few times I will have to use the bundles than spend hours upon hours upon hours trying to force the error to track down which mod, if at all, or which conflict, if at all, is responsible.
                                       
                                      • Pathoschild

                                        Pathoschild Tiy's Beard

                                        @TenkoKuugen that's fair. If anyone else reports a similar issue, I'll see what their setup has in common with yours. If you ever do figure it out, let us know! :)
                                         
                                        Thread Status:
                                        Not open for further replies.

                                        Share This Page