Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Tools => Topic started by: CountBuggula on May 06, 2014, 04:45:42 pm

Title: .tbl parsing
Post by: CountBuggula on May 06, 2014, 04:45:42 pm
Searching on the forums, I found several threads from people starting projects to parse .tbl files into a spreadsheet or csv.  Unfortunately they're all a bit old and either don't work or the download links are gone.  All I want is a relatively easy way to parse the ships.tbl into any format that I can use elsewhere.  Does anyone have such a tool or know where I can find one?

Here's the threads I found in my own search:

TBLView 2 (http://www.hard-light.net/forums/index.php?topic=72373.0) - Sigtau's thread detailing his development, including screenshots, but never posted a release.  Last post 12/10 from sigtau claiming he was still working on it and it wasn't dead.

jTBLEdit 0.1 Alpha (http://www.hard-light.net/forums/index.php?topic=73656.0) - m!m released an early build, which I tried, but the export just hangs at 0%.  Last post 5/11 from m!m announcing that development was on hold.
Title: Re: .tbl parsing
Post by: Macfie on May 07, 2014, 06:18:52 am
You can open .tbl files in note pad to view and edit files. 

also here is a link to jTBLEdit.  http://www.freespacemods.net/download.php?view.679

Title: Re: .tbl parsing
Post by: m!m on May 07, 2014, 07:09:56 am
There are also Notepad++ syntax highlighting rules by mjn.mixael here: http://www.hard-light.net/forums/index.php?topic=84887.0
Title: Re: .tbl parsing
Post by: CountBuggula on May 07, 2014, 05:10:46 pm
I know I can open and edit them just fine, I'm just looking for a way to quickly parse all the data in there into a spreadsheet for use elsewhere.

My particular use case:

I'm creating a ship database on our web site that includes various data statistics pulled directly from the ships.tbl file.  As this is a large list, it would be nice to not have to copy each entry by hand.  Also, since the mod is still in progress, I'd like to be able to just feed a new ships.tbl after balance changes have been made and automatically update the website with the current, correct data.
Title: Re: .tbl parsing
Post by: General Battuta on May 07, 2014, 05:20:16 pm
This would also be useful for balance calculations. I have a calculator spreadsheet that autocomputes some useful balancing traits, but I have to enter the raw weapon data by hand.
Title: Re: .tbl parsing
Post by: m!m on May 08, 2014, 12:47:51 am
I implemented that feature in my .tbl parser but I don't know if I still have the code for that. If I find it I will upload it so someone can use it.
Title: Re: .tbl parsing
Post by: CountBuggula on May 08, 2014, 10:52:20 am
Was anyone else able to use m!m's jTBLEdit?  Mine just hung at 0% when I tried to export.  m!m, do you have a debug version I could try maybe?
Title: Re: .tbl parsing
Post by: m!m on May 08, 2014, 11:06:01 am
I can't even find the source anymore so sadly no debug version :sigh:
Title: Re: .tbl parsing
Post by: chief1983 on May 16, 2014, 11:51:42 am
I just had a thought.  We already have a parser in the engine, that doesn't require anything special to keep in sync with the engine parser obviously, which any external tool would.  We also have a JSON library now built into FSO.  What if we dumped the parsed ship and weapon info objects into a .json file via a command line switch?  Then taking that info and doing what you want with it should be much much easier as JSON is fairly trivial to work with.

Edit: to clarify, Jansson is linked on *nix platforms for the cross-platform standalone, but since the lib is in SVN already for OSX, adding it to Windows should be easy enough if there is a need for it for this project.
Title: Re: .tbl parsing
Post by: CountBuggula on May 16, 2014, 12:53:57 pm
I just had a thought.  We already have a parser in the engine, that doesn't require anything special to keep in sync with the engine parser obviously, which any external tool would.  We also have a JSON library now built into FSO.  What if we dumped the parsed ship and weapon info objects into a .json file via a command line switch?  Then taking that info and doing what you want with it should be much much easier as JSON is fairly trivial to work with.

Edit: to clarify, Jansson is linked on *nix platforms for the cross-platform standalone, but since the lib is in SVN already for OSX, adding it to Windows should be easy enough if there is a need for it for this project.

I would LOVE a solution like this.  No need to worry about future updates and keeping an external tool updated.  Anyone have the ability and free cycles to work on such a feature?
Title: Re: .tbl parsing
Post by: niffiwan on May 16, 2014, 06:09:16 pm
I could probably do this, but with the caveat that it won't be done until after 3.7.2 is released.