Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 [2] 3 4 ... 10

Author Topic: .ship/.variant editor  (Read 80196 times)

Redbull

  • Ensign
  • *
  • Posts: 15
    • View Profile
Re: .ship/.variant editor
« Reply #15 on: January 12, 2012, 09:34:46 AM »

Hi, actually we can't open variant files?

The thing is, the variant files that come with the game aren't valid JSON. It's just a matter of a few commas and possibly comments here and there, but the parser still does not like it. For example, if you try to load the unmodified wolf_Assault variant
Code
{
"displayName":"Assault",
"hullId":"wolf",
"variantId":"wolf_Assault",
"fluxVents":0,
"fluxCapacitors":0,
"mods":[], # array of strings

# mode is either LINKED or ALTERNATING
# slot ids (WS ***) must match what's in the .ship file
"weaponGroups":[
{"mode":"LINKED",
"weapons":{
"WS 001":"irpulse",
"WS 002":"irpulse",
"WS 003":"irpulse",
   },
},
{"mode":"LINKED",
"weapons":{
"WS 004":"pulselaser",
   },
},
{"mode":"ALTERNATING",
"weapons":{
"WS 005":"annihilator",
"WS 006":"annihilator",
   },
},
],
}
it'll throw an error during parsing. The fixed version (comments and trailing commas removed) looks like this
Code
{
"displayName":"Assault",
"hullId":"wolf",
"variantId":"wolf_Assault",
"fluxVents":0,
"fluxCapacitors":0,
"mods":[],
"weaponGroups":[
{"mode":"LINKED",
"weapons":{
"WS 001":"irpulse",
"WS 002":"irpulse",
"WS 003":"irpulse"
   }
},
{"mode":"LINKED",
"weapons":{
"WS 004":"pulselaser"
   }
},
{"mode":"ALTERNATING",
"weapons":{
"WS 005":"annihilator",
"WS 006":"annihilator"
   }
}
]
}
and will load successfully. You can check if a file will parse by using jsonlint.com and correct the errors that pop up there. The variants exported by the editor will always load successfully as its using the built-in serializer. I know this is a hassle, but there isn't really anything I can do about it short of putting together an ugly hack.
Logged

Redbull

  • Ensign
  • *
  • Posts: 15
    • View Profile
Re: .ship/.variant editor
« Reply #16 on: January 12, 2012, 05:49:55 PM »

I put together an ugly hack. It will now load, to the best of its abilities, variant files that don't conform to the parser. I also made the weapon lookup give more details.

Logged

Zarcon

  • Captain
  • ****
  • Posts: 329
    • View Profile
Re: .ship/.variant editor
« Reply #17 on: January 13, 2012, 05:20:56 AM »

I put together an ugly hack. It will now load, to the best of its abilities, variant files that don't conform to the parser. I also made the weapon lookup give more details.



Awesome!  :)  I can't wait to try it out some more.
Logged
There is no instance of a nation benefitting from prolonged warfare.
Thus it is that in war the victorious strategist only seeks battle after the victory has been won, whereas he who is destined to defeat first fights and afterwards looks for victory.

aerandir

  • Ensign
  • *
  • Posts: 20
    • View Profile
Re: .ship/.variant editor
« Reply #18 on: January 13, 2012, 11:21:02 AM »

Wow, looks amazing. can finally get on with my mod now!
Logged

Kilvanya

  • Commander
  • ***
  • Posts: 115
    • View Profile
Re: .ship/.variant editor
« Reply #19 on: January 15, 2012, 09:30:09 AM »

Okay how do I get this to work on mac? I have it in where it should be
but that in a package and you cant open a package from the choose ship
screen so i can't select any ships
Logged

Redbull

  • Ensign
  • *
  • Posts: 15
    • View Profile
Re: .ship/.variant editor
« Reply #20 on: January 15, 2012, 12:56:57 PM »

I don't have a mac, so I can't say for sure, but unzipping the mac version and putting the editor in Starfarer.app/Contents/Resources/Java works. If you for some reason can't select files within the Starfarer.app folder I suggest you copy the data and graphics folders to somewhere else and put the editor there instead so your file structure looks like editor-folder/data, editor-folder/graphics, editor-folder/starfarer.html. That will also work.
Logged

Redbull

  • Ensign
  • *
  • Posts: 15
    • View Profile
Re: .ship/.variant editor
« Reply #21 on: January 16, 2012, 05:29:53 PM »

Updated, most importantly it's now online after getting Alex's permission. It should now work on pretty much every modern browser, and operating system, without any setup. Going online also meant that I could make a proper save-as function, you no longer have to copy-paste the JSON, and that you'll always be using the most up-to-date version. Check it out.
Logged

Zarcon

  • Captain
  • ****
  • Posts: 329
    • View Profile
Re: .ship/.variant editor
« Reply #22 on: January 16, 2012, 06:27:28 PM »

