Tool SMAPI: Stardew Modding API

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

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

    Pathoschild Tiy's Beard

    SMAPI 1.14 is now available on Linux/Mac/Windows!

    Highlights
    This adds two big features:
    • Mod translations: mods can now be translated into any language supported by the game. This uses simple JSON files that are easy to edit, so players don't need any technical experience to submit translations for translatable mods. (See API reference for details.)
    • Mod dependencies: if one mods need another, it can now say so in its manifest.json file. SMAPI will make sure mods are loaded in the right order, and show a friendly error if a mod is missing. (See API reference for details.)
    This update also adds friendly errors for many common problems (like running SMAPI from the wrong folder), better support for loading custom maps, better mod detection to avoid "unknown mod" deprecation warnings, a fix for libgdiplus.dylib errors on Mac, and more.

    Release notes
    Changes for players:
    • SMAPI now shows friendly errors when...
      • it can't detect the game;
      • a mod dependency is missing (if it's listed in the mod manifest);
      • you have Stardew Valley 1.11 or earlier (which aren't compatible);
      • you run install.exe from within the downloaded zip file.
    • Fixed "unknown mod" deprecation warnings by improving how SMAPI detects the mod using the event.
    • Fixed libgdiplus.dylib errors for some players on Mac.
    • Fixed rare crash when window loses focus for a few players.
    • Bumped minimum game version to 1.2.30.
    • Updated mod compatibility list.
    Changes for modders:
    • You can now add dependencies to manifest.json (see API reference).
    • You can now translate your mods (see API reference).
    • You can now load unpacked .tbin files from your mod folder through the content API.
    • SMAPI now automatically fixes tilesheet references for maps loaded from the mod folder.
      When loading a map from the mod folder, SMAPI will automatically use tilesheets relative to the map file if they exists. Otherwise it will default to tilesheets in the game content.
    • Added Context.IsPlayerFree for mods that need to check if the player can act (i.e. save is loaded, no menu is displayed, no cutscene is in progress, etc).
    • Added Context.IsInDrawLoop for specialised mods.
    • Fixed smapi-crash.txt being copied from the default log even if a different path is specified with --log-path.
    • Fixed the content API not matching XNB filenames with two dots (like a.b.xnb) if you don't specify the .xnb extension.
    • Fixed debug command output not printed to console.
    • Deprecated TimeEvents.DayOfMonthChanged, SeasonOfYearChanged, and YearOfGameChanged. These don't do what most modders think they do and aren't very reliable, since they depend on the SMAPI/game lifecycle which can change. You should use TimeEvents.AfterDayStarted or SaveEvents.BeforeSave instead.
    As always, feel free to post bugs/suggestions/comments in this thread. :)
     
      Last edited: Jun 3, 2017
      animotiks and Karmylla like this.
    • snacklemore151

      snacklemore151 Void-Bound Voyager

      Hey there - I'm new to modding in Stardew Valley and was wondering why my game crashed when I went to sleep for the day.

      Here is a Google drive link to my crash log.
      https://drive.google.com/open?id=0B3oqPZOaGPECV3ZGTHlLYW55VVk

      I can see there are many instances of a certain mod calling for data that doesn't exist during mouse-over events, but it doesn't seem like that caused the crash.

      At the bottom of the log there are dozes of errors related to some update loop that seems to be the cause of the crash.

      "
      [20:38:59 ERROR SMAPI] An error occured in the overridden update loop: System.NullReferenceException: Object reference not set to an instance of an object.
      at StardewValley.Game1.Update(GameTime gameTime)
      at StardewModdingAPI.Framework.SGame.Update(GameTime gameTime) in D:\source\_Stardew\SMAPI\src\StardewModdingAPI\Framework\SGame.cs:line 240
      "

      Any way for me to solve this problem?

      Thank you!

      edit: I don't know the escape characters on this forum, so you're gonna have to work around the emojis
       
      • juliakoppe05

        juliakoppe05 Void-Bound Voyager

        Hello o/ The last version of smapi (1.14 and 1.13) dont change the grass. The floor still the original. Still "vanilla" and dont change to "new". Can you help me pls? And thank you so much for your hard work :3[​IMG]
         
          Last edited: Jun 3, 2017
        • Pathoschild

          Pathoschild Tiy's Beard

          I see you also posted in the how to fix mods broken in Stardew Valley 1.2 thread, so I'll help you there. :)

          Those errors may be due to outdated XNB files. Try this:
          1. Back up any XNB mods you want to keep. (Those are files you put under Content instead of Mods.)
          2. Verify your game integrity to reset your content files to default. That won't affect SMAPI mods, but any XNB mods will be removed.
          3. Check whether the problem still happens.
          4. If the problem is fixed, reinstall any XNB mods one at a time. Check after each install whether the problem is back.
           
          • snacklemore151

            snacklemore151 Void-Bound Voyager

            Thanks Pathos - I shouldn't have any content mods, just a hand full of small mods in the MOD folder, but a file verification should help. I'll try it out and see what happens.

            Alright, so it crashed again at the same point. Null reference exeption. Is it due to SMAP looking in the wrong folder? I don't have a "D" drive... (EDIT, my 'D' drive is a logical/clone cd drive)

            [08:33:15 ERROR SMAPI] An error occured in the overridden update loop: System.NullReferenceException: Object reference not set to an instance of an object.
            at StardewValley.Game1.Update(GameTime gameTime)
            at StardewModdingAPI.Framework.SGame.Update(GameTime gameTime) in D:\source\_Stardew\SMAPI\src\StardewModdingAPI\Framework\SGame.cs:line 240


            Also, hey Pathoschild, i have one of your mods loaded! LookupAnything :p


            Seems to be one of my mods thats breaking SMAPI, i'll post when i figure out which one.

            Hmm. So I loaded each of my mods in one by one, with a day passed between each mod loaded. No errors after loading in each of the 6 UI mods. No errors. When I restored my original save file, game crashed at days end, like before. Curious. Seems like there is a path to getting all the mods loaded in, but not all during the same day cycle. Hotfix for now, problem still exists.

            Thanks for your help!
             
              Last edited: Jun 3, 2017
            • Borodin

              Borodin Oxygen Tank

              Just a thought, but try removing half of your mods, and then running the game. If it works, load in the ones you removed, one at a time, etc.
               
              • Pathoschild

                Pathoschild Tiy's Beard

                Nope. It's a bit confusing, but you can ignore the paths in the stack trace. That's just the original source code path (i.e. that's where the SMAPI code exists on my machine).

                I'm guessing one of your mods is doing something that breaks on that first day. Try doing what Borodin suggests (and restoring your save file after each test) to see if that first day crashes when a particular mod is installed.
                 
                • SheepMilks

                  SheepMilks Phantasmal Quasar

                  I need help ;w;
                  I can play the game, but as soon as I go to sleep it crashes!
                  I've tried every which way.. I just can't figure it out! I even tried playing it normally without
                  mods, and it crashed! ;w;
                  here is the thing it told me to send ;w;

                  I hope someone can help me T___T /
                   

                    Attached Files:

                  • Borodin

                    Borodin Oxygen Tank

                    For one thing, Night Owl is currently broken. It's not for me to say, but you might want to check the status of each mod you run.
                     
                    • Pathoschild

                      Pathoschild Tiy's Beard

                      Hi @SheepMilks. Does the crash still happen if you remove Night Owl?
                       
                      • Pathoschild

                        Pathoschild Tiy's Beard

                        SMAPI 1.14.1 is now available on Linux/Mac/Windows!

                        This is an optional update which makes the new helper.Translation.GetTranslations method more useful for modders. If you're a modder planning to use that method, you should update first since there's no backwards-compatibility for the version introduced yesterday. Otherwise there's no need to update — the change will be included in SMAPI 1.15 in two weeks.
                         
                        • SheepMilks

                          SheepMilks Phantasmal Quasar

                          yes ;w; ~ just tried it!
                           

                            Attached Files:

                          • SheepMilks

                            SheepMilks Phantasmal Quasar

                            forgot this file too
                             

                              Attached Files:

                            • Pathoschild

                              Pathoschild Tiy's Beard

                            • SheepMilks

                              SheepMilks Phantasmal Quasar

                            • chandeliermon

                              chandeliermon Big Damn Hero

                              Hello, my game is crashing when I hover over anything that is not a tool (it crashed after doing it a few times). I am using the updated UI Info Suite (http://www.nexusmods.com/stardewvalley/mods/1150/?) but no one else is reporting this error. Numbers on stacks do not show up and the cursor freezes at the edge of the icon of the object also.
                               

                                Attached Files:

                              • demonhunter352

                                demonhunter352 Subatomic Cosmonaut

                                Sounds like you have an outdated ObjectInformation.xnb. I had a similar issue with EvenMoreCropsUnofficialContinuation when SDV updated.
                                 
                                • chandeliermon

                                  chandeliermon Big Damn Hero

                                  @demonhunter352 oh ok. I am using the XnbLoader and there is an ObjectInformation.xnb in there that must be from another mod... I will try to find out which one it's from and post and update

                                  UPDATE: Found it! It was from Geode and Treasure Overhaul which has not been updated for 1.2. I deleted it and now everything works, thank you!
                                   
                                    Last edited: Jun 6, 2017
                                  • Zyte_

                                    Zyte_ Big Damn Hero

                                    Hello guys. I'm looking for some help with my savegame.

                                    When I load my farm the screen gets black and game crashes. Workaround: Create a new game, save on the 1st day and then go back to menu and reload the main save. I have to reload that new savegame everytime I re-open the game but, if keep playing with the new save, some days later (in-game) it gets corrupted too. So I can continue my gameplay with this workaround, but I'd love to get rid of this.

                                    Here is my crash log, thanks for your help!
                                     

                                      Attached Files:

                                    • Pathoschild

                                      Pathoschild Tiy's Beard

                                      Hi @Zyte_. Try updating to the latest Stardew Valley 1.2.30 to fix that error.
                                       
                                      Thread Status:
                                      Not open for further replies.

                                      Share This Page