Rail Type Introduction & its relationship to Introduction Date

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

Moderator: Graphics Moderators

Post Reply
User avatar
Gwyd
Chief Executive
Chief Executive
Posts: 691
Joined: 17 Apr 2017 16:52
Location: Western Ile-de-France Region

Rail Type Introduction & its relationship to Introduction Date

Post by Gwyd » 13 Jul 2019 20:02

So I was playing around with making some of my own railtypes, and to make some railtypes that were required from a technical standpoint but should not available to the player (let's call it railtype X), I set the property "introduction_date" of the tracktype to the year 5000000, the quoted maximum from: https://newgrf-specs.tt-wiki.net/wiki/NML:Railtypes.

When I compiled this into a NewGRF regardless of the date, once the first train for railtype X was made available (~1980) railtype X was made available.

Some more digging on that same page tells me that the game will basically ignore the "introduction_date" property, unless no trains are explicitly allowed on it. To me this seem unintuitive and unhelpful. Yes, I am pushing the limits of the design for a specific use case, but nonetheless this implication does not appear to be the best possible.

Eddi
Tycoon
Tycoon
Posts: 7390
Joined: 17 Jan 2007 00:14

Re: Rail Type Introduction & its relationship to Introduction Date

Post by Eddi » 14 Jul 2019 00:55

with openttd 1.9 was added the ability to hide railtypes from the construction menu. that sounds like what you're looking for here. (property 10 bit 2)
You might not exactly be interested in Ferion, but if you are, have fun :)

User avatar
Erato
Route Supervisor
Route Supervisor
Posts: 384
Joined: 25 May 2015 09:09
Location: The Netherlands

Re: Rail Type Introduction & its relationship to Introduction Date

Post by Erato » 14 Jul 2019 12:29

Eddi wrote:
14 Jul 2019 00:55
with openttd 1.9 was added the ability to hide railtypes from the construction menu. that sounds like what you're looking for here. (property 10 bit 2)
Is there a way to implement this using NML?
No pics no clicks. Seriously.
ImageImageImageImageImageImage

Eddi
Tycoon
Tycoon
Posts: 7390
Joined: 17 Jan 2007 00:14

Re: Rail Type Introduction & its relationship to Introduction Date

Post by Eddi » 15 Jul 2019 01:12

yes, property 10 is called "railtype_flags" there. i imagine it hasn't got a name for the bit, though, so you'd have to use the raw number, like

Code: Select all

bitmask(2)
You might not exactly be interested in Ferion, but if you are, have fun :)

User avatar
Gwyd
Chief Executive
Chief Executive
Posts: 691
Joined: 17 Apr 2017 16:52
Location: Western Ile-de-France Region

Re: Rail Type Introduction & its relationship to Introduction Date

Post by Gwyd » 15 Jul 2019 07:48

I tried to do something like that after reading the nfo specs about it, but I couldn't seem to get the desired result.

Eddi
Tycoon
Tycoon
Posts: 7390
Joined: 17 Jan 2007 00:14

Re: Rail Type Introduction & its relationship to Introduction Date

Post by Eddi » 15 Jul 2019 14:46

i'm afraid you need to provide us with more details
You might not exactly be interested in Ferion, but if you are, have fun :)

User avatar
Gwyd
Chief Executive
Chief Executive
Posts: 691
Joined: 17 Apr 2017 16:52
Location: Western Ile-de-France Region

Re: Rail Type Introduction & its relationship to Introduction Date

Post by Gwyd » 16 Jul 2019 22:18

What I'm trying to ask is how would I set flags in the item block of some item which doesn't have a name implemented into NML like RAILTYPE_FLAG_CATENARY, but rather one that is defined under property 10 for NFO.
In this particular case, I want to set the railtype to have the "hidden in construction menu" flag enabled, which in NFO is defined as bit 2 with a value of 4 in property 10. I have attempted this in NML by trying the code

Code: Select all

bitmask(4)
In the item block of the railtype in question, but this didn't seem to work.
This suggests either:
I wasn't being rigorous in testing the change
or I'm doing it wrong.

Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 0 guests