How do I set Programmable Signals on JGRPP so local train waits express train?

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

Moderator: OpenTTD Developers

Post Reply
EG0611
Engineer
Engineer
Posts: 49
Joined: 19 Feb 2012 08:39

How do I set Programmable Signals on JGRPP so local train waits express train?

Post by EG0611 »

What I want to accomplish is that if an Express train is approaching to signal A, Signal B stays green, Signal C stays red and let express train to pass through without waiting Local train.

Image

How should the Programmable Signals menus be for each signal?

Also is there a tutorial for dummies about how to use Programmable Signals? There are a very few to none tutorials and explanations online.
gebik
Traffic Manager
Traffic Manager
Posts: 171
Joined: 07 Sep 2020 15:12

Re: How do I set Programmable Signals on JGRPP so local train waits express train?

Post by gebik »

Have you tried the JGRpp wiki on GitHub? https://github.com/JGRennison/OpenTTD-p ... Signalling For you is useful first part of it. BTW, this wiki is linked in JGRpp topic's first post.
Are you an eye candy player? Check out Invisible engine set! viewtopic.php?f=67&t=88934
You can write to me in English, or Czech. Můžete mi psát česky nebo anglicky.

Formerly known as MLG.
Taschi
Route Supervisor
Route Supervisor
Posts: 425
Joined: 11 Oct 2014 22:58

Re: How do I set Programmable Signals on JGRPP so local train waits express train?

Post by Taschi »

One thing I occasionally do and which even works in vanilla OpenTTD is to just leave out signal B. That means that if an express train that is fairly close to the preceding local train will immediately get a path through the station while the local train is still loading, but it also means that the local train won't wait for an express train that is still far away.

I know that that's not exactly what you've asked but it might still be helpful, I guess.
ZaphodB
Engineer
Engineer
Posts: 6
Joined: 17 Apr 2020 12:03

Re: How do I set Programmable Signals on JGRPP so local train waits express train?

Post by ZaphodB »

EG0611 wrote: 21 Jun 2021 17:49 What I want to accomplish is that if an Express train is approaching to signal A, Signal B stays green, Signal C stays red and let express train to pass through without waiting Local train.

Image

How should the Programmable Signals menus be for each signal?

Also is there a tutorial for dummies about how to use Programmable Signals? There are a very few to none tutorials and explanations online.
It depends how far away you want your express train to cause the local train to wait. If you're happy that the local train will only wait when the express train is already at or near A, then the solutions using 'reserve through' or omission of signal B will help to some extent.

If you want your local train to wait even when the express train is some distance away, you could use slots to achieve this.

First, create a slot - let's say it's called 'Suttown'.
Choose a signal at your preferred distance on the approach to A and add the following programme:

Code: Select all

If train group is 'express' then acquire slot 'Suttown'
On signal C, add the following programme:

Code: Select all

If slot 'Suttown' occupancy > 0 then wait at PBS signal
Finally, on signal B add code to release the slot:

Code: Select all

If train group is 'express' then release slot 'Suttown'
This should work as you desire. Note there are other ways of achieving this - for example you could discriminate on train speed or next order instead of creating a train group 'express'. Also if you will have multiple express trains in a row, you might need to increase the maximum occupancy of the slot or use counters instead (but that is basically the same code).
LaChupacabra
Route Supervisor
Route Supervisor
Posts: 385
Joined: 08 Nov 2019 23:54

Re: How do I set Programmable Signals on JGRPP so local train waits express train?

Post by LaChupacabra »

Taschi wrote: 21 Jun 2021 18:01 One thing I occasionally do and which even works in vanilla OpenTTD is to just leave out signal B. That means that if an express train that is fairly close to the preceding local train will immediately get a path through the station while the local train is still loading, but it also means that the local train won't wait for an express train that is still far away.
This solution won't be of much help. :) What if the train starts from the station first and the first one takes the track? The only effect of this solution will be that the spacing between trains will be greater and the capacity of the line will be reduced.

I think the use of programmable signals in this case would be an abuse. ;)

Yes, you can use them, but why complicate your life when you can use regular pre-signals? Thanks to them, you can easily designate, among others, main and subordinate tracks at intersections. A combination of path and block signals can work in a similar way.
Image
main&sub pre,path+block.png
(146.36 KiB) Not downloaded yet
I don't know the possibilities of programmable signaling devices very much, I'm not sure if what ZahodB wrote is right, but it could also be done this way.
Image
main&sub progsign.png
main&sub progsign.png (103.85 KiB) Viewed 1567 times
Such a thing can work especially when the distance from the control section and the connection of the routes is greater.
I am sorry for may English. I know is bed.
Taschi
Route Supervisor
Route Supervisor
Posts: 425
Joined: 11 Oct 2014 22:58

Re: How do I set Programmable Signals on JGRPP so local train waits express train?

Post by Taschi »

LaChupacabra wrote: 22 Jun 2021 14:53 This solution won't be of much help. :) What if the train starts from the station first and the first one takes the track?
I consider that "working as intended" and it's good enough for me.
EG0611
Engineer
Engineer
Posts: 49
Joined: 19 Feb 2012 08:39

Re: How do I set Programmable Signals on JGRPP so local train waits express train?

Post by EG0611 »

ZaphodB wrote: 22 Jun 2021 07:10 This should work as you desire. Note there are other ways of achieving this - for example you could discriminate on train speed or next order instead of creating a train group 'express'. Also if you will have multiple express trains in a row, you might need to increase the maximum occupancy of the slot or use counters instead (but that is basically the same code).
ZaphodB thank you for your assistance. Now I understand how it works.
LaChupacabra wrote: 22 Jun 2021 14:53 I don't know the possibilities of programmable signaling devices very much, I'm not sure if what ZahodB wrote is right, but it could also be done this way.
I couldn't find how you tell a signal that other signal's color is.
User avatar
Captain Rand
Traffic Manager
Traffic Manager
Posts: 192
Joined: 28 Jan 2012 07:35

Re: How do I set Programmable Signals on JGRPP so local train waits express train?

Post by Captain Rand »

ZaphodB wrote: 22 Jun 2021 07:10 First, create a slot - let's say it's called 'Suttown'.
How do you create a slot? I've seen the option in the programable signals menu, but have no idea how to use it.

Pete.
There's nothing like a deadline to hone the concentration.

Good manners cost nothing, but earn respect.

" 'Impossible' is not in our vocabulary." Jack Chrichton, Farscape
EG0611
Engineer
Engineer
Posts: 49
Joined: 19 Feb 2012 08:39

Re: How do I set Programmable Signals on JGRPP so local train waits express train?

Post by EG0611 »

Captain Rand wrote: 15 Dec 2021 17:42
How do you create a slot? I've seen the option in the programable signals menu, but have no idea how to use it.
Pete.
There, under the Trains menu.
Screenshot_1.png
(207.07 KiB) Not downloaded yet
Post Reply

Return to “General OpenTTD”

Who is online

Users browsing this forum: No registered users and 4 guests