Problem with Shifter

OpenTTD is a fully open-sourced reimplementation of TTD, written in C++, boasting improved gameplay and many new features.

Moderator: OpenTTD Developers

Post Reply
Nuno
Engineer
Engineer
Posts: 3
Joined: 10 Oct 2022 14:08

Problem with Shifter

Post by Nuno »

Hi everyone,

I'm having problems with shifters/joiners... I have followed http://blog.openttdcoop.org/2010/01/13/ ... n-example/ to create a fail-safe joiner. I'm pretty sure I have everything correct, with the possible exception of the track length. I have removed the penalty signal as I don't want to "force" trains to merge, but even with that signal, the following shouldn't be happening: if you look at the screenshot below, how/why did the bottom train try to merge/shift into the ML if the train on the ML was already "there"?! Most trains continue straight on the SL, but around 20% decide to force their way, in even when they don't need to.

Image
Shifter.jpg
Screenshot of shifter
(402.77 KiB) Not downloaded yet

Thank you so much!
Transportman
Tycoon
Tycoon
Posts: 2781
Joined: 22 Feb 2011 18:34

Re: Problem with Shifter

Post by Transportman »

Did you change the Two-way end of line setting to true? If that is true, it will see a red signal (with signals on both sides) as a dead end and use the other route. https://wiki.openttdcoop.org/Two-way_end_of_line
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML
Nuno
Engineer
Engineer
Posts: 3
Joined: 10 Oct 2022 14:08

Re: Problem with Shifter

Post by Nuno »

Thanks @Transportman!

Yes, I’ve activated two-way end-of-line (had no idea about this setting…) after my original post, but it didn't make any difference it seems (there is something else wrong somewhere).

As per the signals being used, Please see the screenshot below. All the ones that don’t have an arrow are Path Signals.

I tried to fix the track length for that specific train length. Is it correct now? Still, most trains will try to merge while there’s a train already on the ML. Something is definitely wrong here ☹

https://photos.app.goo.gl/HCZPFrxEGMGn9V8FA

Here’s a link to the save game in case anyone wants to have a look: https://vrfy-my.sharepoint.com/:f:/g/pe ... Q?e=ny2pR9

The train line has trains of different lengths (I know!). This is something I’m working on standardizing as I know the shifter will not work well with trains of different lengths.

Thanks once again!
Transportman
Tycoon
Tycoon
Posts: 2781
Joined: 22 Feb 2011 18:34

Re: Problem with Shifter

Post by Transportman »

Nuno wrote: 19 Oct 2022 07:19 Thanks @Transportman!

Yes, I’ve activated two-way end-of-line (had no idea about this setting…) after my original post, but it didn't make any difference it seems (there is something else wrong somewhere).
How did you change the setting? Did you change it in the config file before starting the map? If you started the map with the setting off, setting it in the config file will not make it stick in the save itself.
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML
User avatar
jfs
Tycoon
Tycoon
Posts: 1757
Joined: 08 Jan 2003 23:09
Location: Denmark

Re: Problem with Shifter

Post by jfs »

If you want to change settings not available in the GUI, use the game console. Do not edit the config file to change settings, you can't be sure it'll work as you intended.
Use the game console to change the setting, and you can be sure it will affect the game you have running right then.


This is not just for Nuno but for also everyone who needs to suggest others to change game settings. Use the game console to change hidden settings. It doesn't need to be hard: Open the console via the :?: menu, copy-paste the command to change the setting from a forum post (just press Ctrl-V in the game), and then you can close the console via the :?: menu again. No need to tell anyone to hunt for keys that might be located in different places or have different labels on their keyboard. It's much easier than telling someone to go digging in their File Explorer or Finder or whatever to find a config file, which might not be showing the file extension, which they then need to get to open with an appropriate plain text editor. Using the game console to change the setting avoids all that.
Transportman
Tycoon
Tycoon
Posts: 2781
Joined: 22 Feb 2011 18:34

Re: Problem with Shifter

Post by Transportman »

@nuno: I opened your save, the setting yapf.rail_firstred_twoway_eol is false in the save, so I suspect that you changed the config after you started this game. You can enable it by opening the console (~ key or see the post of jfs) and type

Code: Select all

set yapf.rail_firstred_twoway_eol 1
and enter. You can check the value of your game by omitting the 1:

Code: Select all

set yapf.rail_firstred_twoway_eol
jfs wrote: 22 Oct 2022 11:04 If you want to change settings not available in the GUI, use the game console. Do not edit the config file to change settings, you can't be sure it'll work as you intended.
Use the game console to change the setting, and you can be sure it will affect the game you have running right then.


This is not just for Nuno but for also everyone who needs to suggest others to change game settings. Use the game console to change hidden settings. It doesn't need to be hard: Open the console via the :?: menu, copy-paste the command to change the setting from a forum post (just press Ctrl-V in the game), and then you can close the console via the :?: menu again. No need to tell anyone to hunt for keys that might be located in different places or have different labels on their keyboard. It's much easier than telling someone to go digging in their File Explorer or Finder or whatever to find a config file, which might not be showing the file extension, which they then need to get to open with an appropriate plain text editor. Using the game console to change the setting avoids all that.
But changing the config file will ensure that the settings are applied to all new games, using the console to change settings in a running game will only apply the setting to that game.
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML
User avatar
jfs
Tycoon
Tycoon
Posts: 1757
Joined: 08 Jan 2003 23:09
Location: Denmark

Re: Problem with Shifter

Post by jfs »

If you change the setting via console while on the main menu, you're changing the default that will be written to the config file. (As far as I know.)
Nuno
Engineer
Engineer
Posts: 3
Joined: 10 Oct 2022 14:08

Re: Problem with Shifter

Post by Nuno »

Thanks again everyone!

I initially changed this setting through the game console while in the game. I didn't know how to check if it was set, so I decided to apply it in the config file. Checking the setting again through the console (now that I know how to do it), I can see it was not set for some reason... :oops: I've set it again through the console, checked that it remained set (after saving, exiting, and loading the game again), and now the shifter seems to be working properly!! :bow:

Thank you all once again for all your useful replies and tips!
Post Reply

Return to “General OpenTTD”

Who is online

Users browsing this forum: Amazon [Bot] and 25 guests