Page 1 of 1

Scripting Signalling events scenarios?

PostPosted: Fri Apr 03, 2020 9:49 pm
by RobertM
So I have heard a rumor somewhere that it is possible to script an event via a scenario script that will effect signalling, can anyone confirm or deny this?

Specifically what I am trying to emulate is a train with a banker getting to a location and being held at a location via a signal being held at Danger via the script, and until a Stop at Destination & a Drop off instructions have been complete, then after 30 seconds the signal that was at danger changes to proceed and away we go.

Is this possible?

Robert

Re: Scripting Signalling events scenarios?

PostPosted: Sun May 03, 2020 12:27 pm
by AndiS
As far as I am concerned, I filed it under rumor.

After the initial euphoria it showed with some clarity that scenario scripts are good for scenery effects of all kind. But both AI and signals are complex subsystems that follow their own rules.

Matt at one point said he would not try to work against the AI driver. In theory, you could get the ID of an AI engine and set controllers there. But it was always clear that you would fight against the system still influencing the AI engine in parallel with your scenario script.

For signals, I never heard of a way to get their ID and without that, scenario scripts can do nothing.

However, it has always been possible to script special signal behaviour, like clearing X seconds after the train stopped. Coupling is also detected by signal because the game core sends 1 "train gone" message and 2 "train entered block" messages when you uncouple. Likewise for coupling.

Level crossings can do the same.

But it is all about observing the train. No central control or script or plan.

Since you cannot swap signals on a per scenario basis, I devised a bunch of "modifier objects" that observe the train and talk to the signals (being signals themselves, in terms of game asset type). But I fully agree that this is complex stuff and they only talk to my own signals (more precisely, all the other signals are not listening).