Locator Files

From TM Wiki

Jump to: navigation, search

A locator file is used in Trackmania games as a way for transferring custom content while decreasing stress on limited personal internet connections. In order to save computers the hassle of over-using the peer-to-peer transfer system, a locator may be used. This is how custom Car Skins, Avatars, Billboards and other custom content is transferred between computers.

Contents

What is a Locator?

A Locator is a very small file which contains the web address of a resource such as a Car Skin or Avatar. When you use a locator file, players connecting to your computer will download that data from the source specified within the locator file and not from your computer. This is especially useful to those who do not have very powerful internet connections and do not wish to have many players downloading the media directly.

How Do I Use a Locator?

For the purposes of this example, we'll assume that you need to create a locator for a Car Skin in the TrackMania Sunrise island environment named "CarSkin.zip". First, you will need to find a host for the skin. IMPORTANT: you must use a host which allows direct linking. For the purposes of this example, we'll assume that your host is example.com, and that you have placed the skin in the folder /you/.

To create the locator file, open Notepad, and type:

http://example.com/you/CarSkin.zip

Then save the file in Trackmania Sunrise\GameData\Skins\Vehicles\SportCar\.

Name the file CarSkin.zip.loc

In order for this dual-file extension to work, you must change the file type from text files (with a .txt. extension) to any file (*.*). The next time you play online with CarSkin, those with whom you play will download CarSkin.zip from example.com/you/.

General Rules

  1. Locator files must be in the same directory as the media file.
  2. The locator must only contain the URL of the media.
  3. The host used 'must allow direct linking. (This is not a host which allows direct linking. This site allows direct linking

How to Create Locator Files for Many Files?

It's a rare, but annoying problem: You just have created a new sign pack or a batch of billboards for your clan, in short you have a bunch of files you want to create locator files for. Here is how it can be done easily:

  1. Check which URL your files will be available from, e.g. http://mybox.mydomain.com/.
  2. You also need to know the file extension of the files you are dealing with, e.g. *.jpg for images, *.zip for DDS images, *.ogg or *.mux for music files.
  3. Under Windows open a command line window in the directory where your signs, images, music files or whatever are located and enter the following:


for %z in (*.zip *.jpg) do echo http://mybox.mydomain.com/%z >%z.loc


This will create locator files for all *.zip and *.jpg media files in the current directory all at once. Add as many file extensions as you need, e.g. just (*.jpg) or (*.zip *.jpg *.bik) or even (*.zip *.jpg *.mux *.ogg *.bik).

Tools

There are several tools to create a locator automatically:

Personal tools
In other languages