Author Topic: .tbl parsing  (Read 3107 times)

0 Members and 1 Guest are viewing this topic.

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 - 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 - 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.

 

Offline Macfie

  • 210
  • If somebody made a campaign I've probably got it
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

Normal people believe that if it isn't broke, don't fix it. Engineers believe that if it isn't broke, it doesn't have enough features yet.
The difference between Mechanical Engineers and Civil Engineers is:
Mechanical Engineers build weapons.  Civil Engineers build targets
An optimist sees the glass half full; the pessimist sees it half empty. An engineer sees that the glass is twice as big as it needs to be.

 

Offline m!m

  • 211
There are also Notepad++ syntax highlighting rules by mjn.mixael here: http://www.hard-light.net/forums/index.php?topic=84887.0

 
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.

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
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.

 

Offline m!m

  • 211
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.

 
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?

 

Offline m!m

  • 211
I can't even find the source anymore so sadly no debug version :sigh:

 

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
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.
« Last Edit: May 16, 2014, 11:58:50 am by chief1983 »
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 
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?

 

Offline niffiwan

  • 211
  • Eluder Class
I could probably do this, but with the caveat that it won't be done until after 3.7.2 is released.
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...