Q3F Stats
Theme Files Information
Updated: June 4, 2002/PsyberS


Table of Contents
------------------
  1. Introduction
  2. General Rules
  3. Global Tags
  4. The Flag Touches Loop
     a. Tags
  5. The Flag Captures Loop
     a. Tags
  6. The Playerinfo Loop
     a. Tags
     b. The Player Kill Count Loop
     c. The Weapon Kill Count Loop
     d. The Weapon Death Count Loop
     e. The Defenses Loop
  7. The Awards Loop
     a. Tags
  8. The MM1 Loop
     a. Tags


Chapter 1 - Introduction
-------------------------
  Theme files will allow you to create a statistics page that looks exactly how you want it to look.
Theme files are normal text files that end with the extension .thm.  Several themes come with Q3F
Stats or if you want, you can make your own.  Before making your own theme, you should look through
one of the example themes and try to get an idea of how they work.


Chapter 2 - General Rules
--------------------------
  A theme file is basically a HTML file with a few extra tags.  Every special tag for the theme system
is surrounded by <= =>.  For example, <= TITLE => will display the program's title.  Each tag must
appear on a line by itself, they can not be put in the middle of a line (at the moment).
  There are also loops in the themes.  These loops will take any text between the start and end tags,
and output statistics according to that text.  Loops can be nested inside each other so if for example
you wanted to do a loop displaying all flag captures and next to the person's name and number of
captures you wanted to display how many times they died, you could include a Playerinfo loop inside
the Flag Captures loop.
  Each player is given a unique ID#.  This number is the same in every single loop and is useful if
you want to link a player's name to another section with for example, that player's individual stats.

:::IMPORTANT NOTE:::
  One important note is that your theme must inclue a CSS <style> tag inside the <head> tag.  You must
include the CSS classes .color1 - .color9 and .colorstar.  You can also optionally include the class
.suicide which will change the color of the player's number of suicides in the Player KillCount loop.

If you have no idea what any of that means, then simply paste the following code inside of your
<head></head> tags:

