Moderator: Locomotion Moderators
Ignore the _src, _dll and _dyn zip files, just download the regular LocTool one for the latest version.
I've been working on a couple of programs which should eventually allow the inclusion of new objects in Locomotion. This is a lot easier than in TTD, so all I have to do is decode the object file format.
Here's the first step, two programs to decode vehicle object files and write the vehicle stats in an xml file, available at http://www.ttdpatch.net/loco/locotools.zip and some sample xml files A380 Cattle truck 2 EMU1 HG 2/3 Hopper
All comments welcome, especially on the xml structure!
They're console mode programs, so don't expect any fancy buttons or windows or anything...
To look at a vehicle's data, first use objdump to decompress the file and then dmptrans to translate the data to xml. There's still some data missing in the xml file (descriptions/translations, required objects and of course the graphics), I'll be working on those the next few days and hope to have a fully working codec soon.
PS: Many thanks to the RCT Technical Information Depot for information on the basic file format.
A "variable" entry is something I know what it means.
A "unknown" entry is something I don't understand yet.
- class = what does it run on, 0=rail, 1=road, 2=air, 3=water
- nummods = how many track modifications are needed to run (e.g. 3rd rail); the specific ones will be in the "required objects" information which I don't decode yet
- costind = purchase cost index (index into a table of base costs)
- costfact = purchase cost factor (final cost = basecost[costind]*costfact)
- runcostind = running cost index
- runcostfact = running cost factor
- numcompat = number of compatible vehicles, 0 if compatible with all
- vehunk = mostly unknown structure, except
- spriteind = seems to be an index into the sprite table
- sprites = some information about which sprites to use
- numdir = number of different view directions
- flags = some flags, only one bit known so far
- spritenum = first sprite to use for this
- power = power
- speed = top speed
- rackspeed = top speed while on rack rail (and I think broken down speed for planes)
- weight = weight
- flags = vehicle settings
- rackrail = whether vehicle can use a rackrail
- dualhead = vehicle is dualheaded
- refittable = vehicle is refittable
- noannounce = vehicle will not be announced when it is new (this is set for train wagons)
- visfxtype = how to draw the visual effect (what kind is set in the required object list)
- wakefxtype = how to draw the wake effect (what kind is set in the required object list)
- designed = year vehicle is designed, 0 if available from the beginng
- obsolete = year vehicle becomes obsolete, 65535 if never
- startsndtype = how to play the starting sound (what kind is set in the required object list)
- numsnd = number of sound effects (the kinds are set in the required object list)
I have to agree! Props to you Patchman!mlw_1550 wrote:Josef, the man of the moment, once again!
I believe this will come in very handy, especially:
"obsolete = year vehicle becomes obsolete, 65535 if never "
I've always hated not being able to make steam engines after a certain date!
not true, those narrow gauge trains are by far more reliable then those steamers(not talking about the steaming narrow gauge locos)singaporekid_92 wrote:Steamers are not the suck!, hehe
In locomotion, steamers have about the highest reliability i've seen
and I must say, there arent that many steamers in game, as I like to see how they run with those wheels thingys how ya call 'm ?
those crossbars that connect the wheels with each other....
Now it's all in one, no more running objdump then dmptrans. Also it's called "locotool" now, it'll convert your vehicle dats into xml format again.
Now it includes all information from the .dat file, although I'm having some doubts about how best to add the sprites. Currently they're png files in CDATA sections, but that still stops the xml from being wellformed. Oh well... maybe I'll base64 encode them or something. It works fine for most vehicles, but not all of them for some reason.
Next step (after fixing that) will be to make it possible to encode those files again, but since I understand how everything works that shouldn't be too hard. And then to work on the other 32 object types...
Before everybody gets too excited, can I just add a few words of caution based on similar work that has gone on in the RCT2 arena?
- There needs to be a database established so that new object makers can make sure that they don't reuse a filename and/or object handle that has already been allocated.
Unlike RCT2 which has a 'save with objects' option, Locomotion does not. Based on 'missing object' posts here, it looks as though downloading a saved game which uses objects that you don't have will cause the game to crash.
Chris Sawyer is still using a fixed memory model. Therefore the number of objects of each type that you can use in a scenario is fixed. Check out the scenario editor advanced tab for the limits.
- Posts: 37
- Joined: 10 Sep 2004 09:43
- Location: Harrogate, North Yorkshire, England
I'm not patchman, but I can answer the question. It's not a patch or something like that, it just are some tools which at the moment dump vehicle stats to a xml file, nothing more, nothing less.raptortycoon wrote:@ Patchman: What is now called LocoTools is like "LocoPatch" under a different name? or am i missing something?
And to patchman:
You're not free'ing your malloc'ed memory, tsssk
Users browsing this forum: No registered users and 3 guests