

ShellShock's Crater
Creating
HTML Statistics
Back
to Contents
Q3Stats can display game statistics as an HTML file
in a browser (Note: only Internet Explorer 5 or greater is supported).
If you have problems viewing the statistics in your
browser window, then you may need to update your installation of Microsoft's XML
parser: Installing Microsoft's XML Parser.
Three files are required to create the HTML
statistics:
- q3stats.html, located in the Q3Offline Templates
sub-directory. This is the template HTML file, and contains the
following:
- HTML HEAD and BODY tags, and a
small amount of the HTML that will be displayed.
- JAVASCRIPT code to apply the XSL stylesheet
to the XML statistics, and insert the resulting HTML into the body of
the HTML file.
If you are familiar with HTML and JAVASCRIPT,
you can edit this file, e.g., to change some of the formatting of the
document, such as background and text colour. Do not change anything between
the //Q3STATS_START and //Q3STATS_END lines, as this is
required by Q3Stats.
- q3stats.xsl, located in the Q3Offline Templates
sub-directory. This is the XSL (Extensible Stylesheet Language) file,
which transforms the XML file containing the game statistics, into HTML
tables which can then be inserted into the body of the HTML document.
If you are familiar with XSL, you can edit this
file to change how the XML is transformed into HTML.
- filename_stats.xml. This is the XML
file which contains the game statistics in XML format. filename is
the same as the name of the current Q3Stats document, and in the same
directory. For example, if your Q3Stats document is called c:\Docs\q3a.q3s,
then the XML file will be called c:\Docs\q3a_stats.xml.
The HTML statistics are created when:
- You select Create HTML on the Q3Stats File
menu.
- You exit from a game launched by Q3Offline, and
the following options are set on the Q3Offline Log page:
- Enable Q3Stats is ticked.
- Create HTML statistics is ticked.
To create the HTML statistics Q3Stats does the
following:
- Saves the game statistics as XML in the filename_stats.xml
file.
- Copies the q3stats.xsl file from the
Q3Offline Templates sub-directory to the same directory as the
Q3Stats .q3s document. The copied q3stats.xsl file is renamed to filename_stats.xsl,
where filename is the same name as the .q3s document.
- Copies the q3stats.html file from the
Q3Offline Templates sub-directory to the same directory as the
Q3Stats .q3s document. The copied q3stats.html file is renamed to filename_stats.html,
where filename is the same name as the .q3s document. During the
copy, Q3Stats replaces the lines between the //Q3STATS_START and //Q3STATS_END
comments with the correct file names for the filename_stats.xml
and the filename_stats.xsl files.
For example, if your Q3Stats document is called
c:\Docs\q3a.q3s, then after the HTML statistics have been created, you will have
three new files:
c:\Docs\q3a_stats.xml
c:\Docs\q3a_stats.xsl
c:\Docs\q3a_stats.html
The c:\Docs\q3a_stats.html file will contain
the lines:
var g_sXSLFileName = "q3a_stats.xsl";
var g_sXMLFileName = "q3a_stats.xml";
To display the statistics, simply open the c:\Docs\q3a_stats.html
file in a browser (Internet Explorer) window.
The statistics are displayed in tables; clicking on
the button at the head of each column will sort the whole table on that column.
There are also links between the tables for easy navigation.
You can copy and use the three files elsewhere;
just make sure you copy them to the same directory.
HTML, XML and XSL are standard languages and are
widely used on the Internet. See the World Wide Web
Consortium Web Site for more details.