[Tutorial] Editing trackst.dat

Discuss, get help with, or post new modifications, graphics or related tools for Locomotion in this forum.

Moderator: Locomotion Moderators

Post Reply
The Fjonis
Traffic Manager
Traffic Manager
Posts: 238
Joined: 11 Sep 2004 16:52
Location: Bergen, Norway

[Tutorial] Editing trackst.dat

Post by The Fjonis »

This thread is meant as a guide for editing trackst.dat, which will be necessary to do manually if one wants to implement more than one mod to the game (new bridges, new signals etc).

JohalaReewi posted a tutorial in post # 7 on the first page.

Any questions? Ask them in this thread. :wink:


------------------------------------------
OLD TEXT
------------------------------------------

Right, I need help. I know this issue has been addressed in various threads, but AFAIK there is no thread dealing with it.

How do I edit trackst.dat??? All the different mods around come with their own modified versions of trackst.dat. For example, I want to have the earth slope, the concrete bridge, the prellblocks etc etc running at the same time - meaning I'll have to make a trackst.dat which contains all their different modifications.

How do I do this?
Olli wrote:Manually edit the trackst.dat with locotool.exe (make backup).
It decompiles .dat files to a plain text file and simply edit it. its 1 line to add (the one signal here) and one line to change (wich sets the signal amount), then recompile.

Problem is, I don't have a clue how to do this. Could someone please make a tutorial for helping people like me? I'm sure I'm not the only one out there who wants to use more than one of the mods at the same time. With so much good stuff about, it's a shame not being able to use it all.


Thanks a bunch :)
Last edited by The Fjonis on 25 Feb 2005 09:32, edited 1 time in total.
User avatar
Villem
Tycoon
Tycoon
Posts: 3310
Joined: 28 Aug 2003 09:38

Post by Villem »

drag trackst.dat on locotool.exe, open the xml file called trackst.xml with notepad. then you should be able to take care of everything else quite easily..
The Fjonis
Traffic Manager
Traffic Manager
Posts: 238
Joined: 11 Sep 2004 16:52
Location: Bergen, Norway

Post by The Fjonis »

OK, so I did what you say.
  • [1] I dragged the original trackst.dat onto Locotool.exe and got a folder of .png files and an xml-file which I opened in NotePad. So far so good.

    [2] I then figured that I needed to do the same with all the other trackst.dat files (concrete bridge, buffer etc), so I did. This produced xml-files and folders of .png files.

    [3] Then I opened each of the trackst.dat files from point 2 in NotePad. I found the section at the top dealing with bridges and signals, and copied these lines and pasted them into my original trackst.xml file.

    [4] I then copied all the .png files coming from point 2 and pasted them into the orignal folder of .png files from point 1.

    [5] I then highlighted both this folder of .png files AND the modified trackst.xml file and dropped them onto locotool.exe, which produced a new trackst.dat file.

    [6] Finally, I copied all the .dat files that came with each modification (brdgcon.dat etc) and pasted them all into my ObjData folder together with the modified trackst.dat file.

    [7] I then tried to run locomotion. This worked fine, and I then tried to make a scenario. I ticked both the concrete bridge, the earth slope and the buffer. Fine.

When I tried to load the scenario, I wasn't allowed to build either buffers or bridges. :(
------

What did I do wrong?
User avatar
Villem
Tycoon
Tycoon
Posts: 3310
Joined: 28 Aug 2003 09:38

Post by Villem »

ehmmm...you do not need to decompile the related files to compile trackst..
The Fjonis
Traffic Manager
Traffic Manager
Posts: 238
Joined: 11 Sep 2004 16:52
Location: Bergen, Norway

Post by The Fjonis »

OK, I'm now officially lost.

I found that the trackst.dat file I created in point 5 somehow is exactly the same as the old trackst.dat file... WTF? Could someone please tell me on which point above I'm making the mistake and tell me what to do instead? This is driving me crazy..

Anyway, I'm attaching a picture showing the trackst.xml for the original trackst.dat and the one coming with the buffer. I've highlighted the section which I copied and pasted into the orignial file, as described in point 3 above. Is this the right thing to do?
Attachments
Øgle.jpg
Øgle.jpg (333 KiB) Viewed 1482 times
The Fjonis
Traffic Manager
Traffic Manager
Posts: 238
Joined: 11 Sep 2004 16:52
Location: Bergen, Norway

Post by The Fjonis »

Anyone? Please? Think about it - if only someone cared to describe the process thoroughly here, we could use this as a tutorial to which we could point everyone asking about it later...
JohalaReewi
Engineer
Engineer
Posts: 40
Joined: 31 Jan 2005 12:42

Post by JohalaReewi »

Have spent an evening sussing this out merging earth slopes into 21st century pack. Each one has a customised trackst.dat and you need to merge the two.

This turned out to be fairly simple as follows:
I decided to use the 21stC trackst.dat as the main one because the slopes one had less customising and so the least number of changes is needed.

1) Set up locotool in an empty folder.
2) Copy the slopes trackst.dat into this folder.
3) Rename trackst.dat to trackst_slope.dat
4) Drag and drop it onto locotool.exe
5) Copy the 21st C trackst.dat into this folder.
6) Drag and drop it onto locotool.exe
7) Open trackst_slope.xml (wordpad will do!!)
8) Open trackst.xml in a second window.
Have a look at the XML in both and spot the differences...

9) The slopes XML has made two mods to the standard file:
<variable name="numbridges" size="1">6</variable>
and
<useobject desc="bridge[5]" class="14">BRDGEART</useobject>

You need to incorporate these changes into the 21st C xml (trackst.xml).
The 21st C trackst.dat has 5 bridge entries so just change the 5 to 6 and paste in the <use object..> line from slopes xml. It will still be bridge[5].

