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: 'hide railtype' flag #5006

Closed
DorpsGek opened this issue Jan 23, 2012 · 22 comments
Closed

Railtypes: 'hide railtype' flag #5006

DorpsGek opened this issue Jan 23, 2012 · 22 comments
Labels
component: NewGRF This issue is related to NewGRFs enhancement Issue would be a good enhancement; we accept Pull Requests! flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) good first issue Good for newcomers

Comments

@DorpsGek
Copy link
Member

George opened the ticket and wrote:

To create trains, that can run on several electrified railway types, it is required to create the new "combo" rail type, that is available in menu.
It is required to have a flag to have "hidden" rail type for combo rail type.

[16:09:24] RailTypes querstion. Is it possible to create a 2 electrified rail types and 3 types of trains, that can run on first, second and both rail types?
[16:10:19] If I carte a new 3-d rail type, that has trains that can use first and second rail types, I also get it in the list.
[16:10:37] But there should be only 2 rail types for trains
[16:11:17] How to solve it?
[16:19:46] For example, Eurostar can run on electrified and 3-d rail rayl types. How to code it?
[16:21:03] compatibility with other labels?
[16:21:15] andythenorth hasn't tested
[16:21:28] pikka has done it afaik in UKRS 2
[16:21:53] Because a train can have only one rail type, there should be provided some new rail type "combo". It has to specify compatibility with both electrified rails and 3-d rail types
[16:22:46] But in this case there would be a new rail type "combo", that is not intended
[16:23:17] andythenorth: pikka has done it afaik in UKRS 2> How did he do it?
[16:28:35] <Eddi|zuHause> George: when the problem appeared for the voltage systems in the ToE set, the discussed solution was to allow a "combo" railtype, because especially on some platforms, the voltage systems might be switchable
[16:28:56] <Eddi|zuHause> George: just make it overly expensive
[16:30:53] Eddi|zuHause: I came to the same, but this sounds not a good solution. Would it be possible to hide this combo type?
[16:31:26] <Eddi|zuHause> George: no, as soon as a vehicle uses it, it becomes available

Reported version: Version?
Operating system: All


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

planetmaker wrote:

What's missing when using railtype properties 17 and 18?

As for vehicles, you need to make use of a railtype translation table. Use an action7 chain, testing availability of railtypes in sequence of your preference. NML offers a nice shorthand: http://newgrf-specs.tt-wiki.net/wiki/NML:Railtypetable


This comment was imported from FlySpray: https://bugs.openttd.org/task/5006#comment10783

@DorpsGek
Copy link
Member Author

George wrote:

How can it help?

Introduction date (17)
Introduction required rail type list (18)

electrified rails and 3-d rail are available at the same time. The question is how to make a Eurostar train, that can run both on electrified rail and on 3-d rail. But other trains can only run on electrified rails or on 3-d rail.
As it was discussed, in this case we need a "combo" rail type, specify Eurostar as combo rails type, and make combo rail compatible with electrified and 3-d rail. Eurostar is coded as combo. The problem is that there is a combo rail type appears, and combo type depot has one vehicle - Eurostar, that is not intended. this combo rail type should be hidden.


This comment was imported from FlySpray: https://bugs.openttd.org/task/5006#comment10784

@DorpsGek
Copy link
Member Author

andythenorth wrote:

Similar issue for NotRoadTypes. Not sure if it should be fixed though, maybe it's a useful constraint.


This comment was imported from FlySpray: https://bugs.openttd.org/task/5006#comment14340

@DorpsGek
Copy link
Member Author

DorpsGek commented Apr 2, 2017

peter1138 wrote:

Attached patch adds a flag to hide a railtype from construction. Untested.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/5006#comment14409

@DorpsGek
Copy link
Member Author

DorpsGek commented Apr 2, 2017

frosch wrote:

It would be nice if the non-buildable types would not count towards the max-railtypes limit.


This comment was imported from FlySpray: https://bugs.openttd.org/task/5006#comment14410

@DorpsGek
Copy link
Member Author

DorpsGek commented Apr 4, 2017

peter1138 wrote:

Aww that sounds hard


This comment was imported from FlySpray: https://bugs.openttd.org/task/5006#comment14419

@DorpsGek
Copy link
Member Author

Snail_ wrote:

