Modifying EngineID

Discussions about the technical aspects of graphics development, including NewGRF tools and utilities.

Moderator: Graphics Moderators

Post Reply
Tante2k
Engineer
Engineer
Posts: 11
Joined: 19 Mar 2020 00:34

Modifying EngineID

Post by Tante2k »

Hey,

I haven't really been playing TT since back in the Patch days, but I'm slowly getting back into it, and I'm trying to make my own "perfect" setup, so naturally I'll be doing some NewGRF editing – and, naturally, I have some questions.

First of all, I'm combining two different NewGRF-packages with trams, and when I sort by EngineID, the trams from the two packages are separated (top and bottom.) Are there some sort of unique ID baked into the NewGRF EngineIDs when they are loaded into the game, or are the EngineID-strings unique? What I'm asking is essentially if I can simply edit one of the NMLs so that the sorting works as expected (trams all at bottom or top.)

The real issue right now is that one of them is NFO and the other is (probably) NML, and none of them are in active development. I'm planning to ask the authors for the source, but if that fails, is there any hope?
User avatar
OzTrans
Tycoon
Tycoon
Posts: 1680
Joined: 04 Mar 2005 01:07

Re: Modifying EngineID

Post by OzTrans »

Tante2k wrote: 19 Apr 2023 20:09... I'm combining two different NewGRF-packages with trams, and when I sort by EngineID, the trams from the two packages are separated (top and bottom.) Are there some sort of unique ID baked into the NewGRF EngineIDs when they are loaded into the game, or are the EngineID-strings unique?
To get vehicles sorted by 'Engine ID [classic sort]', you need to have them physically sorted within your GRF; i.e. the sequence of your Action-3s determines the sort order.
User avatar
andythenorth
Tycoon
Tycoon
Posts: 5658
Joined: 31 Mar 2007 14:23
Location: Lost in Music

Re: Modifying EngineID

Post by andythenorth »

Vehicle order is controlled by sort 'property':
For NFO: https://newgrf-specs.tt-wiki.net/wiki/A ... t_.281A.29

NML has a convenience method provided:
For NML: https://newgrf-specs.tt-wiki.net/wiki/N ... chase_list

Vehicles do have unique IDs (numeric).

For NFO these are required, and are defined in the action 0.

For NML, it's optional whether the unique ID is defined by the author. If unset, NML will assign a unique ID to vehicles at compile time. However it's preferable to manually assign the unique ID.

Hope this helps.
Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 9 guests