Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Railtypes - Some form of automatic enableing #4393

Closed
DorpsGek opened this issue Jan 9, 2011 · 4 comments
Closed

Railtypes - Some form of automatic enableing #4393

DorpsGek opened this issue Jan 9, 2011 · 4 comments
Labels
component: interface This is an interface issue flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

DorpsGek commented Jan 9, 2011

djnekkid opened the ticket and wrote:

Hi all precious devs :D

I bet all of you are aware of the 'problem', but the railtypes need some sort of automatic enableing. Something a'la pikkabirds proposal in the 3rd post in this thread would most likely be the best, but frankly anything would be good
http://www.tt-forums.net/viewtopic.php?f=32&t=49254

I would imagine it could work something a'la railtypes property 0x0E and 0x0F (from a grf coders point of view), example:
17 \b3 \d1950 "RAIL" "ELRL"
Here would the railtype be available if the year is 1950 and a rail or elrail vehicle is available

Another approach, altho abit more hackish/ugly, could be that the "Show building tools when no suitable vehicle are available" actually worked.
A third approach, also abit of a workaround, could be that engines with action0property4 set to 0 would never show up, even with "Vehicles never expire" turned on

Now, roughly a year after railtypes did hit trunk am i working on getting NuTracks to a 1.0-state, and i hope this issue will be fixed soon, as it could almost be concidered a bug.

Reported version: other
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/4393
@DorpsGek
Copy link
Member Author

Rubidium wrote:

This request and the thread seem to be talking about slightly different implementations: the thread talks about introducing when all railtypes are available, whereas you talk about introducing it when one of the railtypes is available.

Basically I see two things that you want to do:
* introduce "older"/"lesser" railtypes when something better gets introduced (by a vehicle), e.g. when 120km/h electrified track gets introduced make sure 60km/h electrified, 120km/h non-electrified and 60km/h non-electrified track are available as well.

* introduce a "better" railtype based on the date and the existance/usage of other railtypes, e.g.:
** when 60km/h electrified track or 120km/h electrified track exists introduce 180km/h track in 1980, or later.
** when catenary and third rail track is available introduce track with catenary and third rail. This means checking whether all track types are available.
The former example uses an "or" and the latter uses an "and", which is troublesome. However, the former can be rewritten to: introduce 120km/h when 60km/h is available for the 120km/h track and introduce 180km/h when 120km/h is available for the 180km/h track. Furthermore it could make use of the introduction "lesser" railtypes idea; when a 120km/h track vehicle is added, 60km/h track should be made available thus use introduce 180km/h electrified track when 60km/h electrified track exists.

There is also the option to go to a full blown callback with all the pitfalls and complexity with that, but I rather would try to limit it to three properties:
* introduces railtypes: lists the railtypes that the introduction of this railtype makes available, e.g. when a E180 vehicle is introduced it makes sure ELRL gets introduced.
* introduction date: earliest moment of forceful introduction of the railtype, regardless of vehicle introduction. Introduction of a vehicle using the railtype before this date still introduces the railtype at the time of introduction of the vehicle.
* required railtypes: list of railtypes that must be available for the railtype to be forcefully introduced. If this is empty only the date is used, when there are more than two railtypes all must be available to the player before the railtype gets introduced (unless vehicle introduction overrides this).

Can you do everything you want to do with these properties, and if not what specific cases can you think of that can't be handled with these properties? Or in other words: do we really have to go for a callback here?


This comment was imported from FlySpray: https://bugs.openttd.org/task/4393#comment9469

@DorpsGek
Copy link
Member Author

djnekkid wrote:

As far as I can see I should be able to do just about everything i want :D


This comment was imported from FlySpray: https://bugs.openttd.org/task/4393#comment9471

@DorpsGek
Copy link
Member Author

djnekkid wrote:

As far as I can see I should be able to do just about everything i want :D


This comment was imported from FlySpray: https://bugs.openttd.org/task/4393#comment9472

@DorpsGek
Copy link
Member Author

Rubidium closed the ticket.

Reason for closing: Implemented

In r21842


This comment was imported from FlySpray: https://bugs.openttd.org/task/4393

@DorpsGek DorpsGek added component: interface This is an interface issue flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) enhancement labels Apr 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: interface This is an interface issue flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

1 participant