Frosch has a fair point, the non-buildable types shouldn't count towards the max-railypes limit.
This is why I requested the maximum railtype number be raised from 16 to 32: this would address the issue raised by Frosch. Disgraciously, my request got shot down...


This comment was imported from FlySpray: https://bugs.openttd.org/task/5006#comment14654

@DorpsGek
Copy link
Member Author

Snail_ wrote:

Frosch has a fair point, the non-buildable types shouldn't count towards the max-railypes limit.
This is why I requested the maximum railtype number be raised from 16 to 32: this would address the issue raised by Frosch. Disgraciously, my request got shot down...


This comment was imported from FlySpray: https://bugs.openttd.org/task/5006#comment14655

@DorpsGek
Copy link
Member Author

DorpsGek commented Sep 1, 2017

andythenorth wrote:

Comment from George via forums pm: "required, but may be the problem should be solved in some other way. It is a pity to loose railtype just for 2type trains. It would be better to have just 2 railtypes, while a train has a code, that specifies it can use both."


This comment was imported from FlySpray: https://bugs.openttd.org/task/5006#comment14692

@DorpsGek DorpsGek added flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) component: NewGRF This issue is related to NewGRFs enhancement labels Apr 7, 2018
@PeterN
Copy link
Member

PeterN commented Apr 12, 2018

Proto-plan in my head is to raise the in-game limit on the number of rail types, add some mapping, and then only allow 16 different types of rail type on the map at one time. Hidden rail types would be trivial in this scheme.

This scheme would work the same for road/tram types as well, probably.

Or just shuffle the map around and add more space. You all have 32GB ram these days, right?

@andythenorth
Copy link
Contributor

andythenorth commented Jan 5, 2019

Well, railtypes are 64 now... :) #6805

Room to hide some?

@PeterN
Copy link
Member

PeterN commented Jan 26, 2019

Probably room now, yes. Shouldn't be too hard to implement either.

@PeterN PeterN added the good first issue Good for newcomers label Jan 26, 2019
PeterN added a commit to PeterN/OpenTTD that referenced this issue Jan 27, 2019
@PeterN
Copy link
Member

PeterN commented Feb 2, 2019

@George-VB are you able to provide a test case for this feature?

Set bit 2 of rail type flags to hide the rail type from selection.

@George-VB
Copy link

As far as I can see the xUSSRset code, every rail type has bits 2 and 3 on
railtype_flags: bitmask(2, 3);
https://dev.openttdcoop.org/projects/xussrset/repository/entry/src/railtype/railtrack.pnml
In 20190204-master-g33e3f49161 all the tracks are available
image
what am I doing wrong?

@michicc
Copy link
Member

michicc commented Feb 4, 2019

It's only a PR for now and not merged into master yet.

@George-VB
Copy link

xUSSRset is available here http://bundles.openttdcoop.org/xussrset/push/LATEST/

@PeterN
Copy link
Member

PeterN commented Feb 4, 2019

By setting the bit to hide railtypes on all railtypes, you've of course made it so that NO railtypes appear. This makes it somewhat tricky to test...

PeterN added a commit to PeterN/OpenTTD that referenced this issue Feb 5, 2019
@PeterN
Copy link
Member

PeterN commented Feb 5, 2019

@George-VB Thanks for that test, however are you able to provide a realistic test with out all rail types hidden? I would also need to know which vehicles to test with.

@George-VB
Copy link

I can hide all ACDC-electrified railways for example (the last one in the list), so you could test with ACDC engines (should be available in AC and DC depots). Would it be suitable?

@George-VB
Copy link

If so, you can get a new version at http://bundles.openttdcoop.org/xussrset/push/LATEST/
List of ACDC engines is at https://wiki.openttd.org/XUSSR_Set/Electric_locomotive/EN

@PeterN
Copy link
Member

PeterN commented Feb 6, 2019

This is implemented by #7118.

@PeterN PeterN closed this as completed Feb 6, 2019
@George-VB
Copy link

George-VB commented Feb 9, 2019

Works fine with master 20190207
image
image

nielsmh pushed a commit to nielsmh/OpenTTD that referenced this issue Mar 11, 2019
douiwby pushed a commit to douiwby/OpenTTD that referenced this issue Apr 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: NewGRF This issue is related to NewGRFs enhancement Issue would be a good enhancement; we accept Pull Requests! flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

5 participants