Poll

Is this a good idea?

You bet - the applications are endless!
16 (66.7%)
I guess so, but I doubt I'd get much use out of it
7 (29.2%)
Forget it - waste of time
1 (4.2%)

Total Members Voted: 24

Voting closed: August 02, 2003, 06:56:05 am

Author Topic: WIP - .TBL PHP Parser?  (Read 8199 times)

0 Members and 1 Guest are viewing this topic.

Offline kode

  • The Swedish Chef
  • 28
  • The Swede
    • http://theswe.de
Quote
Originally posted by Sandwich



Pfft.... small play. ;)
 


except it doesn't seem to work. at least not for me (using opera)
Pray, v. To ask that the laws of the universe be annulled in behalf of a single petitioner confessedly unworthy.
- Ambrose Bierce
<Redfang> You're almost like Stryke 9 or an0n
"Facts do not cease to exist because they are ignored."
- Aldous Huxley
WAR IS PEACE
FREEDOM IS SLAVERY
IGNORANCE IS STRENGTH

 

Offline Sandwich

  • Got Screen?
  • 213
    • Skype
    • Steam
    • Twitter
    • Brainzipper
Quote
Originally posted by kode


except it doesn't seem to work. at least not for me (using opera)


Opera, eh? Try viewing it in IE and see if whatever isn't working works. Did this just get broken with this latest update?

Anyone else using Opera and not being able to view the parser?
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 Taristin

  • Snipes
  • 213
  • BlueScalie
    • Skelkwank Shipyards
Exploder loads it poifect. :)
Freelance Modeler | Amateur Artist

 

Offline Sandwich

  • Got Screen?
  • 213
    • Skype
    • Steam
    • Twitter
    • Brainzipper
Oi know, I wanted Kode to load it in Explorer so he could see  how it was supposed to be, and tell me what's different in Opera.
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 kode

  • The Swedish Chef
  • 28
  • The Swede
    • http://theswe.de
Quote
Originally posted by Sandwich


Opera, eh? Try viewing it in IE and see if whatever isn't working works. Did this just get broken with this latest update?

Anyone else using Opera and not being able to view the parser?


that navigational thingy didn't work yesterday. seems to work today tho. odd.
Pray, v. To ask that the laws of the universe be annulled in behalf of a single petitioner confessedly unworthy.
- Ambrose Bierce
<Redfang> You're almost like Stryke 9 or an0n
"Facts do not cease to exist because they are ignored."
- Aldous Huxley
WAR IS PEACE
FREEDOM IS SLAVERY
IGNORANCE IS STRENGTH

 

Offline mikhael

  • Back to skool
  • 211
  • Fnord!
    • http://www.google.com/search?q=404error.com
Quote
Originally posted by Sandwich

Pfft.... small play. ;)

And that's all from one single index.php... it generates the frameset and both the left navigation bar and the main section. :D

Heck, I even added the page title! ;)

Should I keep posting the PHP code? It's getting kinda big... 7kb ATM.


You rock my world. Post a link to a txt file containing the code--or add an option to cause the PHP to spit out its own code. Something like "...tbl_parser/index.php?raw", if you follow me.
[I am not really here. This post is entirely a figment of your imagination.]

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Quote
Originally posted by Sandwich
I fixed it a while ago, but forgot to post. Sorry.


I still don't see the ship names in the main frame. :confused:
-C

 

Offline Taristin

  • Snipes
  • 213
  • BlueScalie
    • Skelkwank Shipyards
They're there... I get them atleast.
Freelance Modeler | Amateur Artist

 

Offline Sandwich

  • Got Screen?
  • 213
    • Skype
    • Steam
    • Twitter
    • Brainzipper
Quote
Originally posted by WMCoolmon


I still don't see the ship names in the main frame. :confused:


What browser are you using? Take a screenie, if you don't mind. :)
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 Unknown Target

  • Get off my lawn!
  • 212
  • Push.Pull?
sorry, my head hurts. can someone put this in layman's terms?

  

Offline Sandwich

  • Got Screen?
  • 213
    • Skype
    • Steam
    • Twitter
    • Brainzipper
Quote
Originally posted by Unknown Target
sorry, my head hurts. can someone put this in layman's terms?


Simple. Go here and look at what the page does to a regular ships.tbl. :)

Anyway, after coding in frameset generation, I tried to go over the script, fix a few bugs, and modularize the thing into functions. Ha. Ha-ha. Ha-ha-ha. :rolleyes:

Anyway, after enough frustration for one day, I decided to streamline the whole thing by drawing up a flowchart for the parsing process. Lacking a nearby paper and the strength to get up and hunt one down, I ripped open my cellphone bill envelope and started writing. ;)

I've attached the file - feel free to nitpick and find things I missed before I start coding again. :p
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 Unknown Target

  • Get off my lawn!
  • 212
  • Push.Pull?
oooooh, ok, major koolio. :yes:

What you're trying to do is make it so that you can edit .TBL formats in this fashion, right? That's a great idea, will really help the new guys with .tbl modding, and streamline the process for the vets ;)

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
-C

 

Offline Sandwich

  • Got Screen?
  • 213
    • Skype
    • Steam
    • Twitter
    • Brainzipper
Quote
Originally posted by Unknown Target
oooooh, ok, major koolio. :yes:

