Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.97a is out! (02/02/24); New blog post: Simulator Enhancements (03/13/24)

Author Topic: Problem with adding a Ship [solved]  (Read 4291 times)

K-64

  • Admiral
  • *****
  • Posts: 1117
    • View Profile
Problem with adding a Ship [solved]
« on: March 31, 2012, 12:02:42 PM »

Alright, I would first like to confirm that I did do some searching about the problem and nothing relevant came up, if this has already been answered elsewhere, then I apologise for the redundancy. With that out of the way, I shall now get to the main matter.

Right, I have been trying to add a ship to Starfarer, just to see if I could, and possibly take it further if I got it working to a level I feel content about. Before I start to ramble, I got the ship I wanted sprited thanks to a good friend of mine, and I've been reading/watching the tutorials, and used Redbull's ship editor, and got that part down fine. Adding the ship to the game however, is proving to be my downfall. When loading up the game, the message box thingie pops up stating that there is a JSON exception.

The starfarer.log file shows this:
Code
5216 [Thread-6] ERROR com.fs.starfarer.combat.String  - org.json.JSONException: Illegal escape. at 870 [character 871 line 1]
org.json.JSONException: Illegal escape. at 870 [character 871 line 1]
at org.json.JSONTokener.syntaxError(JSONTokener.java:423)
at org.json.JSONTokener.nextString(JSONTokener.java:278)
at org.json.JSONTokener.nextValue(JSONTokener.java:349)
at org.json.JSONObject.<init>(JSONObject.java:210)
at org.json.JSONObject.<init>(JSONObject.java:311)
at com.fs.starfarer.loading.H.Ø00000(Unknown Source)
at com.fs.starfarer.loading.H.Ö00000(Unknown Source)
at com.fs.starfarer.loading.ShipHullSpecLoader.super(Unknown Source)
at com.fs.starfarer.loading.ShipHullSpecLoader.Ò00000(Unknown Source)
at com.fs.starfarer.loading.SpecStore.super(Unknown Source)
at com.fs.starfarer.loading.G.super(Unknown Source)
at com.fs.super.A.Ò00000(Unknown Source)
at com.fs.starfarer.combat.String.super(Unknown Source)
at com.fs.starfarer.StarfarerLauncher$2.run(Unknown Source)
at java.lang.Thread.run(Thread.java:619)

and this is the .ship file's text

Code
{"bounds":[83.5,-0.5,
65.5,-5.5,
62.5,-10.5,
20.5,-19.5,
2.5,-19.5,
-15.5,-31.5,
-29.5,-32.5,
-63.5,-35.5,
-65.5,-24.5,
-76.5,-23.5,
-76.5,-8.5
,-44.5,-5.5,
-43.5,5.5,
-76.5,5.5
,-76.5,22.5,
-65.5,21.5,
-65.5,34.5,
-17.5,32.5,
4.5,21.5,
20.5,19.5,
62.5,10.5
,66.29999923706055,5.5],
"center":[32,75],
"collisionRadius":"83",
"engineSlots":[{"angle":"180","contrailSize":"5","location":[-47,27],"length":"5","width":"7","style":"HIGH_TECH"},{"angle":"180","contrailSize":"5","location":[-47,-26],"length":"5","width":"7","style":"HIGH_TECH"},{"angle":"180","contrailSize":"5","location":[-52,15],"length":"5","width":"7","style":"HIGH_TECH"},{"angle":"180","contrailSize":"5","location":[-52,-13],"length":"5","width":"7","style":"HIGH_TECH"}],
"height":157,"width":65,
"hullId":"Normandy SR-1","hullName":"normandy1",
"hullSize":"FRIGATE",
"shieldCenter":[-4,0],"shieldRadius":"88",
"spriteName":"\graphics\ships\Normandy1.png",
"style":"HIGH_TECH",
"viewOffset":0,
"weaponSlots":[{"angle":"0","arc":"25","id":"KD1","locations":[38,3],"mount":"HARDPOINT","size":"SMALL","type":"BALLISTIC"},{"angle":"0","arc":"25","id":"KD2","locations":[38,-2],"mount":"HARDPOINT","size":"SMALL","type":"BALLISTIC"}]}

I'm guessing it has something to do with the sprite path, although I have no clue whatsoever as to what the problem with it might be. And to end things off, a preliminary thanks in advance :P
« Last Edit: April 01, 2012, 07:24:44 PM by Trylobot »
Logged

Psiyon

  • Admiral
  • *****
  • Posts: 772
  • Trippy
    • View Profile
Re: Problem with adding a Ship
« Reply #1 on: March 31, 2012, 12:12:55 PM »

You're right, it is the sprite name. You're using the wrong kind of slash for the path: "\" instead of "/"


This should work fine:
    "spriteName": "/graphics/ships/Normandy1.png",


And make sure you make a Collector ship too so I can reenact the beginning of Mass Effect 2 :P
Logged

Upgradecap

  • Admiral
  • *****
  • Posts: 5422
  • CEO of the TimCORP
    • View Profile
Re: Problem with adding a Ship
« Reply #2 on: March 31, 2012, 12:15:53 PM »

I'd love to see a mass effect mod out here. Unfortunatley, i cannot make one myself, as i am too busy with my own mod.
Logged

K-64

  • Admiral
  • *****
  • Posts: 1117
    • View Profile
Re: Problem with adding a Ship
« Reply #3 on: March 31, 2012, 12:29:25 PM »

Well, the naming solved that problem, but now I'm getting "JSONObject["id"] not found.", which I'm undecided whether it's the weapons or the variant that's screwing it up this time

The variant file is
Code
{"displayName":"Hull",
"hullId":"Normandy SR-1",
"variantId":"hull",
"fluxVents":0,
"fluxCapacitors":0,
"mods":[],
"weaponGroups":[{"mode":"LINKED","weapons":{}}]}

I would like to see or even make a Mass Effect mod for this as well. Such an incredible setting for space battles, I think
Logged

K-64

  • Admiral
  • *****
  • Posts: 1117
    • View Profile
Re: Problem with adding a Ship
« Reply #4 on: April 01, 2012, 10:04:46 AM »

Apologies for the double-post, but I think I might be getting close to be going somewhere with this, still need help with it though :P

The full starfarer.log can be found here.
I have absolutely no idea what's being flagged as the error as I'm fairly close to certain that all the names are correct, got all the paths to the icons and the ship itself fine, got the variant down just in case it's needed and used other ship-adding mods as a reference to see if I got everything right.

However, if uploading the work in progress would make things easier and/or possible to find the problem with it, that is also very doable

EDIT: Managed to solve the problem. Not sure where I went wrong since I just redid the whole .ship and .csv stuff
« Last Edit: April 01, 2012, 04:43:16 PM by K-64 »
Logged