Game Development Community

Scripted HTMLparser

by AIDan · in Torque Game Engine · 12/15/2001 (12:30 pm) · 23 replies

Hi

I want some feedback for my today's work.

www.futureint.de/torque/htmlparser/

This screenshot is the linked page, without any changes. It's exactly the same.


Features:

- Supports different font types. Always the first font is used.
    font face="Arial, Helvetica, sans-serif"
- Supports bitmaps. You have to use local paths, but all paths are automatically made absolute.
- Supports different font sizes.
- Supports URLs.
- Supports different alignments.
- HTML Encoding
    & euro; ->  etc.
- Easy use
    aboutText.setText(htmlToTorque("carrier/onflydata/html"));

TODO:

- Support for different font mods (bold, italic, etc.)
- Linked bitmaps.
- getHtmlTitle(%htmlfile) for window titles.
- Frame support (Add invisible GUI windows).
- JavaScript support for popping up windows.
- Style Sheet support.
- Support for other GuiControls in Torque (Checkbuttons, etc.).
- Ability to cache converted files, so everything becomes a bit faster (CRC to check files and export of variables for saving).
- Debugging...

I think this is better than including a whole browser.
The parser completely bases on the tags included in Torque. There is no coding needed and it is directly included in the GUI.

greetings
Daniel
Page «Previous 1 2
#1
12/15/2001 (1:30 pm)
But I want it!!!

:)

Looks cool, how do we use it?
#2
12/15/2001 (1:43 pm)
> I think this is better than including a whole browser.

Why do you say that? I'd say supporting javascript and CSS is a little more than one line in a list of features to come. It's hard to implement that stuff *properly*. Actually no one has done it to date (100% with no bugs) - and they've (Netscape, MS, Opera) been making browsers for years.

Oh and one nit pick... your html is missing the HTML 4.01 transitional doctype and alt attributes on the images.

Here is the HTML validator:
http://validator.w3.org/check?uri=http%3A%2F%2Fwww.futureint.de%2Ftorque%2Fhtmlparser%2F&charset=%28detect+automatically%29&doctype=HTML+4.01+Transitional
#3
12/15/2001 (1:44 pm)
You can trust me, it still works bad.
I still have to find some solutions for layout problems.
Just give it a few days more. We want to use it too, but it's the first version and makes still some trouble.

Files are now cached, so everything becomes much faster.

I give you an example.

SOURCE:
function aboutDlg::onWake(%this)
{
   %text="<just:center><font:Arial Bold:20>Torque Game Engine Test Application\n( v1.1.0 )\n"@
         "<font:Arial:12>"@ getCompileTimeString() @", "@ getBuildString() @"Build\n\n"@
         "<font:Arial:16>Copyright (c) 2001 <a:www.garagegames.com>GarageGames.Com</a>\n"@
         "Portions Copyright (c) 2001 by Sierra Online, Inc.\n\n"@
         "<bitmap:fps/client/ui/gglogo150.png>";
   aboutText.setText(%text);   
}

WITH HTML PARSER:
function AboutPane::onWake(%this)
{
	aboutText.setText(htmlToTorque("carrier/onflydata/html/index.html"));
}

greetings
Daniel
#4
12/15/2001 (1:56 pm)
It's a parser, no browser.

You can use it, so you don't have to script your mission briefings by hand.

It's really primitive.

greetings
Daniel

ps
Do you think I wrote this page on my own??
This would make the parser useless.
It makes no sense to include information which are not processed by the script.
CSS support means, it will be able to work with redefined HTML tags. Did you think you would be able to do more?? I want to make a game, no browser.
#5
12/15/2001 (2:39 pm)
well, I'll be patient, it looks cool and will solve some conceptual problems I was having :)

Can't wait to see it :)
#6
12/15/2001 (2:57 pm)
Now, I got redefining HTML tags (headings only) working via external CSS file.

I still have to improve some things.
#7
12/16/2001 (8:32 am)
Hi

This screenshot is from the current version. I hope it makes some people think better about using a simple parser.
www.futureint.de/torque/htmlparser/example.jpg
The link: www.futureint.de/torque/htmlparser

Now you can browse trough the pages and use the following links:

torque://localhost@fps/data/missions/scorchedPlanet.mis
    Starts a new server with Scorched Planet mission.

torque://192.268.23.12
    Joins a server.

exec://fps/client/scripts/example.cs
    Executes a script file.
At the moment, it is used in this way:

TestWindow is a GuiWindowCtrl.
testText is a GuiMLTextCtrl.

function TestDlg::onWake(%this)
{
	// index.html is added, when missed.
	openhtml("carrier/onflydata/html", testText);
	setGuiHTMLBackgroundColor(TestWindow);
	setGuiHTMLTitle(TestWindow);
}

function testText::onURL(%this, %url)
{
	processOnURL(%this, %url, TestWindow);
}

greetings
Daniel
#8
12/16/2001 (9:21 am)
Now you are just teasing me :)

That's very cool.
#9
12/16/2001 (10:38 am)
Now I have added support for CSS stored in the page itself and error handling (File Not Found, etc.).

Tomorrow, I will optimize it a bit more and give it free for download.

greetings
Daniel
#10
12/16/2001 (11:17 am)
Cool, looking forward to it.

Between this and the mySQL stuff you did, we could have a very cool little setup :)
#11
12/24/2001 (2:27 pm)
Merry Christmas

After some stupid tests at school :(
and a remake of the parsing function, you can now download the parser.

www.futureint.de

greetings
Daniel
#12
12/26/2001 (5:32 pm)
Sweet :)
#13
12/28/2001 (8:28 am)
Sorry, I don't actuall see a download l9ink on that site? Am I missing something?
#14
12/28/2001 (11:22 am)
Torque Game Engine Extensions/webparser/here

http://www.futureint.de/torque/webparser/webparser.zip
#15
12/29/2001 (6:38 am)
Never mind, found the instructions.

Are you gonna continue to develop this? Will other things (form fields and meta tags) eventually be supported?
#16
12/29/2001 (10:01 am)
GuiControls requires space which has to be made with paragraphs.
Maybe you saw the problem with the images. It's the same.
The images are shown but there is no space reserved, so they are placed directly into the text and break the lines.

This is the next thing I'm going to fix next.
I know how to fix it.

Last days, I spend some time including textures and models in our game.

I think I will fix this in the first week of the new year.

greetings
Daniel
#17
01/01/2002 (3:09 pm)
Hehe, keep us updated :)

Thanks, it's very cool :)
#18
01/11/2002 (2:34 am)
first thanks for sharing your good things with the community.

still haven't had a chance to check it out, but.....
what would the chance be of getting flash in as a texture, with interactivity?

big ask but damn we could do some serious damage with a bit of that up and running....
#19
01/11/2002 (5:14 am)
To play flash files, you would need the ability to open and show flash files.

If you want animated textures use .dml files or wait for the shaders.

As I know Flash images are just jpeg compressed, so you should use jpegs instead.

greetings
Daniel
#20
01/11/2002 (8:39 pm)
ah, i'll look into the dml approach, sounds promising.
will it default to one image = 1 frame ?

flash also does a whole bunch of vector stuff and interactive/ actionscript bits and pieces.

i am aware of a group working on this same thing at www.opengl.org

really early developement though, looks interesting.
Page «Previous 1 2