What you're trying to do is make it so that you can edit .TBL formats in this fashion, right? That's a great idea, will really help the new guys with .tbl modding, and streamline the process for the vets ;)


In the end, yeah. First of all, though, is making sure that it parses .TBL files perfectly, otherwise if I try to actually build .TBL files with this thing, it could be majorly screwy.

Quote
Originally posted by WMCoolmon
Where have all the ship names gone?

There's a screenshot. :cool:


Hmm.... that's weird. What color depth are you running at? And which browser?

The white blocks aren't the ship names, BTW - that's the ship species, with each species having a differently colored background - green for Terran, beige for Vasudan, Red for Shivan, and two other colors - teal and blue, I believe - for Ancient(s) and anything else. :)

Mik and anyone else interested, I've attached the source code for the frames version. :)
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 WMCoolmon

  • Purveyor of space crack
  • 213
Er, ignore that. That's the result of accidentally making a color in the GIF transparent. :nervous: Those look fine, normally.

In the main frame, though, the ship names don't show up - the links don't work, either.

Here's the chunk of missing stuff for the Ulysses:
Code: [Select]
$Name:                          GTF Ulysses
$Short name:            TFight
$Species:                       Terran
+Type:                          XSTR("Space Superiority", 2939)
+Maneuverability:       XSTR("Excellent", 2940)
+Armor:                         XSTR("Light", 2941)
+Manufacturer:          XSTR("Triton / Mekhu", 2942)
+Description: XSTR( " ", 2943)
« Last Edit: August 09, 2003, 12:13:58 am by 374 »
-C

 

Offline Sandwich

  • Got Screen?
  • 213
    • Skype
    • Steam
    • Twitter
    • Brainzipper
Quote
Originally posted by WMCoolmon
Er, ignore that. That's the result of accidentally making a color in the GIF transparent. :nervous: Those look fine, normally.

In the main frame, though, the ship names don't show up - the links don't work, either.

Here's the chunk of missing stuff for the Ulysses:
Code: [Select]
$Name:                          GTF Ulysses
$Short name:            TFight
$Species:                       Terran
+Type:                          XSTR("Space Superiority", 2939)
+Maneuverability:       XSTR("Excellent", 2940)
+Armor:                         XSTR("Light", 2941)
+Manufacturer:          XSTR("Triton / Mekhu", 2942)
+Description: XSTR( " ", 2943)
[/B]


Hmm... that is weird. What version of IE is that happening under? And is that the page online, or are you running the PHP locally or on some other server, perhaps with a differently formatted ships.tbl?
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 mikhael

  • Back to skool
  • 211
  • Fnord!
    • http://www.google.com/search?q=404error.com
Quote
Originally posted by WMCoolmon
Er, ignore that. That's the result of accidentally making a color in the GIF transparent. :nervous: Those look fine, normally.

In the main frame, though, the ship names don't show up - the links don't work, either.

Here's the chunk of missing stuff for the Ulysses:
Code: [Select]
$Name:                          GTF Ulysses
$Short name:            TFight
$Species:                       Terran
+Type:                          XSTR("Space Superiority", 2939)
+Maneuverability:       XSTR("Excellent", 2940)
+Armor:                         XSTR("Light", 2941)
+Manufacturer:          XSTR("Triton / Mekhu", 2942)
+Description: XSTR( " ", 2943)
[/B]


Examine the page source in IE when you're missing stuff. You might also want to send Sandwich a copy of the html you're seeing. that would let him see if there's an intermittent failing in the script or other such problem.
[I am not really here. This post is entirely a figment of your imagination.]

 

Offline Sandwich

  • Got Screen?
  • 213
    • Skype
    • Steam
    • Twitter
    • Brainzipper
Bumpitty! :)

Ok, I've got a few questions about the .TBL files:

1. What's with these lines? [q]+Description:         XSTR( " ", 2943)
$end_multi_text[/q]

The use of $end_multi_text seems to be optional, and seems to be used after an XSTR() thingy. Can anyone tell me more? SCP dudes, perhaps?

2. The XSTR() itself has those mysterious numbers in the second half. When writing one's own table entry, I've been told to put in a -1 to avoid any conflicts. So what's the purpose of those numbers anyway?

3. Why do some lines start with a "+" as opposed to the regular "$"? Are they sub-data types of some sort?
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

 
i can't really help with the tables or PHP stuff, but i like what you're doing, and i see a major use for this in FW (http://nodewar.penguinbomb.com/fleetwars/)
because we were thinking about dynamicly generating everything from the table to the mision itself using PHP.
just another newbie without any modding, FREDding or real programming experience

you haven't learned masochism until you've tried to read a Microsoft help file.  -- Goober5000
I've got 2 drug-addict syblings and one alcoholic whore. And I'm a ****ing sociopath --an0n
You cannot defeat Windows through strength alone. Only patience, a lot of good luck, and a sledgehammer will do the job. --StratComm

 

Offline Flaser

  • 210
  • man/fish warsie
What really grabed my attention was the possibility to eventually store this in some real database. Now, that would be awsome - SQL anyone?

Beside I think this work should have been done ages ago, Sandwich you're one of my personal heroes!
"I was going to become a speed dealer. If one stupid fairytale turns out to be total nonsense, what does the young man do? If you answered, “Wake up and face reality,” you don’t remember what it was like being a young man. You just go to the next entry in the catalogue of lies you can use to destroy your life." - John Dolan