Modding Help Issues with helmets.

Discussion in 'Starbound Modding' started by Derpyman890, Dec 4, 2016.

  1. Derpyman890

    Derpyman890 Scruffy Nerf-Herder

    I've been working on an armour set, or at least i would be if my helmet would actually work. I copied the files for the tar cosmetic helmet over and edited them so what I needed would work, but it didn't and the helmet won't appear on my character.

    Here's the .head file for the helmet.
    Code:
    {
      "itemName" : "shaxxhelmet",
      "price" : 
    
    2500,
      "inventoryIcon" : "shaxxhelmet.png",
    
    "maxStack" : 1,
      "rarity" : "Rare",
    
    "category" : "headwear",
      "description" : 
    
    "Lord Shaxx's Helmet, or at least a copy of 
    
    it.",
      "shortdescription" : "Lord Shaxx's 
    
    Helmet",
      "tooltipKind" : "armor",
    
    
    "maleFrames" : "shaxxhelmet.png",
    
    "femaleFrames" : "shaxxhelmet.png",
      "mask" : 
    
    "mask.png",
      "colorOptions" : [
        // TAR
       
    
    { "ffca8a" : "66538d", "e0975c" : "4b3b6d", 
    
    "a85636" : "2e1e3b", "6f2919" : "080207" },
       
    
     // BLACK
        { "ffca8a" : "838383", "e0975c" 
    
    : "555555", "a85636" : "383838", "6f2919" : 
    
    "151515" },
        // GREY
        { "ffca8a" : 
    
    "b5b5b5", "e0975c" : "808080", "a85636" : 
    
    "555555", "6f2919" : "303030" },
        // WHITE
    
      { "ffca8a" : "e6e6e6", "e0975c" : "b6b6b6", 
    
    "a85636" : "7b7b7b", "6f2919" : "373737" },
       
    
     // RED
        { "ffca8a" : "f4988c", "e0975c" : 
    
    "d93a3a", "a85636" : "932625", "6f2919" : 
    
    "601119" },
        // ORANGE
        { "ffca8a" : 
    
    "ffd495", "e0975c" : "ea9931", "a85636" : 
    
    "af4e00", "6f2919" : "6e2900" },
        // 
    
    YELLOW
        { "ffca8a" : "ffffa7", "e0975c" : 
    
    "e2c344", "a85636" : "a46e06", "6f2919" : 
    
    "642f00" },
        // GREEN
        { "ffca8a" : 
    
    "b2e89d", "e0975c" : "51bd3b", "a85636" : 
    
    "247824", "6f2919" : "144216" },
        // BLUE
       
    
     { "ffca8a" : "96cbe7", "e0975c" : "5588d4", 
    
    "a85636" : "344495", "6f2919" : "1a1c51" },
       
    
     // PURPLE
        { "ffca8a" : "d29ce7", "e0975c" 
    
    : "a451c4", "a85636" : "6a2284", "6f2919" : 
    
    "320c40" },
        // PINK
        { "ffca8a" : 
    
    "eab3db", "e0975c" : "d35eae", "a85636" : 
    
    "97276d", "6f2919" : "59163f" },
        // BROWN
    
      { "ffca8a" : "ccae7c", "e0975c" : "a47844", 
    
    "a85636" : "754c23", "6f2919" : "472b13" }
    
    ]
    }
    
    
    so, can anyone tell me what is wrong with my file?
    the helmet image as well as the mask are also included.
     

    Attached Files:

  2. lazarus78

    lazarus78 The Waste of Time

    This is why formatting is very important.

    Your description is broken up into lines. You can't do this. JSON , like most other code, is read line by line, so each line must follow proper JSON syntax. Plus other formatting issues... What did you even base this off?

    Code:
    {
        "itemName": "shaxxhelmet",
        "price": 2500,
        "inventoryIcon": "shaxxhelmet.png",
        "maxStack": 1,
        "rarity": "Rare",
        "category": "headwear",
        "description": "Lord Shaxx's Helmet, or at least a copy of it. ",
        "shortdescription": "Lord Shaxx's Helmet ",
        "tooltipKind": "armor",
    
        "maleFrames": "shaxxhelmet.png",
        "femaleFrames": "shaxxhelmet.png",
        "mask": "mask.png",
       
        "colorOptions" : [
            // TAR
            {
                "ffca8a": "66538d",
                "e0975c": "4b3b6d",
                "a85636": "2e1e3b",
                "6f2919": "080207"
            },
            // BLACK
            {
                "ffca8a": "838383",
                "e0975c": "555555",
                "a85636": "383838",
                "6f2919": "151515"
            },
            // GREY
            {
                "ffca8a": "b5b5b5",
                "e0975c": "808080",
                "a85636": "555555",
                "6f2919": "303030"
            },
            // WHITE
            {
                "ffca8a": "e6e6e6",
                "e0975c": "b6b6b6",
                "a85636": "7b7b7b",
                "6f2919": "373737"
            },
            // RED
            {
                "ffca8a": "f4988c",
                "e0975c": "d93a3a",
                "a85636": "932625",
                "6f2919": "601119"
            },
            // ORANGE
            {
                "ffca8a": "ffd495",
                "e0975c": "ea9931",
                "a85636": "af4e00",
                "6f2919": "6e2900"
            },
            //YELLOW
            {
                "ffca8a": "ffffa7",
                "e0975c": "e2c344",
                "a85636": "a46e06",
                "6f2919": "642f00"
            },
            // GREEN
            {
                "ffca8a": "b2e89d",
                "e0975c": "51bd3b",
                "a85636": "247824",
                "6f2919": "144216"
            },
            // BLUE
            {
                "ffca8a": "96cbe7",
                "e0975c": "5588d4",
                "a85636": "344495",
                "6f2919": "1a1c51"
            },
            // PURPLE
            {
                "ffca8a": "d29ce7",
                "e0975c": "a451c4",
                "a85636": "6a2284",
                "6f2919": "320c40"
            },
            // PINK
            {
                "ffca8a": "eab3db",
                "e0975c": "d35eae",
                "a85636": "97276d",
                "6f2919": "59163f"
            },
            // BROWN
            {
                "ffca8a": "ccae7c",
                "e0975c": "a47844",
                "a85636": "754c23",
                "6f2919": "472b13"
            }
        ]
    }
    
     
  3. IHart

    IHart Scruffy Nerf-Herder

    By my understanding this is not a requirement for json, as it is read object by object, not line by line. Line breaks only break up strings which changes how they are read, not breaks how they are read.

    More likely you are missing your frames file. in the same folder create a file "shaxxhelmet.frames" and it should read:
    Code:
    {
      "image" : "shaxxhelmet.png",
      "frameList" : {
      "normal" : [43, 0, 86, 43],
      "climb" : [43, 172, 86, 215]
      }
    }
    
    (technically the "climb" key is deprecated but im unsure if removing it breaks anything)

    Also change your inventory icon value to "shaxxhelmet.png:normal".
     
  4. lazarus78

    lazarus78 The Waste of Time

    Any JSON validator would disagree, plus there is the aptly named "Game breaker" staff that had this issue and it would... break the game. Even if the game accepted it, it is still bad form to do it that way.

    And the "price" line is split up into 2 lines, this WILL crash the game on it's own. Proper formatting would solve this issue on it's own.

    And armors/clothing don't need their own frame files, just the defaults are fine.
     
  5. IHart

    IHart Scruffy Nerf-Herder

    tell that to my new favorite hat
    shaxxhelm.png
    *does guitar solo*
     
    lazarus78 likes this.
  6. IHart

    IHart Scruffy Nerf-Herder

    direct link to download: https://github.com/IsaacHart/sbtest-shax/archive/master.zip
    changes: commented out line 71 of .head file
    added shaxxhelmet.frames file (the default frames files only work on images that have a matching name)

    EDIT: also added ":normal" to inventory icon value in .head file
     
    Last edited: Dec 6, 2016
  7. lazarus78

    lazarus78 The Waste of Time

    Genuinely surprised it works. Doesn't change that it is formatted by a 1st grader in art class.
     
    IHart likes this.
  8. Derpyman890

    Derpyman890 Scruffy Nerf-Herder

    Thanks for the help, I just copied the .head file of another helmet and changed what I thought I would need to. I wasn't entirely sure why the formatting was off in my first post, cause I just
    copy-pasted the .head file for my helmet.
     

Share This Page