Modding Help Noob modder here.

Discussion in 'Starbound Modding' started by Sh4dowWalker96, Jul 1, 2016.

  1. Sh4dowWalker96

    Sh4dowWalker96 Big Damn Hero

    I've been trying to make an (as of now) simple mod, but my code's giving me errors I don't understand. Could someone help? http://pastebin.com/r3SV04XU
     
  2. Segenam

    Segenam Phantasmal Quasar

    I use the JSON labs found at Kawa's site
    http://helmet.kafuka.org/sbmods/json/

    Edit: Using the object validator I got these results:
    "hasObjectItem":true needs to have a comma after it

    }
    "frameGrid":{
    "size":[54,62],
    "dimensions":[1,1],
    "names":[
    ["guncabinet"]
    ]
    }
    }
    needs the extra { and } removed from around it

    shortdescription needs to be shortDescription
    and
    inventoryIcon needs to be inventoryicon
     
    Last edited: Jul 1, 2016
  3. lazarus78

    lazarus78 The Waste of Time

    Key names are not case sensitive.
     
  4. Errors4l

    Errors4l Spaceman Spiff

    This is just to validate the JSON, not to make the file do what OP wants it to do.

    The last section of code is actually just misplaced. Although there might be a way to define the frames inside an object (I'm not aware of it), this is never done in the actual game assets.
    You should try to create a new 'guncabinet.frames' file in the same folder as the guncabinet.object file (assuming this is what you named it), and putting the code in there. Of course, remove the same code from the object file.
    Code:
    {
      "frameGrid": {
        "size": [54, 62],
        "dimensions": [1, 1],
        "names": [
          ["guncabinet"]
        ]
      }
    }
     
    Last edited: Jul 1, 2016
  5. Sh4dowWalker96

    Sh4dowWalker96 Big Damn Hero

    Ok, now I'm getting a fatal error on launch, error loading the guncabinet.object, improper conversion to JsonArray from string. I tried using Kawa's validator thing, and it says there's nothing wrong with it besides inventoryIcon not being inventoryicon, which I've tried. http://pastebin.com/Tki31mVn is the .object file, while the .frames file is literally exactly what Errors4l put. (I had misread the guide I was using and thought it went in the object file. Whoops.)
     
  6. Errors4l

    Errors4l Spaceman Spiff

    Make the following changes:
    "colonyTags":["novakid"],
    "uiConfig":"/interface/chests/chest%slots%.config",
    (note in nightly %slots% is changed to <slots>)
     
  7. Sh4dowWalker96

    Sh4dowWalker96 Big Damn Hero

    Alright, that removed the error and now it's loaded, but it's not loading the texture for some reason. Inventory icon loads fine, but the frame for the in-world object doesn't.
     
  8. Errors4l

    Errors4l Spaceman Spiff

    Frame name in the frames file doesn't match the defined image in the orientations parameter. You can either change the :default bit to :guncabinet or add an alias table to the frames file.
    Code:
        "orientations":[
            {
            "image":"guncabinet.png:default",
            "flipImages":true,
            "imagePosition":[0,0],
            "spaceScan":0.1,
            "anchors":["bottom"],
            "direction":"left"
            },
            {
            "image":"guncabinet.png:default",
            "imagePosition":[0,0],
            "spaceScan":0.1,
            "anchors":["bottom"],
            "direction":"right"
            }
        ],
    Frames code unmodified:
    Code:
    {
      "frameGrid": {
        "size": [54, 62],
        "dimensions": [1, 1],
        "names": [
          ["guncabinet"]
        ]
      }
    }
    Frames code for alias:
    Code:
    {
      "frameGrid": {
        "size": [54, 62],
        "dimensions": [1, 1],
        "names": [
          ["guncabinet"]
        ]
      },
      "aliases" : {
        "default" : "guncabinet"
      }
    
    }
     
  9. Sh4dowWalker96

    Sh4dowWalker96 Big Damn Hero

    I added that part to the frame file, still nothing. Getting this error:
    Error: Could not load image asset '/objects/generic/guncabinet/guncabinet.png:guncabinet', using placeholder default.
    (ImageException) call to subImage with pos (0, 0) size (54, 62) out of image bounds (53, 62)
     
  10. Errors4l

    Errors4l Spaceman Spiff

    Your image is 53 pixels wide, but you defined it to be 54 pixels wide.
     
  11. Sh4dowWalker96

    Sh4dowWalker96 Big Damn Hero

    ... whoops. It works now! Now I just need to find a compression ratio that fits so it's a reasonable size.
    Edit: Or, it works visually. It won't open, it's supposed to be a storage unit.
     
    Last edited: Jul 1, 2016

Share This Page