Error: line 1:1: expected object or array but found ' '

Thought I had things down, but after making my item file for my broken anamatronics I the debug: error loading data from json: data/mods//anamatronics/melee.json line 1:1: expected object or array but found ’ ’

Mod folder laylout looks like this, if this matters:

Code for the melee.json is:

[ { "type":"GENERIC", "id": "broken_animatronic_fox", "symbol": "%", "color": "red", "name": "broken animatronic fox", "category": "other", "description": "A broken animatronic fox. Much less threatening now that it won't be calling for backup. Could be gutted for parts.", "price": 1000, "material": ["steel", "plastic"], "weight": 17023, "volume": 30, "bashing": 10, "cutting": 6, "to_hit": -2 }, { "type":"GENERIC", "id": "broken_animatronic_bunny", "symbol": "%", "color": "blue", "name": "broken animatronic bunny", "category": "other", "description": "A broken animatronic bunny. Much less threatening now that it won't be calling for backup. Could be gutted for parts.", "price": 1000, "material": ["steel", "plastic"], "weight": 17023, "volume": 30, "bashing": 10, "cutting": 6, "to_hit": -2 }, { "type":"GENERIC", "id": "broken_animatronic_chicken", "symbol": "%", "color": "yellow", "name": "broken animatronic chicken", "category": "other", "description": "A broken animatronic chicken. Much less threatening now that it won't be calling for backup. Could be gutted for parts.", "price": 1000, "material": ["steel", "plastic"], "weight": 17023, "volume": 30, "bashing": 10, "cutting": 6, "to_hit": -2 }, { "type":"GENERIC", "id": "broken_animatronic_bunny", "symbol": "%", "color": "brown", "name": "broken animatronic bear", "category": "other", "description": "A broken animatronic bear. Much less threatening now that it won't be calling for backup. Could be gutted for parts.", "price": 1000, "material": ["steel", "plastic"], "weight": 17023, "volume": 30, "bashing": 10, "cutting": 6, "to_hit": -2

}
]

It might be that items can’t be made of more than two materials.

Didn’t fix it. Though that might also be a problem, right now it’s stuck on this issue though.

This right here.

Also: It’s animatronic not anamatronic and it’s not its.

This right here.

Also: It’s animatronic not anamatronic and it’s not its.[/quote]

Again it’s not that, I brought it down to two and its still not functioning. Thanks for the grammar corrections though.

You aren’t adding new square brackets to the melee.json file are you?

Just insert the stuff within the curly brackets (curly brackets too) inside the existing structure (make sure you put your commas in the right places).

Tried doing it from scratch again to be sure, still get the same error.

Here’s the file https://www.dropbox.com/s/v25hd6hzbgez2ih/melee.json?dl=0

I just tried adding the items into the end of an updated copy of melee.json.

Pastebin post.

It works just fine.

[quote=“Rivet, post:8, topic:7762”]I just tried adding the items into the end of an updated copy of melee.json.

Pastebin post.

It works just fine.[/quote]

When I downloaded it it was a txt file. I copy pasted the contents over the text in a json. I still get the same message

Maybe there’s just something wrong with the experimental build of Cataclysm I’m using? Should I switch to the last stable release?

EDIT: Last stable release has a differant issue entirely. So guessing not.

Newest Experimental throws up the original problem still.

Just copy the raw file contents out and overwrite the contents of melee.json.

And no, downgrading back to the stable is never advisable when making new stuff.

That’s what I did, I still get the same error.

I just re-read and noticed you’re creating a separate melee.json in your mod directory. I’m not sure how that will interact with the extant main melee.json file. Try renaming the file itself (to something like main.json) and using your original file contents (i.e. your OP).

I originally had it like that, I changed the name to melee when I had the error thinking it needed to have that name to work. At any rate, I just tested that again just in case and got the same error.

I just looked at a item mod from a newer experimental build. The order of “id” and “type” are reversed, could that be it?

Anyway while I test that, here is the whole mod as a whole right now Dropbox - Error - Simplify your life

That shouldn’t affect anything.

Just from looking at the contents of the broken file, I can’t see what would be wrong with it.

That shouldn’t affect anything.

Just from looking at the contents of the broken file, I can’t see what would be wrong with it.[/quote]

I can’t figure it out either, but keep getting the: error loading data from json: data/mods//anamatronics/melee.json line 1:1: expected object or array but found ’ ’

Not sure what else to do, I got to get it to work though or else I’ll keep getting that debug pop up when I kill them about not having the broken body defined

Okay I’ve got it to load. Just need to locate a pizzeria to see if it’s actually working now. I’ll post a fixed zip file ASAP.

Awesome thank you.

The spawn rate for them should be high for them right now, they are dark grey ^

Found a few other minor bugs which needed fixing as well.

Fixed files are here.

[quote=“Rivet, post:18, topic:7762”]Found a few other minor bugs which needed fixing as well.

Fixed files are here.[/quote]

Awesome thank you.

What was the problem? And what are the other bugs?

Something inherently wrong in the dead_animatronics.json file itself, possibly bad newlines; I made a fresh .json and copied the contents inside and it loaded fine.

Bugs were a duplicated ID (not the root problem though) and some common copy/paste errors.

By the by, what program are you using to edit your .jsons?