ManiaCode Tutorial
From TM Wiki
How to use ManiaCodes
For an overview of ManiaCodes, check this article
For an overview of ManiaLinks, check this article
To create your ManiaCode, you must :
- Create the ManiaCode XML file using the following syntax
- Upload it to a classic web server (with direct access to the file)
- Upload all the related files (not necessarily on the same server)
- Register the ManiaCode in your ManiaLinks (not available yet)
To use a ManiaCode : you have to enter it's code into the adresse bar of the ManiaLink navigator in TM United
ManiaCode Syntax
External Tag
A maniacode file is a XML file. The top tag is maniacode. All script commands must be inside this tag.
<?xml version='1.0' encoding='utf-8' ?> <maniacode> GF-LUIGI </maniacode>
show_message : display a message
You can display a message in a text box. Use the following command and set you message inside the message tags.
Please remember that your maniacode could be read by any people, so take care of the language you use and what is the purpose of your mania code.
<show_message>
<message>Test mania link</message>
</show_message>
install_track : Download and install a track
The url parameter point the map file. It can be anywhere on the Net, but must be on a classic webserver, not with specific download process such as Rapidshare. TMX is a classic web hosting. So you can use it.
The name parameter shoud be used th rename the file after download. Name.Challenge.Gbx.
<install_track> <name>TrackDavid</name> <url>http://data.trackmaniaunited.com/tracks/TrackDavid.Challenge.Gbx</url> </install_track>
play_track : Download, install and play a track in solo mode
The url parameter point the map file. It can be anywhere on the Net, but must be on a classic webserver, not with specific download process such as Rapidshare. TMX is a classic web hosting. So you can use it.
The name parameter shoud be used th rename the file after download. Name.Challenge.Gbx.
<play_track> <name>TrackDavid</name> <url>http://data.trackmaniaunited.com/tracks/TrackDavid.Challenge.Gbx</url> </play_track>
The map is not saved on the disk. So it can be played only once
install_replay : Download and install a replay
The url parameter point the replay file. It can be anywhere on the Net, but must be on a classic webserver, not with specific download process such as Rapidshare. TMX is a classic web hosting. So you can use it.
The name parameter shoud be used th rename the file after download. Name.Replay.Gbx.
<install_replay> <name>ReplayDavid</name> <url>http://data.trackmaniaunited.com/replays/ReplayDavid.Replay.Gbx</url> </install_replay>
view_replay : Download, install and view a replay
The url parameter point the replay file. It can be anywhere on the Net, but must be on a classic webserver, not with specific download process such as Rapidshare. TMX is a classic web hosting. So you can use it.
The name parameter shoud be used th rename the file after download. Name.Replay.Gbx.
<view_replay> <name>ReplayDavid</name> <url>http://data.trackmaniaunited.com/replays/ReplayDavid.Replay.Gbx</url> </view_replay>
The replay is not saved on the disk. So it can be viewed only once
join_server : Enter multiplayer and connect to the specified server
The ip parameter is the IP address, ":" and the port number.
<join_server> <ip>213.186.41.190:30000</ip> </join_server>
install_skin : generic installation of a skin.
Download and install a skin. Then ask the user if he wants to use this skin in his profile.
The name parameter is probably for displaying a message. The file parameter is the target for installation. the install path will define the file type. Beware of this parameter, if the file folder is wrong, the skin won't work. The url parameter point the skin file. It can be anywhere on the Net, but must be on a classic webserver, not with specific download process such as Rapidshare. CarPark, SkinCenter, Blocktuner are classic web hosting. So you can use them.
<install_skin> <name>TestDavid</name> <file>Skins/Vehicles/SportCar/TestDavid.zip</file> <url>http://data.trackmaniaunited.com/vehicles/TestDavid.zip</url> </install_skin>
Supported file types
Each available file types are listed with their path.
- Car skin : Skins/Vehicles/<car env>/<name>.zip
- Avatar : Skins/Avatars/<name>.jpg (support subfolders)
- Music : ChallengeMusics/<name>.ogg (or .mux)
- Engine Sounds : Skins/CarEngines/<name>.zip (prepare your car engine sounds in this zip)
to be completed, TMUP specifications are a good repository of all know available TM skins
Locators are created automatically. Don't ad them in your ManiaCode !
Examples
This ManiaCode executes following actions
- Display a message
- Install a skin, probably asking fo setting it in profile
- Install a track
- Show another message
<?xml version='1.0' encoding='utf-8' ?>
<maniacode>
<show_message>
<message>Toi aussi utilise l'avatar de toto et son circuit preféré!</message>
</show_message>
<install_skin>
<name>Totoro</name>
<file>Skins/Avatars/Misc/Totoro.jpg</file>
<url>http://data.trackmaniaunited.com/avatars/Totoro.jpg</url>
</install_skin>
<install_track>
<name>TrackDavid</name>
<url>http://data.trackmaniaunited.com/tracks/TrackDavid.Challenge.Gbx</url>
</install_track>
<show_message>
<message>voilĂ c'est fait!</message>
</show_message>
</maniacode>

