Page 1 of 1

Modifying EngineID

Posted: 19 Apr 2023 20:09
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?

Re: Modifying EngineID

Posted: 19 Apr 2023 23:00
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.

Re: Modifying EngineID

Posted: 21 Apr 2023 05:42
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.