Author Topic: TBLView 2  (Read 7241 times)

0 Members and 1 Guest are viewing this topic.

Offline sigtau

  • 29
  • unfortunate technical art assclown
As per a request for a table <-> spreadsheet conversion program, I have taken the liberty of creating a program that does not only that, but also has the following features:

  • Importing and exporting to the CSV file format (which can be opened in any major spreadsheet program)
  • Clean up the indentation mistakes such as the ones found in many of the retail tables
  • Ability to edit both TBL and TBM files
  • Validate tables to further ensure less errors when testing in FSO
  • Make SCP-only tables compatible with retail FS2

Here's a recent screenshot (an animated GIF which also demonstrates the menu GUI):



Any comments or feature requests?
Who uses forum signatures anymore?

 

Offline TopAce

  • Stalwart contributor
  • 212
  • FREDder, FSWiki editor, and tester
Looks like something any modder would be happy to have, but where's the download? :D
My community contributions - Get my campaigns from here.

I already announced my retirement twice, yet here I am. If I bring up that topic again, don't believe a word.

 

Offline mjn.mixael

  • Cutscene Master
  • 212
  • Chopped liver
    • Steam
    • Twitter
Looks like something any modder would be happy to have, but where's the download? :D

This
Cutscene Upgrade Project - Mainhall Remakes - Between the Ashes
Youtube Channel - P3D Model Box
Between the Ashes is looking for committed testers, PM me for details.
Freespace Upgrade Project See what's happening.

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
I've been asked for a highlight but given that the developer (sigtau) is currently in touch with at least one of the people most on top of SCP tabling (Fury) I'll wait until release to spotlight it.

 

Offline Galemp

  • Actual father of Samus
  • 212
  • Ask me about GORT!
    • Steam
    • User page on the FreeSpace Wiki
A couple things... would it be possible to group related fields (such as the laser bolt rendering info or beam data)? Does the program give you empty fields for flags that aren't included (such as SCP features)? And does it crunch any numbers for us (such as calculating damage per second or energy use per second)?
"Anyone can do any amount of work, provided it isn't the work he's supposed to be doing at that moment." -- Robert Benchley

Members I've personally met: RedStreblo, Goober5000, Sandwich, Splinter, Su-tehp, Hippo, CP5670, Terran Emperor, Karajorma, Dekker, McCall, Admiral Wolf, mxlm, RedSniper, Stealth, Black Wolf...

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Does the program give you empty fields for flags that aren't included (such as SCP features)?

It's my impression it does this.

Quote
And does it crunch any numbers for us (such as calculating damage per second or energy use per second)?

Not sure about this, but then again this is what the whole export to CSV feature is for.

 

Offline Sandwich

  • Got Screen?
  • 213
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Brainzipper
Kewl!! How about a live search (aka instant or immediate search)?
SERIOUSLY...! | {The Sandvich Bar} - Rhino-FS2 Tutorial | CapShip Turret Upgrade | The Complete FS2 Ship List | System Background Package

"...The quintessential quality of our age is that of dreams coming true. Just think of it. For centuries we have dreamt of flying; recently we made that come true: we have always hankered for speed; now we have speeds greater than we can stand: we wanted to speak to far parts of the Earth; we can: we wanted to explore the sea bottom; we have: and so  on, and so on: and, too, we wanted the power to smash our enemies utterly; we have it. If we had truly wanted peace, we should have had that as well. But true peace has never been one of the genuine dreams - we have got little further than preaching against war in order to appease our consciences. The truly wishful dreams, the many-minded dreams are now irresistible - they become facts." - 'The Outward Urge' by John Wyndham

"The very essence of tolerance rests on the fact that we have to be intolerant of intolerance. Stretching right back to Kant, through the Frankfurt School and up to today, liberalism means that we can do anything we like as long as we don't hurt others. This means that if we are tolerant of others' intolerance - especially when that intolerance is a call for genocide - then all we are doing is allowing that intolerance to flourish, and allowing the violence that will spring from that intolerance to continue unabated." - Bren Carlill

 

Offline Mobius

  • Back where he started
  • 213
  • Porto l'azzurro Dolce Stil Novo nella fantascienza
    • Skype
    • Twitter
    • The Lightblue Ribbon | Cultural Project
