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