[NFO] How to make an "older" vehicle-set tramtype aware

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

Moderator: Graphics Moderators

Post Reply
User avatar
Quast65
Tycoon
Tycoon
Posts: 2021
Joined: 09 Oct 2011 13:51
Location: The Netherlands

[NFO] How to make an "older" vehicle-set tramtype aware

Post by Quast65 »

Hi all,

I am trying to make some changes to one of the older vehicle-sets, HEQS.
I would like to make it possible for the industrial non-electrical trams to drive on an un-electrified tramtrack.
At the moment that is not possible, they only drive on electrified tramtracks and can only be bought at the electrified tramdepots.

I have not much experience with vehicle coding, so asking here is probably a lot faster than me just fiddeling around ;-)

For as far as I understand it now, I think I need to add a Tramtype Translation Table, should that look like this:

Code: Select all

  1 * n      00 08 01 02 00 17 "RAIL" "ELRL"
And then I need to referr to that in the Action-0 of the tram, right?
But how exactly?
If I understand correctly, I need to add prop-05, but where and what should it look like?
Here I have an example of the Action-0 of a steamtram from HEQS:

Code: Select all

 4482 * 30	 00 01 \b10 01 D0
    0E FF // sprite ID
    0F \b00 // capacity
    10 FF // cargo type
    16 00 00 00 00 // Bit mask of cargo types available for refitting
    17 12 // Callback flags bit mask
    1A 00 // Refit cost, using 25% of the purchase price cost base
    1B 00 // Retire vehicle early, this many years before the end of phase 2
    1C 03 // Miscellaneous vehicle flags 01 = tram, 02 = use 2CC, 10 = allow autorefit
    1D FF FF // Refittable cargo classes
    1E 01 00 // Non-refittable cargo classes
# 18 "sprites/nfo/industrial_trams/dorstfeld_tram.pnfo" 2

 4483 * 35	 00 01 \b12 01 D0
    02 20 // reliability 
    03 \b23 // vehicle life 
    04 \b120 // class life 
    09 16 // running cost 
    0A 48 4C 00 00 // running cost base 
    11 12 // cost factor
    12 02 // sound effect
    13 \b6 // power in 10 hp
    14 \b44 // weight in 1/4 tons
    15 \b12 // speed in mph * 0.8
    18 50 // coefficient of TE
    1F \d683000 // Long format introduction date  
 4484 * 45	 04 01 7F 01 D0 "0-4-0 Dorstfeld Industrial Tram (Steam)" 00
 // extra info text shared with other steam trams
 4485 * 160	 04 01 81 01 B4 D1 "Can be refitted to haul:\8A"
  "\0D    20t in four wagons"
  "\0D    45t in nine wagons"
  "\0D    75t in fifteen wagons (may be slow uphill)\0D"
  "\98Running costs vary with capacity\0D"
                               00
What and where should I change/add the Action-0?

Are any other changes needed too? For example the Action-0's of the wagons too?

Thanks in advance!
Projects: http://www.tt-forums.net/viewtopic.php?f=26&t=57266
Screenshots: http://www.tt-forums.net/viewtopic.php?f=47&t=56959
Scenario of The Netherlands: viewtopic.php?f=60&t=87604

Winner of the following screenshot competitions:
sep 2012, jan 2013, apr 2013, aug 2013, mar 2014, mar 2016, oct 2020
All my work is released under GPL-license (either V2 or V3), if not clearly stated otherwise.
Eddi
Tycoon
Tycoon
Posts: 7816
Joined: 17 Jan 2007 00:14

Re: [NFO] How to make an "older" vehicle-set tramtype aware

Post by Eddi »

Quast65 wrote: 24 Nov 2021 13:45 What and where should I change/add the Action-0?
first of all, you should make the change in the appropriate .pnfo file

the order of the action 0s does not matter. just increase the counters.
You might not exactly be interested in Ferion, but if you are, have fun :)
User avatar
Quast65
Tycoon
Tycoon
Posts: 2021
Joined: 09 Oct 2011 13:51
Location: The Netherlands

Re: [NFO] How to make an "older" vehicle-set tramtype aware

Post by Quast65 »

Thank you for your reply.

Well, it was easier than I thought...

I just added

Code: Select all

 4989 * 14       00 08 01 02 00 17 "RAIL" "ELRL"
At the very end of the decoded NFO

Then for each Tram I wanted to change, I added

Code: Select all

05 00 
Into the appropriate Action-0
recoded and it works ;-)
Example658.png
Example658.png (40.69 KiB) Viewed 86 times
Projects: http://www.tt-forums.net/viewtopic.php?f=26&t=57266
Screenshots: http://www.tt-forums.net/viewtopic.php?f=47&t=56959
Scenario of The Netherlands: viewtopic.php?f=60&t=87604

Winner of the following screenshot competitions:
sep 2012, jan 2013, apr 2013, aug 2013, mar 2014, mar 2016, oct 2020
All my work is released under GPL-license (either V2 or V3), if not clearly stated otherwise.
Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 0 guests