Tool SMAPI: Stardew Modding API

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

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

    Nurio Cosmic Narwhal

    At this point, I can't find out what's wrong exactly. I wish I could do more to help, but it appears we have to wait for someone more knowledgeable to come around.
    My money is still on the theory that it's looking into GAC_64 instead of GAC_32 for these things or something like that...
     
      Yunix likes this.
    • ClxS

      ClxS Pangalactic Porcupine

      XNA 4.0 was never converted to 64-bit before it was deprecated, so only 32-bit versions of it exist. Still works in 64-bit Windows though. :)
      It's a bit of a hack, but if you copy that Microsoft.Xna.Framework.Graphics.dll from the folder you found it in to be next to the Stardew Valley.exe, that should make it work again. No idea why it stopped working in the first place though.
       
      • Yunix

        Yunix Big Damn Hero

        I have now made a copy of the dll and placed into the same folder where game and smapi exe are. Still same error.
         
        • lfc7

          lfc7 Intergalactic Tourist



          Any particular reason there are about 30 smapi variations? Leading to mods being messed up. What would be the reason to have version 40? What would someone gain? why can't the future changes be done on 39 (all 10 versions of it)?
           
          • Nurio

            Nurio Cosmic Narwhal

            It has so many versions because it gets updated fairly regularly, so new features and fixes are released constantly. As for what we gain from this? ...The new features and fixes, naturally.
            You also seem to be mistaking version 0.39 with a version 39.0. You'll find that a lot of programs and games have version numbers like these. Heck, Stardew Valley itself is up to version 1.07 (and that doesn't include all beta versions), but I don't see anyone wondering why there are 7 versions of it, because that's, frankly, a bit of a silly question. There's only one Stardew Valley that has been updated a few times. Just the same, the question "why future changes can't be done on 39" is a bit silly, since the numbering is more a convention than anything. It's not as if 0.40 is suddenly an entirely new SMAPI or anything. It's simply an updated version over 0.39
            All mods that rely on the 0.39 SMAPI can also be run on the 0.40 SMAPI, so there is no reason whatsoever not to upgrade.
             
            • ClxS

              ClxS Pangalactic Porcupine

              Like Nurio said! :)
              Software is developed iteratively. The 10 versions didn't just come out at once, but there was an initial version released, then some new features were added and a new version was released, then more features added and a new version released. Games follow the same process but use "patches". Stardew Valley is up to 1.07, but versions 1.00, 1.01 and so on still exist as separate things, they're just automatically patched. Automatic patches like games use would be possible to apply to SMAPI but it'd be overkill and would cause far more problems than it solves.

              Versioning like this is used to make it obvious when something has changed which may break older mods and since the version is outputted in the log, it helps spot when an error someone is having is due to them just not updating, or trying to use a mod which uses something which changes from when the mod was first developed.
               
                Last edited: Apr 13, 2016
                Superior_s and Gyumaou like this.
              • Can1s_Major

                Can1s_Major Void-Bound Voyager

                So I've got SMAPI 0.40 installed, with a total of 18 mod .DLLs in both /appdata/roaming/stardewvalley/mods and steam/steamapps/common/stardewvalley/mods. When I run the SMAPI .exe, it only loads 5 mods, twice each. Each of my mods are in their own separate file within each mod folder and SMAPI seems to not be recognizing them. Any ideas?
                 
                • nbatucan

                  nbatucan Space Hobo

                  [06:02:58.433 PM] XNA LoadContent
                  [06:02:58.804 PM] Initializing Debug Assets...
                  [06:02:58.808 PM] Game failed to start: System.MissingMethodException: Method not found: 'Int32 StardewValley.Game1.getMouseX()'.
                  at StardewModdingAPI.Inheritance.SGame.Update(GameTime gameTime)
                  at Microsoft.Xna.Framework.Game.RunGame(Boolean useBlockingRun)
                  at StardewModdingAPI.Program.RunGame()



                  help??
                   
                  • Nurio

                    Nurio Cosmic Narwhal

                    Are all the mods in their own separate folder with their own manifest.json file?
                     
                    • Nurio

                      Nurio Cosmic Narwhal

                      Are you running the latest Stardew Valley (1.07) and latest SMAPI (0.40.0)?
                       
                      • Can1s_Major

                        Can1s_Major Void-Bound Voyager

                        Ah, some of them are missing their manifest.jsons. Thanks.
                         
                        • Rui

                          Rui Scruffy Nerf-Herder

                          Hi again! Could someone explain to me the purpose of the files in the Entities folder? Clearly it's a very WIP area, but I would still like to know! Especially as I am very interested in making an NPC-heavy mod and am interested in perhaps helping out on the SNpc file. Thank you!

                          As a side note, I am having a heck of a time trying to figure out lambda expressions, like the one in SPlayer.cs. For example,

                          public static List<Farmer> AllFarmers => Game1.getAllFarmers();

                          Why use a lambda expression instead of a simple assignment (=) operator? I could have sworn I saw the explanation for this somewhere, but for the most part when I look up lambda expressions I just get stuff about delegates and anonymous functions...
                           
                            Last edited: Apr 14, 2016
                          • ClxS

                            ClxS Pangalactic Porcupine

                            I was going to be using it to place all the API layer overloads to make adding stuff like custom items/npcs and stuff easier.
                            I've decided to ditch that idea though and I've moved on to working on a successor API to SMAPI, so I'll only really be do important fixes with SMAPI rather than adding any new features myself.
                            The new one is quite a long way away for now though, so it'll have fully support for SMAPI mods when it releases so there wont be a big split between the two.
                            It's in a repository here if you want to have a look: https://github.com/ClxS/Stardew-Farmhand :)

                            So yeah for new NPC functions I'm going to put them here: https://github.com/ClxS/Stardew-Farmhand/tree/master/Libraries/Farmhand/API
                            Custom recipes are working now, I'm working on custom items at the moment, then buildings, and I'll move onto NPCs after that. Happy to hear anything you come up with using SMAPI though, since everything is useful! :)
                             
                              XaviiKinz likes this.
                            • Rui

                              Rui Scruffy Nerf-Herder

                              Excellent! Thank you so much. Is the Farmhand a personal project or will you be accepting pull requests to that as well? Though I doubt that I would be able to contribute anything useful for awhile even if you did. :rofl: I've mostly been doing a lot of looking around. I'm starting to get an idea of how the NPCs work and are populated into the game, but APIs are still a little above my head. Also strings... what even is string processing in C#... time to go back and do some more research I suppose |D
                               
                              • ClxS

                                ClxS Pangalactic Porcupine

                                Pull requests are definitely welcome! :)
                                I'm hoping the community starts developing it once it releases so that it can continue on for longer than my own involvement in it. I'll eventually move on to other projects and would hate for the API to just die. :)
                                 
                                • dakeyoni

                                  dakeyoni Space Hobo

                                  Hi I'm having a problem running this mod. The error that comes out in the cmd was :
                                  Code:
                                  C:\Users\Aki64\AppData\Roaming\StardewValley\ErrorLogs\MODDED_ProgramLog.Log_LAT
                                  EST.txt
                                  Created log instance
                                  System.MissingMethodException: Method not found: 'System.Threading.Tasks.Task Sy
                                  stem.Threading.Tasks.Task.Run(System.Action)'.
                                     at StardewModdingAPI.Log.AsyncColour(Object message, ConsoleColor colour)
                                     at StardewModdingAPI.Log.AsyncY(Object message)
                                     at StardewModdingAPI.Program.Main(String[] args)
                                  
                                  Any idea what does that mean? (@-@)
                                   
                                    Alicia-kun likes this.
                                  • ClxS

                                    ClxS Pangalactic Porcupine

                                    Not at home so I can't check to be sure, but I think you need to install .net 4.5
                                     
                                    • dakeyoni

                                      dakeyoni Space Hobo

                                      Thanks for the reply. I did just that and it worked now. (^▽^)
                                       
                                      • Consillium

                                        Consillium Poptop Tamer

                                        I'm running into a situation where I'm trying to set the pet behavior based on keyboard input (i.e. if right shift clicked, set pet.CurrentBehavior = Pet.behavior_Sit_Down), however, the result seems to be conflicting with whatever the pets internal update method is doing, so I get a cat that keeps performing the sit down animation over and over again. Does anyone have any thoughts to how I can handle that sort of situation?
                                         
                                        • natelovesyou

                                          natelovesyou Oxygen Tank

                                          I'm just now checking out modding the game, and I'm a little confused by the versions for SMAPI. I see the latest version is labeled as being for 1.07, but I've prevented Steam from updating my game so I'm still on 1.051 since I wasn't ready to update (more expensive beehives and kegs). So am I out of luck? It's the only version on github that the uploader even bothered putting a SV version number on, so I'd like some clarification please. :)
                                           
                                          Thread Status:
                                          Not open for further replies.

                                          Share This Page