Railcraft

Railcraft

34M Downloads

Possible Routing table bug

ilightwas opened this issue ยท 5 comments

commented

Not sure If i'm doing something wrong here or if it's really an issue. I have this locomotive painted black and yellow, trying to add more than one conditional for the switch motor. I want it to activate the motor only when the locomotive is black/yellow and the route is different from quartz or coal. It works with one conditional as I showed first in the video but when I try to combine the 2 it doesn't. Maybe i'm doing something wrong in the script, if so please help me understand how to do it properly.

commented

It might be because it unloads before you finish the connection? Have you tried keeping it loaded?

commented

Also, the interlock boxes has to be connected to work. They wont work as intended with a receiver box between them.

commented

Your second routing table will evaluate like this
(Color=Black,Yellow AND NOT Dest=Quartz) OR (Color=Black,Yellow AND NOT Dest=Coal)

At the root of the routing table there is a special invisible OR operator that includes the first level of everything in the table. You basically have two groups, as indicated by the parenthesis above, made up by the two AND operators linked by this OR.
Since one of the NOT statements will always be true (as the locomotive can't have both destinations) the result will always be the switch engaging.

I'd suggest writing your statement like this instead, assuming I have your intention correct:
AND
--Color=Black,Yellow
--AND
----NOT
------Dest=Quartz
----NOT
------Dest=Coal
(Hyphens because github strips leading spaces.)

commented

Now I get it! Thank you very much for explaining. Now I have this other issue with interlock and receivers. Not the first time that it happened, I wasn't sure if it was a one time thing. The video shows it all, it only "updates" when i change the receiver to another block. It stops working from nothing and I have to do that to fix it. Should I create other topic for it?

commented

This appears to be answered