Modding Help JSON Validation and Inputting Strings into Maps

Discussion in 'Mods' started by FuzzyMittens, Jan 14, 2020.

  1. FuzzyMittens

    FuzzyMittens Void-Bound Voyager

    Hello! I'm creating a custom home for my NPC and placing it in the forest! When trying to validate the JSON online, it wasn't pinpointing me in the exact direction and needless to say: I've spent over an hour going back and forth with it.

    If a fresh pair of eyes could help, I'd really appreciate it! Here is the link:
    https://smapi.io/json/content-patcher/8481b920ebf14495a86d1c79f5fcddb3

    Also, I'm using Tiled to create the interior map (I'm using the cabin as a base) and I was wondering how I would input strings/messages for the player to look at?

    Thank you!
     
    • Allayna

      Allayna Ketchup Robot

      well, it says line 29, position 22, looks like you're missing a comma in the postion property ... should be
      "position": [ 6, 6 ],

      For the map strings....
      in your content.json file you want this basic code
      {
      "Action": "EditData",
      "Target": "Strings/StringsFromMaps",
      "Entries": {
      "Modname.#": "Message Here",
      },
      },
      you would only edit the "Modname" part, and the "Message Here"

      for putting in properties on a tile in Tiled - https://stardewvalleywiki.com/Modding:Maps#Tile_properties
      follow the steps for making a new object and adding properties to an object
      you want your property to be
      action | Message Modname.#

      for instance, I have a tile on a table in my house that says "Breakfast Time!"
      so my entry is in content.json is
      "Nook.1": "Breakfast Time!"

      and the tile property is
      action | Message Nook.1
       
        Last edited: Jan 14, 2020
      • Standardheld

        Standardheld Subatomic Cosmonaut

        Hey there!

        I've put your code into Notepad++ to take look at line 29 and I noticed that your brackets (line 30 and line 31) look like they should be switched.
        And I wasn't able to figure out where the "[" open bracket to the closing one in line 32.

        Maybe this is the problem.
         
        • Allayna

          Allayna Ketchup Robot

          whoops yep there's that too! it's actually just an extra square bracket right after the position property!
          this should work - https://smapi.io/json/none/2282e9c8be31446dbc98c1225dcb24aa

          side note - welcome to coding, where a single missing or extra character BREAKS IT ALL
          and your poor tired eyes can't see what's wrong :p

          another pair of eyes works wonders!!
           
          • FuzzyMittens

            FuzzyMittens Void-Bound Voyager

            Thank you both SO MUCH! This was so helpful!
            Now I'm having an issue with the schema and loading the map itself. :(
             
            • Allayna

              Allayna Ketchup Robot

              what else is happening? I might not be able to answer soon but ill check back!
               
              • FuzzyMittens

                FuzzyMittens Void-Bound Voyager

              • Allayna

                Allayna Ketchup Robot

                I think I know what the problem is, not sure how to fix in Tiled....
                Do you have your our tile sheet you are using for interior?
                I know in tIDE you have to make sure when adding the tilesheet that it needs to be in same folder as map file
                so like in several maps i've worked on, I've added a ladder tilesheet and I have
                InProgress/forest.tbin
                InProgress/ladder_object.png

                and then in CP i load my edited map and my own tilesheet to
                Content/Maps/forest
                Content/Maps/ladder_object
                 
                • FuzzyMittens

                  FuzzyMittens Void-Bound Voyager

                  Last edited by a moderator: Jan 14, 2020
                • Allayna

                  Allayna Ketchup Robot

                  ok, i'm pretty sure that validator doesn't know how to do the addMaps and mergeMaps, so it won't validate, doesn't mean its WRONG. you may need to ask in the discord modding channel, or contact the people with the TMX mod. I know how to edit an existing map, but not how to insert new ones using TMX
                   
                  • FuzzyMittens

                    FuzzyMittens Void-Bound Voyager

                    Okay! Thank you again! It stinks because I'm simply editing a cabin into the forest to be my NPC's home and then the interior.

                    My content.json is also a bit wacky again but I think my eyes are strained.

                    https://smapi.io/json/none/f880498ea01a419e8096a36433310f22
                     
                      Last edited by a moderator: Jan 15, 2020
                    • Allayna

                      Allayna Ketchup Robot

                    • FuzzyMittens

                      FuzzyMittens Void-Bound Voyager

                      Thank you! <3 Now all I need to work on are events and getting the custom maps! You've been such a great help!

                      I spoke too soon... forgive me.
                      https://smapi.io/log/e4ed02b19e1847dbae1ae42a86642c1e
                       
                        Last edited by a moderator: Jan 15, 2020
                      • Allayna

                        Allayna Ketchup Robot

                        looks like something is wrong with the gift taste data, so it can't load the entire NPC....
                        Haven't looked at gift data in a long time.... I THINK you were just missing the ending / at the end... try this
                        "Toshinori": "For me?! Oh, thank you, @./74 227 228 351 768 614 421/I like this, @. Thank you./18 202 268 346 395 279 815/It's the thought that counts./167 184 445 446 229 814/....Thank you...?/153 154 155 157 382 769/Thank you, @./88 797 304 373/",
                         
                        • FuzzyMittens

                          FuzzyMittens Void-Bound Voyager

                          When I open up my menu with "E" that's when the error shows. :(
                           
                          • Allayna

                            Allayna Ketchup Robot

                            did that code change help? or still error? if it still errors, new log please :)
                             
                            • FuzzyMittens

                              FuzzyMittens Void-Bound Voyager

                            • Allayna

                              Allayna Ketchup Robot

                              huh.... well that did get rid of the 'bad gift taste data' message.... does the mod work at all? like the character shows up, but then you open something and it crashes?
                               
                              • FuzzyMittens

                                FuzzyMittens Void-Bound Voyager

                                He doesn't show up on the calendar meaning the game hasn't registered him as a character. I'm playing during the summer so I can check since his birthday is marked as Summer 9. I'll see what else I can do!
                                 
                                • Allayna

                                  Allayna Ketchup Robot

                                  ok, i looked at the birthday part, i THINK you have errors in the disposition! try this -
                                  "Toshinori": "adult/polite/neutral/positive/male/datable//Town/summer 9//Town 65 100 2/Toshinori"
                                   

                                  Share This Page