ManiaCode Tutorial

From TM Wiki
Jump to: navigation, search

Contents

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>

Note: if you don't want the "Maniacode completed" message, you can use <maniacode noconfirmation="1">

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 to 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>

This also works with "login" instead "ip".

<join_server>
	<login>testserver</login>
</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>


add_buddy : add a buddy to your buddylist.

Makes it possible to let someone add you to his buddylist. Only write YOUR (please not the login from other players) login between the add_buddy tag.

<add_buddy>
         <login>msfirefox</login>
</add_buddy>


add_favourite : add a server to your favourite servers.

Makes it possible to add a server to your favourite servers directly from a ManiaLink. Useful to make your server famouse if you got a well-attended ManiaLink. Only write the serverlogin or ip between the add_favourite tag. If you use IP, use this sheme: serverip:port.

With IP:

<add_favourite>
         <ip>213.186.41.190:30000</ip>
</add_favourite>

With login:

<add_favourite>
         <login>testserver</login>
</add_favourite>


play_replay : play against the replay.

This tag downloads a replay which url is given in the url-tag. After finshing the download, the map (driven by the replay) will start and you have to drive against the downloaded replay. The name parameter shoud be used to rename the file after download. Name.Replay.Gbx. Attention: The downloaded replay will only be saved in cache, so it isn't saved to your TrackMania.

<play_replay>
       <name>TestReplay</name>
       <url>http://www.yourwebspace.de/Replays/TestReplay.Replay.Gbx</url>
</play_replay>


get_skin : load a skin to see it in a replay.

This will download a skin to the TM-cache. If you want that other people can see your skin used in a replay, add this tag in the same ManiaCode as the replay. The tag name declares the name of the skin which will be downloaded. The tag url gives the download link for the skin. The tag file will show the path where to save the skin. This should usually be Skins/Vehicles/CarCommon/<name>.zip

<get_skin>
       <name>((( Firefox</name>
       <url>http://firefoxmods.hp22.com/Skins/(((%20Firefox.zip</url>
       <file>Skins/Vehicles/CarCommon/((( Firefox.zip</file>
</get_skin>


goto : redirect to another ManiaCode or ManiaLink.

This is very useful if you want to make 1000 Coppers payment in a Maniacode. Only write the ManiaCode or ManiaLink where you want to redirect the user between the goto-tag.

<goto>
       <link>HomeFirefox</link>
</goto>


install_track_pack : install a Trackpack.

If you want to put some Tracks into a specific folder. Be careful: there is NO Zip-File!! First write <install_track_pack> then <name> for the folder's name. Then for each Track you want to have in your Trackpack <track>. Betweeen this tag <name>, for the Trackname and after this <url>, for the download link. This example Pack will be installed into \Tracks\Challenges\Downloaded\Manialink\Testfolder:

<install_track_pack>
	<name>Testfolder</name>
	<track>
	  <name>Trackname1</name>
	  <url>http://www.yourdomain.com/Tracks/Test.Challenge.Gbx</url>
	</track>
	<track>
	  <name>Trackname2</name>
	  <url>http://www.yourdomain.com/Tracks/Test2.Challenge.Gbx</url>
	</track>
</install_track_pack>


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 add 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>

Credits

Special thanks to the one who wrote the old tutorial.
Updated by Firefox | FirefoxMods.
I added: add_buddy , add_favourite , play_replay , get_skin , goto, install_track_pack and the note at join_server with login.
Also thanks to Konte for the information to play_replay and get_skin and install_track_pack (the three tags, I didn't know how to use).
I got another Maniacode, but I dont get the sense behind it.


--Firefox 18:38, 27 November 2009 (UTC) | FirefoxMods

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox
In other languages