10) Save trackst.xml
11) Drag and drop trackst.xml onto locotool.exe
12) copy the new trackst.dat into ObjData in main Locomotion folder.

Discussion. If the trackst xml already had 6 bridges, you would have increased the number of bridges to 7 and added the new bridge as "bridge[6]". In fact, there is a bridge missing from the trackst.dat supplied with 21stC. It has "Earth Walls" which behave like earth slopes and they are in BRDEARTH.DAT however, they have not been registered in trackst.dat so although they show up in the scenario builder, you can't use them in the game. To add them in, take the trackst.xml and add one to the number of bridges (in the above example, this would make 7). Add add a <useobject line for "bridge[6]" as:

<useobject desc="bridge[6]" class="14">BRDEARTH</useobject>

You now have earth slopes (no speed limit) and also 'earth walls' which seem to be a speeded up version of brick bridges. Very usefull!!

Edit: See also http://wiki.locomotiondepot.net/index.php/AddingBridges
Last edited by JohalaReewi on 01 Mar 2005 12:53, edited 1 time in total.
The Fjonis
Traffic Manager
Traffic Manager
Posts: 238
Joined: 11 Sep 2004 16:52
Location: Bergen, Norway

Post by The Fjonis »

Great stuff, JohalaReewi!! :D :D Thanks a bunch! I finally made it work.

However, I encountered a problem. :oops: I want to use Scrat's concrete bridge (with slopes) AND Steve's earth slope. Trying each separately works just fine, but using all at the same time doesn't seem to work. That's a total of 3 new .dat files, meaning I now have a total of 7 bridge .dat files. When I try to run the game, the the "checking object files" goes fine, but then on the loading screen, the little train never gets past the middle of the screen... :( Is 7 a magic number? Is there any way of combatting this problem?
User avatar
Villem
Tycoon
Tycoon
Posts: 3310
Joined: 28 Aug 2003 09:38

Post by Villem »

There are limits to how many bridge types you can have..
The Fjonis
Traffic Manager
Traffic Manager
Posts: 238
Joined: 11 Sep 2004 16:52
Location: Bergen, Norway

Post by The Fjonis »

Argh, that sucks.

But what if I remove for example the wooden bridge, which I hardly ever use? Would that work?
JohalaReewi
Engineer
Engineer
Posts: 40
Joined: 31 Jan 2005 12:42

Post by JohalaReewi »

Not sure about 7 being a magic number. I am currently running a trackst.dat with 7 bridge types and it all works. I will have a go at adding concrete bridges to get 8 bridge types. Don't see why it shouldn't work because in the scenario editor, you can have up to 8 different bridge types selected. Also, there is no reason why you can't swap wooden bridges out for something else. You just have to point the wooden bridge entry in trackst.xml to the new bridge's .dat file.
The Fjonis
Traffic Manager
Traffic Manager
Posts: 238
Joined: 11 Sep 2004 16:52
Location: Bergen, Norway

Post by The Fjonis »

Ahhh, this drives me crazy :evil: I've been playing around now with different combinations and configurations of the different trackst.dat files, but the game keeps crashing when I try playing it.

If anyone would care to have a look at it, I've attached the files that I want merged. Maybe an interesting case for someone?

EDIT: Can't upload .dat files. :cry:

Ah well, I guess I'll just take a pill and get over it.

Image
Loewe13
Traffic Manager
Traffic Manager
Posts: 217
Joined: 25 Sep 2004 15:18
Location: Germany

Post by Loewe13 »

just zip the dat and you can upload it ;-)
The Fjonis
Traffic Manager
Traffic Manager
Posts: 238
Joined: 11 Sep 2004 16:52
Location: Bergen, Norway

Post by The Fjonis »

Heh, didn't think of that... :wink:

Here we go, then. If anyone would care to have a look at it, I'd very much appreciate it!
:D
Thanks.
Attachments
EarthSlope.rar
(61.13 KiB) Downloaded 358 times
Concrete.rar
(61.14 KiB) Downloaded 360 times
Buffer.rar
(61.12 KiB) Downloaded 357 times
JohalaReewi
Engineer
Engineer
Posts: 40
Joined: 31 Jan 2005 12:42

Post by JohalaReewi »

Done.
But you will also need the .dat files to go with the new features.

SIGBS.dat
BRDGEART.dat
BRDGCONC.dat
BRDGCON1.dat

EDIT: Have just discovered you can only have up to 7 bridges defined in trackst.dat. If you have more, you get the "trains going half way" problem you described. The concrete bridges require 2 additional bridge types so this does not leave any room for earth slopes. The only solution then is to lose one the standard bridge types (eg wooden bridges) to make room. The trackst.dat attached has 8 bridges defined so it won't work (but you can take out the one you don't want!!).
Attachments
TRACKST.zip
Merged trackst.dat
(65.6 KiB) Downloaded 395 times
The Fjonis
Traffic Manager
Traffic Manager
Posts: 238
Joined: 11 Sep 2004 16:52
Location: Bergen, Norway

Post by The Fjonis »

Great stuff! :D Thanks a bunch. When "taking out" a bridge - does that simply mean removing the .dat file that I don't want, or should I remove it from trackst.dat also?
JohalaReewi
Engineer
Engineer
Posts: 40
Joined: 31 Jan 2005 12:42

Post by JohalaReewi »

The problem is caused by having more than 7 bridges in trackst.dat so you need to remove a bridge from there. You can leave the bridge.dat files. They will show up in the scenario editor but won't be selectable from the actual game. Seems a bit strange that the scenario editor allows 8 bridges but if you put 8 bridges in trackst.dat, locomotion won't start up.
Post Reply

Return to “Locomotion Graphics, Modifications & Tools”

Who is online

Users browsing this forum: No registered users and 2 guests