Page 1 of 1

New combined semaphore working style

Posted: 13 Dec 2020 11:00
by Quantom
Hello! Im think, that OpenTTD need have a new combined semaphore! Now (already on starting this teme) combined semaphore working this way - if ALL out semaphores are red, combined are red. I think we need new way - if ONE OF out semaphores are red, combined are red.
Now, you know what I want, I need say, I not have any experience whis developing OpenTTD, whis openGL. I'm know baze of C++ (but i think i need more C, becouse original code of combined semaphore was writed on C)
Can someone help me whis it?
Thanks

Re: New combined semaphore working style

Posted: 13 Dec 2020 12:13
by Eddi
i'm unsure why you would need that, but you could start from this ancient patch that also adds a new signal type: [will not apply, but might show the general gist of what to do]

viewtopic.php?f=33&t=26364

note that currently the signal types 0 through 5 are used, types 6 and 7 are unused and you can add without much trouble.

Re: New combined semaphore working style

Posted: 13 Dec 2020 12:39
by Quantom
Thank you!
Realy, interesting Idea!
Becouse (if we imagine train signals as C code like: (if x [Some condition] y:) )
Now in this code we have only "AND" Like condition, NAND patch adds "NOT" condition, and I like add "OR" condition.

Re: New combined semaphore working style

Posted: 13 Dec 2020 21:03
by Wahazar
BTW, signal 6 is already used in JGRPP for programmed signals, I suggest to use 7 :)

Re: New combined semaphore working style

Posted: 13 Dec 2020 23:33
by JGR
McZapkie wrote: 13 Dec 2020 21:03 BTW, signal 6 is already used in JGRPP for programmed signals, I suggest to use 7 :)
You could easily create this behaviour using the existing programmable pre-signal functionality, such that you wouldn't need to add another signal type as well.

That said, it is not really a problem for two different patches to be using signal type 6 for different purposes.

Re: New combined semaphore working style

Posted: 14 Dec 2020 02:21
by odisseus
Quantom wrote: 13 Dec 2020 11:00 I think we need new way - if ONE OF out semaphores are red, combined are red.
This can be achieved using just the existing types of signals.