Updated, most importantly it's now online after getting Alex's permission. It should now work on pretty much every modern browser, and operating system, without any setup. Going online also meant that I could make a proper save-as function, you no longer have to copy-paste the JSON, and that you'll always be using the most up-to-date version. Check it out.

Wow, that is awesome man!   :D 

I'll have to start making use of it asap!  :)
Logged
There is no instance of a nation benefitting from prolonged warfare.
Thus it is that in war the victorious strategist only seeks battle after the victory has been won, whereas he who is destined to defeat first fights and afterwards looks for victory.

Kilvanya

  • Commander
  • ***
  • Posts: 115
    • View Profile
Re: .ship/.variant editor
« Reply #23 on: January 19, 2012, 09:08:34 AM »

Everytime I try to assign weapons in the variant tab it clears the id after I
click off of it and reassigns undefined to it
Logged

Zarcon

  • Captain
  • ****
  • Posts: 329
    • View Profile
Re: .ship/.variant editor
« Reply #24 on: January 19, 2012, 09:59:22 AM »

Everytime I try to assign weapons in the variant tab it clears the id after I
click off of it and reassigns undefined to it

Hmm, I've noticed something like that a few times, make sure you have the weapons added to the proper weapon groups before you try to assign the weapons, it works better that way for some reason.  Once you have all the weapon groups figured out and the proper weapons highlighted for each group, it should allow you to assign weapons.  Hope that helps a little.   :D
Logged
There is no instance of a nation benefitting from prolonged warfare.
Thus it is that in war the victorious strategist only seeks battle after the victory has been won, whereas he who is destined to defeat first fights and afterwards looks for victory.

Kilvanya

  • Commander
  • ***
  • Posts: 115
    • View Profile
Re: .ship/.variant editor
« Reply #25 on: January 19, 2012, 10:46:24 AM »

 :(

Now it wont let me do groups, just assigns all to each, im confused
Logged

Zarcon

  • Captain
  • ****
  • Posts: 329
    • View Profile
Re: .ship/.variant editor
« Reply #26 on: January 19, 2012, 11:08:30 AM »

:(

Now it wont let me do groups, just assigns all to each, im confused

Hmm.  Interesting, welp, you are adding more than 1 Weapon group I assume?  Via the Add button near the weapon group dropdown, etc. 

Then as you cycle through the 1-4 weapon groups in the dropdown, all of the weapon turrets or hard-points will either be unselected or selected (i.e. Blue) for each Weapon Group.  For instance select the Weapon Group1 in the dropdown, and then Ctrl left click all of the weapons that you wish to be a part of that Weapon Group, you should see several weapons with a blue background, and then their boxes should appear below to have their names filled in with the proper weapon id. 

If you then select Weapon Group2 from the dropdown, the blue highlight on the weapons that you just added to Weapon Group1 should un-highlight, and go back to white.  You can then select several other weapons to add to Weapon Group 2, etc.  Proceed down this path until you have assigned all weapons to one of the 1-4 weapon groups, and then try entering in the weapon id's into the names of each weapon group's weapons.

Wall of Text crits for over 9000!

If that still leaves ya in the dark, then I'm sorry for being confusing, heh heh, and I'll let RedBull take a wack at it at some point.    ;D
Logged
There is no instance of a nation benefitting from prolonged warfare.
Thus it is that in war the victorious strategist only seeks battle after the victory has been won, whereas he who is destined to defeat first fights and afterwards looks for victory.

Kilvanya

  • Commander
  • ***
  • Posts: 115
    • View Profile
Re: .ship/.variant editor
« Reply #27 on: January 19, 2012, 11:11:34 AM »

okay decide to just turret everything and set it to auto fire so problem has been duck-taped into submission,
now unfortunately my ship crashes the game, when I try to start up it tells me it had a fatal ship_data.csv error.
Now ship_data.csv is just a spread sheet right? How can it crash the game?
Logged

Zarcon

  • Captain
  • ****
  • Posts: 329
    • View Profile
Re: .ship/.variant editor
« Reply #28 on: January 19, 2012, 11:15:58 AM »

okay decide to just turret everything and set it to auto fire so problem has been duck-taped into submission,
now unfortunately my ship crashes the game, when I try to start up it tells me it had a fatal ship_data.csv error.
Now ship_data.csv is just a spread sheet right? How can it crash the game?

Well each ship you add needs to have a reference point in the ship_data file, so make sure you add in the reference, copy from another line of code for an existing ship, and then change the number at the end.  The files in the Data folder get loaded by the game on start-up of the exe, so yeah that is what is crashing it for sure.

I assume that you already added your new ship to a mission?
Logged
There is no instance of a nation benefitting from prolonged warfare.
Thus it is that in war the victorious strategist only seeks battle after the victory has been won, whereas he who is destined to defeat first fights and afterwards looks for victory.

Kilvanya

  • Commander
  • ***
  • Posts: 115
    • View Profile
Re: .ship/.variant editor
« Reply #29 on: January 19, 2012, 11:18:26 AM »

yup and adding the ship to the .csv hasn't done anything
Logged
Pages: 1 [2] 3 4 ... 10