sigtau, you're MetalDestroyer's heir. :)
The Lightblue Ribbon

Inferno: Nostos - Alliance
Series Resurrecta: {{FS Wiki Portal}} -  Gehenna's Gate - The Spirit of Ptah - Serendipity (WIP) - <REDACTED> (WIP)
FreeSpace Campaign Restoration Project
A tribute to FreeSpace in my book: Riflessioni dall'Infinito
My interviews: [ 1 ] - [ 2 ] - [ 3 ]

 

Offline sigtau

  • 29
  • unfortunate technical art assclown
Just for the record guys, I'm still working on this.  It's just taking a ****ing long time to complete due to how it handles table values--in this case, TBLView 2 has its own "table" which defines acceptable values for every entry in a .tbl or .tbm file, and this essentially means I'm having to read through the wiki and table every single possible entry for every table.

Coding the CSV conversion is the easy part compared to the sheer *amount* of work incurred by that.
Who uses forum signatures anymore?

 

Offline asyikarea51

  • 210
  • -__-||
Cool. Looks similar to that INI editing tool I-forgot-what-it-was-called for the old C&C series before I tried to figure out how to get by all those lines manually in Wordpad (I still don't know heads or tails of AI.ini even today, not to mention most of Rules... :lol:).

I guess all the INI editing helped me more-or-less understand the three common FS tables relatively quick (ships/weapons/sounds), but if a program can make it look less daunting then why not, I'd try it and see how it goes.

Sure beats staring at thousands of lines of text across multiple open files in Notepad... or something... and it might draw in more wannabe modders or two for FS down the line someday, who knows? :nod:
Inferno plz
The Power of Nightmares
TheHound: "Nice idea, but I have a thing against announcing campaigns before having them already finished."
G5K: "The flipside of that is that if you don't announce your campaign, yet take too long to finish it, other people may independently come up with some of the same ideas."

 

Offline Galemp

  • Actual father of Samus
  • 212
  • Ask me about GORT!
    • Steam
    • User page on the FreeSpace Wiki
TBLView 2 has its own "table" which defines acceptable values for every entry in a .tbl or .tbm file, and this essentially means I'm having to read through the wiki and table every single possible entry for every table.

What does this mean? Are we going to have dropdown menus or checkboxes for $Flags:, or is it simply for table Error Checking?
"Anyone can do any amount of work, provided it isn't the work he's supposed to be doing at that moment." -- Robert Benchley

Members I've personally met: RedStreblo, Goober5000, Sandwich, Splinter, Su-tehp, Hippo, CP5670, Terran Emperor, Karajorma, Dekker, McCall, Admiral Wolf, mxlm, RedSniper, Stealth, Black Wolf...

 

Offline sigtau

  • 29
  • unfortunate technical art assclown
Okay, sorry, my last post may have been a bit ambiguous.  Here's a better explanation of how TBLView 2 handles tables and modular tables...

TBLView 2 operates on a configuration file of its own (with syntax similar to FSO's tables and Windows' INI files).  The file is set up in this format:

Code: [Select]
# tblview.cfg example
# Lines starting with a # are treated as comments by TBLView 2.
# This is just an example of what TBLView 2 can do.
# In this block, we define the name of the table that TBLView 2 can read.
# For this example, we will be using species.tbl.
#
# As indicated by the second line under [Table], species.tbl cannot be made
# into a modular table (according to FSO).  In practice, it could be made
# modular, but the SCP folks have yet to code that...
#
# The third line under [Table] states whether or not this table has an $End
# of some kind.  A fourth line, $EndMarkerText, would define what text is used
# for the end marker ("End" in most cases), but is ignored (and unnecessary) if
# $EndMarker is set to 0.
[Table]
$Name: species;
$CanBeModular: 0;
$EndMarker: 0;

# This block defines what a single table entry would look like.
# We used the example at http://www.hard-light.net/wiki/index.php/Species.tbl#Sample
# The syntax for each line after [TableEntry] is as follows:
#
# $Field "FieldName",fieldType[,optionalParameter];
#
# The optional parameter's input will vary, depending on the field type.
# In the case of xstr, we define whether or not an $end_multi_text is necessary.
#
# For optional fields, we also have $OptionalField (not present in this example),
# and for field modifiers (fields beginning with a +, with the exception of +nocreate)
# we have $ModifierField (also not present in this example).
#
# Finally, we have $AlwaysRequiredField (which, regardless of TBL or TBM, it will always
# be written to and read from the table).
[TableEntry]
$AlwaysRequiredField: "Entry",ignore;
$Field: "Name",xstr,0;
$Field: "Anim",string;
$Field: "AlwaysInTechRoom",integer;
$Field: "Description",xstr,1;
[EndTableEntry]

# Just for completeness, [EndTableEntry] and [EndTable] need to be explicitly
# declared (to make the parser's job easier).

[EndTable]

TBLView 2 will parse this configuration file and use it to determine what values can be acceptably used in each table.  This way, if a new table is added (or new options for a table are added) with a new version of FSO, we simply have to release an update for this file rather than releasing an entirely new program.

What I was trying to say in my first post, Galemp, was that this is how TBLView 2 determines acceptable input values.  This is not just for error checking, it's for the whole program.

You won't need to ever touch tblview.cfg unless you're updating it.  Doing so may cause TBLView 2 to generate invalid tables.

And as for whether or not we'll have dropdown menus or checkboxes for flags, I may just keep it a simple editable value where you directly type in the flags rather than using a checkbox or a dropdown menu.  Java's Swing interface libraries aren't the most intuitive in the world, so a dropdown or checkbox would likely require me to re-invent the wheel just to get it working.
« Last Edit: November 06, 2010, 04:07:56 pm by sigtau »
Who uses forum signatures anymore?

 

Offline The E

  • He's Ebeneezer Goode
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Looks good. Definitely needs a way to distinguish optional from mandatory fields though.
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline sigtau

  • 29
  • unfortunate technical art assclown
Just updated the specification.  Any further objections or suggestions before I write the first version of the parser?
Who uses forum signatures anymore?

 

Offline headdie

  • i don't use punctuation lol
  • 212
  • Lawful Neutral with a Chaotic outook
    • Minecraft
    • Skype
    • Twitter
    • Headdie on Deviant Art
Looks good. Definitely needs a way to distinguish optional from mandatory fields though.

I would suggest the program not writing any lines with a null value unless the line is required which is not many if I remember correctly and of those lines some are only required in certain cases like pbank capacity which a warning along the lines of "pbank capacity not set in ships ####, ####, this might cause errors if any Ballistic primaries are assigned to this ship" would do when the table is being parsed
 
Minister of Interstellar Affairs Sol Union - Retired
quote General Battuta - "FRED is canon!"
Contact me at [email protected]
My Release Thread, Old Release Thread, Celestial Objects Thread, My rubbish attempts at art

 

Offline Fury

  • The Curmudgeon
  • 213
If you don't have any ballistic weapons in the ship's allowed loadout, debug builds will ***** and moan at you. In this case however, I would prefer debugs not to moan about it, only log it to debug log.

 

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
That's been fixed code wise.
No-one ever listens to Zathras. Quite mad, they say. It is good that Zathras does not mind. He's even grown to like it. Oh yes. -Zathras

 

Offline sigtau

  • 29
  • unfortunate technical art assclown
Looks good. Definitely needs a way to distinguish optional from mandatory fields though.

I would suggest the program not writing any lines with a null value unless the line is required which is not many if I remember correctly and of those lines some are only required in certain cases like pbank capacity which a warning along the lines of "pbank capacity not set in ships ####, ####, this might cause errors if any Ballistic primaries are assigned to this ship" would do when the table is being parsed
 

Way ahead of you.  If the field is optional and left blank, it won't even be included when it writes the table file.  If it's required or optional and left blank AND it's a modular table (unless explicitly set inside tblview.cfg), it won't include it when it writes the table file.  Any other time, it'll spew warnings (Null value found in this location, continue with save?).
Who uses forum signatures anymore?

 

Offline Fury

  • The Curmudgeon
  • 213
What's happening with this?

 

Offline Fury

  • The Curmudgeon
  • 213