<head>
  <style type="text/css">
    .suicide { color: #ff0000; }

    .color0 { color: #666666; }
    .color1 { color: #ff0000; }
    .color2 { color: #00ff00; }
    .color3 { color: #ffff00; }
    .color4 { color: #0000ff; }
    .color5 { color: #00f5ff; }
    .color6 { color: #e066ff; }
    .color7 { color: #dddddd; }
    .color8 { color: #666666; }
    .color9 { color: #ff0000; }
    .colorstar { color: #dddddd; }
  </style>
</head>

:::IMPORTANT NOTE:::


Chapter 3 - Global Tags
------------------------
  Global Tags are available anywhere, even inside any of the loops.

Chapter 3a - Tags
+------------------+-------------------------------------------------+
| Theme Tag        | Description                                     |
+------------------+-------------------------------------------------+
| <= TITLE =>      | Program Title                                   |
| <= VERSION =>    | Program Version                                 | 
| <= AUTHOR=>      | Author's Name                                   |
| <= DATE =>       | Current Date (mm/dd/yy)                         |
| <= TIME =>       | Current Time HH:MM:SS am/pm                     |
| <= NUMLINES =>   | Number of lines parsed                          |
| <= DURATION =>   | How long it took to parse (in seconds)          |
| <= TEAMNAME1 =>  | Team 1's Name                                   |
| <= TEAMNAME2 =>  | Team 2's Name                                   |
| <= TEAMNAME3 =>  | Team 3's Name                                   |
| <= TEAMNAME4 =>  | Team 4's Name                                   |
| <= TEAMSCORE1 => | Team 1's Score                                  |
| <= TEAMSCORE2 => | Team 2's Score                                  |
| <= TEAMSCORE3 => | Team 3's Score                                  |
| <= TEAMSCORE4 => | Team 4's Score                                  |
| <= WINORLOSS =>  | Will say wether Team 1 beat/tied/loss to Team 2 |
+------------------+-------------------------------------------------+


Chapter 4 - The Flag Touches Loop
----------------------------------
  This loop will allow you to display Flag Touch information.

Chapter 4a - Tags
+---------------------+-------------------------------------------------+
| Theme Tag           | Description                                     |
+---------------------+-------------------------------------------------+
| <= FLAGTOUCHLOOP => | Inidicates the beginning of the loop            |
| <= NAME =>          | Will show the player's name                     |
| <= TOUCHES =>       | Will show the player's number of touches        |
| <= ID =>            | Will show the player's ID#                      |
| <= ENDLOOP =>       | Indicates the end of the loop                   |
+---------------------+-------------------------------------------------+


Chapter 5 - The Flag Captures Loop
-----------------------------------
  This loop will allow you to display Flag Capture information.

Chapter 5a - Tags
+-------------------+-------------------------------------------------+
| Theme Tag         | Description                                     |
+-------------------+-------------------------------------------------+
| <= FLAGCAPLOOP => | Inidicates the beginning of the loop            |
| <= NAME =>        | Will show the player's name                     |
| <= CAPS =>        | Will show the player's number of flag captures  |
| <= ID =>          | Will show the player's ID#                      |
| <= ENDLOOP =>     | Inidicates the end of the loop                  |
+-------------------+-------------------------------------------------+


Chapter 6 - The Playerinfo Loop
--------------------------------
  This loop will go through each player one at a time, allowing you access to that individual player's
statistics. This loop *can* be nested inside itself.

Chapter 6a - Tags
+--------------------+--------------------------------------------------+
| Theme Tag          | Description                                      |
+--------------------+--------------------------------------------------+
| <= PLAYERLOOP =>   | Indicates the beginning of the loop              |
| <= ID =>           | Will show the player's ID#                       |
| <= NAME =>         | Will show the player's name                      |
| <= STRIPPEDNAME => | Will show the player's name w/o Q3 color codes   |
| <= COUNTER =>      | Will show a counter starting at 1                |
| <= RANK =>         | Will show the player's rank                      |
| <= MM1 =>          | Will show the player's number of mm1 messages    |
| <= SELFGREN =>     | Will show the player's of held grenades          |
| <= GRENRATIO =>    | Ratio of gren kills to normal kills              |
| <= KILLS =>        | Will show the player's number of kills           |
| <= DEATHS =>       | Will show the player's number of deaths          |
| <= TKDEATHS =>     | Will show the player's number of teamkill deaths |
| <= TOTALDEATHS =>  | Will show the player's number of tk+normal deaths|
| <= TKS =>          | Will show the player's number of teamkills       |
| <= SUICIDES =>     | Will show the player's number of suicides        |
| <= TOUCHES =>      | Will show the player's number of flag touches    |
| <= CAPS =>         | Will show the player's number of flag captures   |
| <= DROPS =>        | Will show the player's number of flags dropped   |
| <= C2CS =>         | Will show the player's flag coast-to-coasts      |
| <= FLAGSAVES =>    | Will show number of flag carrier kills           |
| <= ENDLOOP =>      | Inidicates the end of the loop                   |
+--------------------+--------------------------------------------------+

Chapter 6b - The Player Kill Count Loop
----------------------------------------
NOTE:  This loop is *only* available inside of a Playerinfo Loop.
  This loop will use the current player in the Playerinfo loop and cycle through every single player
(including the current one) and allow you access to how many times they killed each player.
+--------------------+----------------------------------------------------------+
| Theme Tag          | Description                                              |
+--------------------+----------------------------------------------------------+
| <= KILLCNTLOOP =>  | Indicates the beginning of the loop                      |
| <= COUNT =>        | How many times Playerinfo Loop player killed this player |
| <= COUNTER =>      | A counter for the loop starting at 1                     |
| <= ENDLOOP =>      | Indicates the end of the loop                            |
+--------------------+----------------------------------------------------------+

Chapter 6c - The Weapon Kill Count Loop
----------------------------------------
NOTE:  This loop is *only* available inside of a Playerinfo Loop.
  This loop will use the current player in the Playerinfo loop and cycle through every weapon allowing
you to show how many times the player killed someone with the weapon.
+--------------------+--------------------------------------------------+
| Theme Tag          | Description                                      |
+--------------------+--------------------------------------------------+
| <= WEAPKILLLOOP => | Indicates the beginning of the loop              |
| <= WEAPON =>       | The weapon's name                                |
| <= COUNT =>        | How many kills the player had by this weapon     |
| <= EFFICIENCY =>   | # of kills by this weapon / # of total kills     |
| <= COUNTER =>      | A counter for the loop starting at 1             |
| <= ENDLOOP =>      | Indicates the end of the loop                    |
+--------------------+--------------------------------------------------+

Chapter 6d - The Weapon Death Count Loop
-----------------------------------------
NOTE:  This loop is *only* available inside of a Playerinfo Loop.
  This loop will use the current player in the Playerinfo loop and cycle through every weapon allowing
you to show how many times the player was killed by someone with the weapon.
+---------------------+--------------------------------------------------+
| Theme Tag           | Description                                      |
+---------------------+--------------------------------------------------+
| <= WEAPDEATHLOOP => | Indicates the beginning of the loop              |
| <= WEAPON =>        | The weapon's name                                |
| <= COUNT =>         | How many deaths the player had by this weapon    |
| <= EFFICIENCY =>    | # of deaths by this weapon / # of total deaths   |
| <= COUNTER =>       | A counter for the loop starting at 1             |
| <= ENDLOOP =>       | Indicates the end of the loop                    |
+---------------------+--------------------------------------------------+

Chapter 6e - The Defenses Loop
-----------------------------------------
NOTE:  If used outside of a <= PLAYERLOOP => it will only cycle through the names of every defense.
The data for <= COUNT => will be unknown.
  This loop will use the current player in the Playerinfo loop and cycle through every flag defense
to show how many times the player earned each defense award.
+---------------------+--------------------------------------------------+
| Theme Tag           | Description                                      |
+---------------------+--------------------------------------------------+
| <= DEFENSESLOOP =>  | Indicates the beginning of the loop              |
| <= NAME =>          | The defense's name                               |
| <= COUNT =>         | How many times the player earned this defense    |
| <= COUNTER =>       | A counter for the loop starting at 1             |
| <= ENDLOOP =>       | Indicates the end of the loop                    |
+---------------------+--------------------------------------------------+


Chapter 7 - The MM1 Loop
-------------------------
  This loop allows you to display all MM1 messages that occurred during the course of the actual game.
The parser will determine when the game 'started' by: a player being killed (including suicides) or
flags being touched or captured.  It will also display any name changes that occurred during the game.

Chapter 7a - Tags
+---------------+--------------------------------------------------+
| Theme Tag     | Description                                      |
+---------------+--------------------------------------------------+
| <= MM1LOOP => | Indicates the beginning of the loop              |
| <= NAME =>    | The player's name talking                        |
| <= MESSAGE => | What the player said                             |
| <= COUNTER => | A counter for the loop starting at 1             |
| <= ENDLOOP => | Indicates the end of the loop                    |
+---------------+--------------------------------------------------+


Chapter 8 - The Awards Loop
----------------------------
  This loop displays the awards you had parsed.  If you want to number the awards use the COUNTER tag.

Chapter 8a - Tags
+------------------+--------------------------------------------------+
| Theme Tag        | Description                                      |
+------------------+--------------------------------------------------+
| <= AWARDSLOOP => | Indicates the beginning of the loop              |
| <= AWARDNAME =>  | The award's name                                 |
| <= WINNER =>     | Text saying who won the award                    |
| <= COUNTER =>    | A counter for the loop starting at 1             |
| <= ENDLOOP =>    | Indicates the end of the loop                    |
+------------------+--------------------------------------------------+
