Tool SMAPI: Stardew Modding API

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

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

    jahangmar Sandwich Man

    In the handler for the Events.Player.Warped event, the positions for the player and horse
    Code:
    Game1.player.getTileX() //same for Y
    Game1.player.mount.getTileX() // same for Y
    
    are still the old positions for the old map if, and only if the player is mounted.
    If not mounted, the positions are the ones for the new map as expected.

    I'm reporting this here since I'm not sure if that is a smapi bug.
     
    • Pathoschild

      Pathoschild Tiy's Beard

      @jahangmar That's an issue with the game code, unrelated to SMAPI. This should work more reliably though:
      Code:
      Vector2 tile = new Vector2((int)(Game1.player.Position.X / Game1.tileSize), (int)(Game1.player.Position.Y / Game1.tileSize));
      
       
      • paxchristos

        paxchristos Scruffy Nerf-Herder

        I'm trying to join my wife's single player game that turned into a multiplayer game.

        She built a cabin, went to bed and saved, then exited to title and reloaded as a co-op game. When I try to join, I CTD when I get to the create a new farmhand page, with Advanced Location Loader being the last error message shown.
        EDIT: Waited 1 in game day, joined and no CTD.
         
        • jahangmar

          jahangmar Sandwich Man

        • Mizzion

          Mizzion Phantasmal Quasar

          Can you go to https://log.smapi.io and follow the instructions on the site, then share the link with us. This will give us more info to help you with.
           
          • paxchristos

            paxchristos Scruffy Nerf-Herder

            My edit wasn't clear enough, apparently.

            Game worked fine, no crashes at all on joining after waiting for 1 day to cycle after my wife changed from Single Player to Multiplayer.

            If you're still curious about the crash, here's the log. Error that crashed it was a null pointer exception in ALL, but not too much more info is in the log.

            Pax

            ETA: Odd thing is I can't see any JSON Asset mods (the show up as empty squares for crops/trees/machines on the ground, or empty slots in chests for inventory items) even though both games have the exact same mods.
             
            • Zanderlei

              Zanderlei Void-Bound Voyager

              I'm 99% sure of what's causing my issue (the optional cave in Omnifarm, log here: https://log.smapi.io/WW0qqEhB ), is there a way to make it work or am I resigned to the default cave until some update in the future?
               
              • Pathoschild

                Pathoschild Tiy's Beard

                @paxchristos I'm not sure how Json Assets works in multiplayer, since it dynamically assigns IDs. It might be best to ask on the mod page instead.

                @Zanderlei Yep, the optional cave is broken. If the author doesn't update it for the upcoming Stardew Valley 1.4, I'll update it then and fix the cave too.
                 
                  paxchristos likes this.
                • Celestral

                  Celestral Void-Bound Voyager

                  [Solution at bottom since I figured it out while typing]
                  I'm having some issue with my first mod (custom NPC).
                  Currently the content.json, mostly copy + pasted with a few tweaks to file locations:


                  Code:
                  {
                      "Format": "1.9",
                      "Changes": [
                          {
                              "LogName": "Sprites",
                              "Action": "Load",
                              "Target": "Characters/A",
                              "FromFile": "assets/Image/sprites.png"
                          },
                          {
                              "LogName": "Portraits",
                              "Action" : "Load",
                              "Target" : "Portraits/A",
                              "FromFile:" : "assets/Image/portraits.png"
                          },
                          {
                              "LogName" : "Dialogue",
                              "Action" : "Load",
                              "Target" : "Characters/Dialogue/A",
                              "FromFile" :"assets/Dialogue/dialogue.json"
                          },
                          {
                              "LogName" : "Schedule",
                              "Action" : "Load",
                              "Target" : "Characters/schedules/A",
                              "FromFile" :"assets/Schedule/schedule.json"
                          },
                          {
                              "LogName": "NPC Dispositions",
                              "Action": "EditData",
                              "Target": "Data/NPCDispositions",
                              "Entries": {
                                "A": "adult/rude/neutral/positive/male/datable//Town/summer 7//BusStop 19 4/Dobson"
                              }
                          },
                          {
                              "LogName": "Gift tastes",
                              "Action": "EditData",
                              "Target": "Data/NPCGiftTastes",
                              "Entries": {
                                "A": "You're giving this to me? This is amazing!/207 232 233 400/Thank you! This is a very interesting specimen./-5 -79 422/...What is this?/80 330/This is disgusting./2/That was very thoughtful of you./-4/ ",
                              }
                          }
                      ]
                  }
                  I'm getting this error/warning upon startup of SMAPI:
                  Code:
                  [Content Patcher] Ignored NPC A > Portraits: must set the FromFile field for this action type.
                  As can be seen above, I have set the FromFile field, so I don't understand what th----

                  Actually I see the problem right at this very moment of typing. I have decided to post anyway so if anyone has this problem in the future they might want to check the same thing:
                  Code:
                  {
                              "LogName": "Portraits",
                              "Action" : "Load",
                              "Target" : "Portraits/A",
                              "FromFile:" : "assets/Image/portraits.png"
                          },
                  There is a ':' after FromFile, before the double quotations.
                  Visual Studio Code did not give me a warning since this is is a valid JSON structure.
                  I've been working on this problem for about 2 hours I'm gonna go jump out of a window xD
                  The funny thing is that I actually rewrote "FromFile" at least once by double clicking the key and rewriting it just to make sure, but since the ':' was not part of the string, that remained the same.

                  kthxbye
                   
                  • captainbutz

                    captainbutz Void-Bound Voyager

                    @Pathoschild

                    This might be a dumb question but what do you mean? I took all the mods with TMX in them but the game crashes in the same way, am I doing something wrong?
                     
                    • Pathoschild

                      Pathoschild Tiy's Beard

                    • ninihanini

                      ninihanini Void-Bound Voyager

                      Hello. I have problems with SMAPI. It crashes every time I try to go to sleep. This problem happens a few days before the second childbirth. I tried using the old save file, it worked at first but when the second birth is getting nearer SMAPI crashes again. I really hope someone can help, thanks :)

                      https://log.smapi.io/rbMy8KsE
                       
                      • Pathoschild

                        Pathoschild Tiy's Beard

                        @ninihanini The error is due to invalid dialogue data. Does it still happen if you temporarily remove Canon-Friendly Dialogue Expansion?
                         
                        • ninihanini

                          ninihanini Void-Bound Voyager

                          Thanks for the fast reply. Yes, it still happen :(
                           
                          • Pathoschild

                            Pathoschild Tiy's Beard

                          • ninihanini

                            ninihanini Void-Bound Voyager

                            Okay I will :)
                             
                            • SstasSunN

                              SstasSunN Void-Bound Voyager

                              Hello, I have the same problem as Adalborj. I want to start the summer, but the game crashes. The point is in the file "Summer_beach.PNG" (and not only) I don’t have it at all. I don’t know how to solve the problem, please help. (my journal is https://log.smapi.io/PacXgEEi)
                               
                              • Pathoschild

                                Pathoschild Tiy's Beard

                                @SstasSunN That's an error with Sundrop City; try reinstalling that mod to fix it. If that doesn't work, I suggest asking on the Sundrop City mod page and removing the mod temporarily.
                                 
                                • Fairycake

                                  Fairycake Scruffy Nerf-Herder

                                  Hm I'm having some trouble and I haven't run into this problem before, so hopefully someone knows what's going on. For some reason, I'm having trouble getting the game to start up with content patcher mods. Whenever I place content patcher mods into the mods folder, the game freezes. Like everything in terminal looks right as far as SMAPI goes, but the game window is just a black screen and when I right click on the game icon on my dashboard it gives me the "application not responding" message. I play on a Mac and have never run into this issue before. Any ideas? :/
                                   
                                  • Pathoschild

                                    Pathoschild Tiy's Beard

                                  Thread Status:
                                  Not open for further replies.

                                  Share This Page