LocoTool V0.4.3 [30 Oct 2004]

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

Moderator: Locomotion Moderators

Post Reply
Patchman
Tycoon
Tycoon
Posts: 7576
Joined: 02 Oct 2002 18:57
Location: Ithaca, New York
Contact:

LocoTool V0.4.3 [30 Oct 2004]

Post by Patchman »

The latest version is always at http://www.ttdpatch.net/loco/

Ignore the _src, _dll and _dyn zip files, just download the regular LocTool one for the latest version.

[old text]

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.
Last edited by Patchman on 31 Oct 2004 00:53, edited 14 times in total.
User avatar
Born Acorn
Tycoon
Tycoon
Posts: 7595
Joined: 10 Dec 2002 20:36
Skype: bornacorn
Location: Wrexham, Wales
Contact:

Post by Born Acorn »

already on top of loco, I see! :P
Image
User avatar
orudge
Administrator
Administrator
Posts: 25134
Joined: 26 Jan 2001 20:18
Skype: orudge
Location: Banchory, UK
Contact:

Post by orudge »

Yay, will go and play with this very soon. :)
leech1984
Engineer
Engineer
Posts: 38
Joined: 05 Sep 2004 16:29
Location: Zoetermeer, Nederland

Post by leech1984 »

Sweet!! Cant wait for all the things you make/find out
Patchman
Tycoon
Tycoon
Posts: 7576
Joined: 02 Oct 2002 18:57
Location: Ithaca, New York
Contact:

Post by Patchman »

By the way, here's the meaning of all the variables you can set...

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)
If you have an idea what any of the "unknown" fields mean let me know!
User avatar
mlw_1550
Engineer
Engineer
Posts: 98
Joined: 08 Mar 2004 00:39
Location: Good ol' Portugal

Post by mlw_1550 »

Josef, the man of the moment, once again! :D
That's CP 1564, a Montreal Locomotives Works built locomotive
Mystic
Engineer
Engineer
Posts: 77
Joined: 16 Nov 2002 00:20
Location: Montreal, Canada
Contact:

Post by Mystic »

mlw_1550 wrote:Josef, the man of the moment, once again! :D
I have to agree! Props to you Patchman!

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!
User avatar
PennCentral
Transport Coordinator
Transport Coordinator
Posts: 268
Joined: 12 Sep 2004 05:43
Location: Springfield, Ohio
Contact:

Post by PennCentral »

Yay! GE Stepple cabs and Stephenson Interurbans aren't out of the question then. :D
DT&I forever!!!! :)
Singaporekid
Tycoon
Tycoon
Posts: 1966
Joined: 21 May 2004 07:39
Location: Singapore

Post by Singaporekid »

Nice to see some steam enthusiasts here, hehe
Anyway, so is it possible to render our graphics with 3dsm max and blender?
<+Raichase> ugh, I just ate some of my beard D:
User avatar
RaptorTycoon
Tycoon
Tycoon
Posts: 2310
Joined: 09 Dec 2002 15:35
Location: Urope>Dutchland>Rotterdam

Post by RaptorTycoon »

singaporekid_92 wrote:Nice to see some steam enthusiasts here, hehe
Anyway, so is it possible to render our graphics with 3dsm max and blender?
Steamers are teh suck :twisted:

I cant wait till lomo-patch comes out, if ever ;)

I cant wait for the reliability issues being fixed.

But i must wait :p
Call me.. Raptor ;)
Singaporekid
Tycoon
Tycoon
Posts: 1966
Joined: 21 May 2004 07:39
Location: Singapore

Post by Singaporekid »

Steamers are not the suck!, hehe
In locomotion, steamers have about the highest reliability i've seen
<+Raichase> ugh, I just ate some of my beard D:
User avatar
Daan Timmer
Tycoon
Tycoon
Posts: 2406
Joined: 12 Apr 2004 11:21
Location: +31299......

Post by Daan Timmer »

singaporekid_92 wrote:Steamers are not the suck!, hehe
In locomotion, steamers have about the highest reliability i've seen
not true, those narrow gauge trains are by far more reliable then those steamers(not talking about the steaming narrow gauge locos)

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....
Image

"Your arguments are totally nothing.. They have so little meaning that its kind of funny you took the time to write them"
"your pixels aren't good enough to talk to me.. sorry"
"Random does not mean fair, and past results do not influence future occurrences." - Corbenn
User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13233
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Post by Hyronymus »

Get back ON topic, guys. Look at what the title suggests and what you are discussing here.
Patchman
Tycoon
Tycoon
Posts: 7576
Joined: 02 Oct 2002 18:57
Location: Ithaca, New York
Contact:

Post by Patchman »

Alrighty then, an update. http://www.ttdpatch.net/loco/locotool_v0.02.zip

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...
DeadFish
Engineer
Engineer
Posts: 37
Joined: 10 Sep 2004 09:43
Location: Harrogate, North Yorkshire, England
Contact:

Post by DeadFish »

Mr Patchman , is choosing the size of map possible?
Patchman
Tycoon
Tycoon
Posts: 7576
Joined: 02 Oct 2002 18:57
Location: Ithaca, New York
Contact:

Post by Patchman »

DeadFish wrote:Mr Patchman , is choosing the size of map possible?
Yes, you have three choices, 256x256, 256x256 or 256x256. Now stay on topic please!
Severn
Engineer
Engineer
Posts: 73
Joined: 23 Apr 2004 10:52

Post by Severn »

Patchman is Josef Drexler right?

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.
DeadFish
Engineer
Engineer
Posts: 37
Joined: 10 Sep 2004 09:43
Location: Harrogate, North Yorkshire, England
Contact:

Post by DeadFish »

Yes, you have three choices, 256x256, 256x256 or 256x256. Now stay on topic please!
Well, since you are a programmer, i assumed u'd add some special code for choosing the size of map.
User avatar
RaptorTycoon
Tycoon
Tycoon
Posts: 2310
Joined: 09 Dec 2002 15:35
Location: Urope>Dutchland>Rotterdam

Post by RaptorTycoon »

You cant just "add" a special code, its more complicated then that..

@ Patchman: What is now called LocoTools is like "LocoPatch" under a different name? or am i missing something?
Call me.. Raptor ;)
TBOT
Route Supervisor
Route Supervisor
Posts: 441
Joined: 30 Jul 2003 18:36
Location: The Codecave

Post by TBOT »

raptortycoon wrote:@ Patchman: What is now called LocoTools is like "LocoPatch" under a different name? or am i missing something?
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.

And to patchman:
You're not free'ing your malloc'ed memory, tsssk ;)
"Peace cannot be kept by force. It can only be achieved by understanding." - Albert Einstein
Post Reply

Return to “Locomotion Graphics, Modifications & Tools”

Who is online

Users browsing this forum: Semrush [Bot] and 5 guests