Modding Help Mod error

Discussion in 'Starbound Modding' started by PlatinumFrog, Feb 17, 2016.

  1. PlatinumFrog

    PlatinumFrog Scruffy Nerf-Herder

    I made a .object (Json) and ran it through JSONLint and it didn't have any errors, but when I run it in Starbound, the game crashes and I get this error in the log:

    Error: Exception raised during Root finishLoad: (ObjectException) Error loading object '/objects/crafting/craftingtable.object': (JsonException) Improper Conversion to int from string

    why is it trying to convert a string to an integer? Here is my code:
    Code:
    {  
        "objectName" : "craftingtable",
        "rarity" : "Common",
        "printable" : false,
        "description" : "Now I can craft items!",
        "shortdescription" : "Crafting Table",
        "subtitle" : "It's a crafting table!",
        "race" : "generic",
        "category" : "Crafting",
        "price" : "100",
      
        "inventoryIcon" : "craftingtable.png",
        "orientations" : [
          {
            "duelImage" : "craftingtable.png",
            "imagePosition" : [-16, 0],
            "frames" : 1,
            "animationCycle" : 1.0,
          
            "spaceScan" : 0.1,
            "anchors" : [ "bottom" ],
            "collision" : "platform"
        }
      ]
    }
     
  2. The | Suit

    The | Suit Agent S. Forum Moderator

    Because you put an integer as a string.
    Code:
    "price" : "100",
    Numbers cannot be in quotes.
     
    Relten and Dunto like this.
  3. PlatinumFrog

    PlatinumFrog Scruffy Nerf-Herder

    Oh thx missed that!

    now my mod is giving me the error: Improper conversion to Json array from object. what does that mean?
     
    Last edited by a moderator: Feb 18, 2016
  4. Mackinz

    Mackinz The Waste of Time

  5. PlatinumFrog

    PlatinumFrog Scruffy Nerf-Herder

    That error was from starbound.log. I already read that article. Also, there are error windows? I've never had one pop up.

    The error was a product of my .object script and the code is at the top of the discussion.
     
    Last edited by a moderator: Feb 18, 2016
  6. lazarus78

    lazarus78 The Waste of Time

    You can use this site to check for json syntax errors.

    http://jsonlint.com

    Granted it doesn't catch the "100" error...
     
  7. PlatinumFrog

    PlatinumFrog Scruffy Nerf-Herder

    I already know about Jsonlint and it says that code is correct.
     
  8. Peelz

    Peelz Giant Laser Beams

    Try removing the "subtitle" line.
     
    Relten likes this.
  9. PlatinumFrog

    PlatinumFrog Scruffy Nerf-Herder

    thx, It's fixed
     
  10. PlatinumFrog

    PlatinumFrog Scruffy Nerf-Herder

    case now closed
     
  11. PlatinumFrog

    PlatinumFrog Scruffy Nerf-Herder

    Case not closed...
    I made a .recipe for my crafting table, but the game crashes and the starbound.log says:
    Caused by: (JsonParsingException) Error parsing json: expected JSON object or array at top level at 1:1
    I think it has to the bracket at 1:1 (that's the only thing there) but I closed it at 11:1 so it shouldn't give me errors. I also ran it through JSONLint and it said it was fine.
    Here is my code:
    Code:
    {
      "input" : [
        { "item" : "darkwoodmaterial", "count" : 15 },
        { "item" : "titaniumbar", "count" : 3 }
      ],
      "output" : {
        "item" : "craftingtable",
        "count" : 1
      },
      "groups" : [ "roboticcraftingtable" ]
    }
     
  12. PlatinumFrog

    PlatinumFrog Scruffy Nerf-Herder

    Nevermind, I fixed it :)
     
  13. PlatinumFrog

    PlatinumFrog Scruffy Nerf-Herder

    I have no idea what is causing it but I'm getting a parsing error:
    Caused by: (JsonParsingException) Error parsing json: bad string, should be '"' at 30:1
    in this code:
    Code:
    {
      "objectName" : "ippipe",
      "printable" : false,
      "rarity" : "Common",
      "description" : "A pipe!",
      "shortdescription" : "Pipe",
      "race" : "generic",
      "category" : "pipes",
      "price" : 100,
    
      "apexDescription" : "Pipes",
      "avianDescription" : "Pipes",
      "floranDescription" : "Pipes",
      "glitchDescription" : "Pipes",
      "humanDescription" : "Pipes",
      "hylotlDescription" : "Pipes",
      "novakidDescription" : "Pipes",
    
      "inventoryIcon" : "ippipeicon.png",
      "orientations" : [
        {
          "dualImage" : "ippipe.png:<color>",
          "imagePosition" : [-4, 4],
          "frames" : 1,
          "animationCycle" : 1.0,
          "spaceScan" : 0.1,
          "anchors" : [ "background" ]
        }
      ]
    }
    The very last line is 30, and there isn't, even a string there! :(
     
  14. Dunto

    Dunto Guest

    Please don't create more than one thread to get help with your mod issues. I've merged your threads.
     
  15. PlatinumFrog

    PlatinumFrog Scruffy Nerf-Herder

    Oops Sorry.
     
  16. Naddox

    Naddox Cosmic Narwhal

    Are you 100% sure this is the file causing the error? I see nothing wrong with it at all.
     
  17. PlatinumFrog

    PlatinumFrog Scruffy Nerf-Herder

    Yes I'm sure of it. It says so in the log.
     
  18. Naddox

    Naddox Cosmic Narwhal

    Can you post the full log please.
     
  19. lazarus78

    lazarus78 The Waste of Time

    "category": "pipes",

    Is that a valid catagory? Not sure how strict the game is on this. Ive seen it complain about similar issues where the JSON is valid, but one of the values wasn't as far as the game was concerned.
     
    Relten likes this.
  20. PlatinumFrog

    PlatinumFrog Scruffy Nerf-Herder

    I fixed it never mind. :)
     

Share This Page