Track Introduction

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

Moderator: Graphics Moderators

Post Reply
Transportman
Tycoon
Tycoon
Posts: 2792
Joined: 22 Feb 2011 18:34

Track Introduction

Post by Transportman »

I have a question regarding track introductions, because I want something specific in the Dutch Track Set and I'm not sure if it is possible and if it is possible I don't have a clue about how I should do it.

For simplicity I have 3 tracktypes, A, B and C. A and B are tracks that represent a certain power system (for example AC/DC or low/high voltage), while C represents a multi-system track that has both systems. What I want is the following:
1: Trains of tracktype A or B also introduce track C
2: Trains of tracktype C also introduce tracks A and B
3: Trains of tracktype A do NOT introduce track B and vice versa

So basically I want that all tracks that match the trains power system become available, without the incompatible systems becoming available.

The only thing I find in the specs is the introduces_railtype_list property, but that will result in violating the 3rd point, because A introduces C which in turn introduces B.

I hope someone can help me with this.
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Track Introduction

Post by planetmaker »

Transportman wrote: 1: Trains of tracktype A or B also introduce track C
2: Trains of tracktype C also introduce tracks A and B
3: Trains of tracktype A do NOT introduce track B and vice versa
IMHO the 1st condition doesn't make sense really; Unless there are trains for tracktype C, there's not much point in building it anyway.

It makes sense to use requires_railtype_list and require tracktypes A and B be available for the introduction of C. C will then be introduced unconditionally, if a vehicle requiring C becomes available anyway. Or earlier, if A and B are available and the railtype introduction date is earlier than its earliest vehicle. At the same time, for tracktype C, I'd set also introduces_railtype_list to A and B.
Thus A and B themselves don't imply anything. But C becomes available *somewhen*, if A and B are already available. At latest it becomes available when a vehicle for it specifically becomes available.
User avatar
SquireJames
Tycoon
Tycoon
Posts: 1863
Joined: 07 Aug 2004 11:56
Skype: squirejames5
Location: Stoke-on-Trent
Contact:

Re: Track Introduction

Post by SquireJames »

IMHO the 1st condition doesn't make sense really; Unless there are trains for tracktype C, there's not much point in building it anyway.
Well, transportman said that C was a dual voltage type system. Ergo, it makes perfect sense to have track type C available when at least 1 A and 1 B type train are available, so that you can have (for example) a terminus that is dual voltage wired so that two routes (one A, one B) can join and use the same platforms)
Image
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Track Introduction

Post by planetmaker »

SquireJames wrote:
IMHO the 1st condition doesn't make sense really; Unless there are trains for tracktype C, there's not much point in building it anyway.
Well, transportman said that C was a dual voltage type system. Ergo, it makes perfect sense to have track type C available when at least 1 A and 1 B type train are available, so that you can have (for example) a terminus that is dual voltage wired so that two routes (one A, one B) can join and use the same platforms)
He said that he wants C available when A OR B is available. I talk about that it makes only sense when A AND B are available. And the latter thing I describe in detail how it can be implemented.
Transportman
Tycoon
Tycoon
Posts: 2792
Joined: 22 Feb 2011 18:34

Re: Track Introduction

Post by Transportman »

C is a very cheap track (with a speed penalty), so there is a small incentive to build it. Later in the game you earn that much money that it doesn't really matter anymore.

But my original question still stands, is what I want possible with all three conditions true?
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Track Introduction

Post by planetmaker »

It's a circular dependency which you ask for.

numbers indicate your conditions:
1a) A->C
1b) B->C
2)C->A and B
thus 3) cannot be fulfilled ever. If a railtype gets introduced it gets introduced. The conditions for the introduction of other railtypes (vehicles or date) then apply irrespective of why it was introduced itself

thus your condtions simplify to either of the three implying the other two, thus all railtypes are available or none:
A -> B and C
B -> A and C
C -> A and B
Transportman
Tycoon
Tycoon
Posts: 2792
Joined: 22 Feb 2011 18:34

Re: Track Introduction

Post by Transportman »

Okay, too bad it's not possible, means I have to make a choice which system I take (A or B introducing C or C introducing A and B). Thanks for the information.
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML
User avatar
SquireJames
Tycoon
Tycoon
Posts: 1863
Joined: 07 Aug 2004 11:56
Skype: squirejames5
Location: Stoke-on-Trent
Contact:

Re: Track Introduction

Post by SquireJames »

planetmaker wrote:
SquireJames wrote:
IMHO the 1st condition doesn't make sense really; Unless there are trains for tracktype C, there's not much point in building it anyway.
Well, transportman said that C was a dual voltage type system. Ergo, it makes perfect sense to have track type C available when at least 1 A and 1 B type train are available, so that you can have (for example) a terminus that is dual voltage wired so that two routes (one A, one B) can join and use the same platforms)
He said that he wants C available when A OR B is available. I talk about that it makes only sense when A AND B are available. And the latter thing I describe in detail how it can be implemented.
Sorry, I must have misread.
Image
Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 11 guests