TEML USAGE

Earthcall is a homebrew open source server for Planet Ring. This is the official forum for both the online game server as well as the open source project itself. Meet other players, report bugs, and have fun!

Moderators: Indiket, Neoblast

Post Reply
User avatar
Neoblast
DC Developer
DC Developer
Posts: 312
Joined: Sat Dec 01, 2007 8:51 am

TEML USAGE

Post by Neoblast » Tue Aug 20, 2013 6:30 pm

Introduction
Planet Ring uses a HTML like markup language to display news, contests, info and statistics about the game in the information board. TEML stands for TOM'S EMBEDDED MARK UP LANGUAGE, one of the game's original programmers. TEML files are standard ANSI text files.

INFORMATION BOARDS
In the information center there are 3 information browsers, each one covering a different aspect of the game, all of them are TEML files requested by the client, the file structure would be the following:

GREEN BROWSER
ONLINE MANUAL
a_home_%c.teml : Attraction Info

ORANGE BROWSER
NOTICE BOARD
n_home_%c.teml : Notice Board

BLUE BROWSER
HIGH SOCRE RANKINGS
r_home_%c.teml : Ranking Board

WORLD MAP
Opens a teml file with only an IMG tag

WHERE TO STORE TEML FILES
TEML files and PNG images must be stored inside system/TEML relative folder.

IMPORTANT INFO ABOUT LANGUAGES IN TEML
Right after:

home_%c
in the teml filename, the client requests for a different teml file depending on the console language!
Example:

a_home_s.teml -> when its set to spanish
a_home_e.teml -> when its set to english

TEML PACKET STRUCTURE

The client connects through TCP port 8001, all data is sent in binary mode.

The TEML command have three parts:

- The header "TEML" (4 bytes)
- The size of the page data (4 bytes-> unsigned long file size)
- The actual page data (starting after that at offset 0x08) BINARY MODE

TEML TAGS

* <TEML></TEML>
Open and close a TEML page.

* <BR>
Jump line.

* <CENTER>Text</CENTER>
Text or elements rendered inside will be centered to screen.

* <IMG FILENAME.PNG>
When using IMG tag, Client asks to server for this resource. Also, must be send in binary format.

* <LINK URL.TEML>Text</LINK>
Shows a cool link in the TEML page (blue and yellow). When user press A, client ASKS for the TEML page: FRQ#URL.TEML

* <COL 255 0 255>
Sets color for the following text. This tag does not close, so if you want another color just create another COL tag. Format is RGB 888 in decimal, where 0 is the min. value and 255 the max. one.

* <FRAME 50 50 200 200>Text</FRAME>
Creates an Absolute position (as a DIV), with X1 Y1 X2 Y2. Min. value is 0 and Max. value 359.

* <GROUP InternalName ExternalName>Text</GROUP>
With GROUP we can create POST variables: It creates a SUBMIT link that when the user push on it, it sends a PST command.

- InternalName: Is the name of the Group: all POST elements inside GROUP must use this name.
- ExternalName: Is the name that PST command will give of the form when is sending the POST.

Inside GROUP we can put text and/or NUMITM, but NEVER a POST tag, or the game will freeze!!

* <NUMITM InternalName ExternalName minVal maxVal Value>
Creates a Number selector (User can choose a Numeric Value from a range).

- InternalName: Must match with the Group InternalName
- ExternalName: Name of the item that will see in the PST command.

Value in the PST is sent in HEX format! (so, we should convert to Decimal).


<GROUP interno formulario>
<NUMITM interno valor1 2 20 10>
<BR>
<NUMITM interno valor2 0 100 50>
<BR>
</GROUP>


* <TAB Num>Text
Do a Tabulator to the following text. Num is an X coordinate, from 0 to 359.

* <END>
Alias of </TEML>. Stops anything coming later.


IMAGE FORMAT

Planet Ring will only load PNG images (not PVR), but supports transparency. Max. render size of an image is aprox. 256x256, although you can load a bigger image (300x300). Image keep in front of text (so, no background can be used, even using FRAMES).
Post Reply