Fractal Softworks Forum

Please login or register.

Login with username, password and session length

Author Topic: Fatal: JSONObject["id"] not found.  (Read 15367 times)

Sabotsas

  • Ensign
  • *
  • Posts: 24
    • View Profile
Fatal: JSONObject["id"] not found.
« on: December 19, 2013, 06:46:19 AM »

Saw Starsector a few days ago on Bluedrake42s youtube channel: http://www.youtube.com/watch?v=_AfcmWHonP4
, bought it and already started modding some files.

I checked the forums for this error but were not able to find anything that i could apply to my case.

---
Starsector 0.6.1a
Fatal: JSONObject["id"] not found.
Check starsector.log for more info.
---

---
Running vanilla Starsector with my own edits to:
1) conquest.ship   -> changed arcs for conquest ship
C:\Program Files (x86)\Fractal Softworks\Starsector\starsector-core\data\hulls
2) ship_data.csv   -> changed speed and max burn for conquest ship

Game runs fine.
---

---
Now I wanted to add:
3) weapon_data.csv -> changing anything* here leads to error.
* changed values for Mark IX Autocannon
* changed values for Mjolnir
C:\Program Files (x86)\Fractal Softworks\Starsector\starsector-core\data\weapons
---

From log-file:
"
11306 [Thread-6] ERROR com.fs.starfarer.combat.String  - org.json.JSONException: JSONObject["id"] not found.
org.json.JSONException: JSONObject["id"] not found.
   at org.json.JSONObject.get(JSONObject.java:406)
   at org.json.JSONObject.getString(JSONObject.java:577)
   at com.fs.starfarer.loading.LoadingUtils.super(Unknown Source)
   at com.fs.starfarer.loading.LoadingUtils.super(Unknown Source)
   at com.fs.starfarer.loading.WeaponSpreadsheetLoader.new(Unknown Source)
   at com.fs.starfarer.loading.SpecStore.Ò00000(Unknown Source)
   at com.fs.starfarer.loading.null.super(Unknown Source)
   at com.fs.super.oOOO.Ò00000(Unknown Source)
   at com.fs.starfarer.combat.String.o00000(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher$2.run(Unknown Source)
   at java.lang.Thread.run(Thread.java:619)
"

Thx for the help and many, many thanks for developing this awesome game.
It has a huge potential and makes a lot of fun already!

Kind Regards
Sabotsas
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24104
    • View Profile
Re: Fatal: JSONObject["id"] not found.
« Reply #1 on: December 19, 2013, 08:52:56 AM »

There's a good chance that whatever program you used to edit the csv file messed it up. Generally, what this error means is it's either trying to find an "id" column in a spreadsheet and not finding it, or an "id" key in a different file (such as a .ship or a .wpn) and not finding it.

I'd really suggest not making changes to the base game but making an actual mini-mod instead. It'll be much easier for you to isolate what went wrong, and you'd also be able to get help more easily, since you could post the mod for someone else to take a look at.

Extracting what you're doing into a proper mod shouldn't actually be too complicated. The example mods here should work with the latest version of the game, even though they haven't been updated in a while. And there's a bit of extra documentation here, but that's probably overkill for just getting started.
Logged

Sabotsas

  • Ensign
  • *
  • Posts: 24
    • View Profile
Re: Fatal: JSONObject["id"] not found.
« Reply #2 on: December 19, 2013, 09:03:31 AM »

Thanks for the fast reply!
I will follow your suggestions and try to fix it :)

By the way - I was using MS Excel 2010 in order to edit the files.

Kind Regards
Sabotsas
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24104
    • View Profile
Re: Fatal: JSONObject["id"] not found.
« Reply #3 on: December 19, 2013, 09:07:44 AM »

Yeah, that's probably the issue. You should be able to configure it to save csvs in the format the game can read, though. I'm using google docs for the spreadsheets myself (followed by download as -> CSV). I've had some luck configuring openoffice (libreoffice now, I suppose?) to read them - it shows you a dialog when you try to open it that gives you various options for how it should be formatted, and you can see a preview of how it'll interpret the data, so you know whether you've got it right or not.

Good luck!
Logged

Sabotsas

  • Ensign
  • *
  • Posts: 24
    • View Profile
Re: Fatal: JSONObject["id"] not found.
« Reply #4 on: December 19, 2013, 09:23:37 AM »

I tried the MS editor now to edit / save - it worked.
MS 2010 was somehow "corrupting" the saves.

In the future I will be going for the mini-mod approach as you suggested :-)

Big thx again!
Sabotsas
Logged