C# Signal Scripts
#11
Posted 16 August 2021 - 03:36 PM
I added the PreUpdate() function in all script interfaces in order to manage the following case:
When you launch a game in timetable mode, you go through a pre-update phase where you start from midnight and you wait until you reach the start of your train.
During this phase, trains are running following the timetable information but with a huge time step.
If you use Timer instances inside signal scripts, the Timer instances will be updated at the same huge time step and the signals may clear much too late and cause huge delays to the trains.
With the PreUpdate() function, you can choose to disable the timers when the simulator is in this pre-update phase and avoid delays.
Link to the corresponding pull request: https://github.com/o...nrails/pull/445
#12
Posted 18 August 2021 - 10:47 AM
Regards
Oleg
#13
Posted 18 August 2021 - 11:31 AM
#14
Posted 18 August 2021 - 01:26 PM
Perhaps you might also consider a shorter update interval than the standard 5 seconds? It might be a variable specified in the route .trk
Rick
#15
Posted 26 September 2021 - 11:54 AM
Regards
Oleg
#16
Posted 26 September 2021 - 12:42 PM
#17
Posted 07 December 2021 - 04:08 AM
Is it some way for Signal Script to define a Multiplayer Mode?
Regards
Oleg
#18
Posted 07 December 2021 - 07:31 AM
else if (BLOCK_CLEAR !=# block_state()) { if (Approach_Control_Position (Approach_Control_Req_Position)) { Activate_Timing_Trigger(); } } else if (block_state() !=# BLOCK_CLEAR && ( Check_Timing_Trigger( 120 )) ) state = SIGASP_STOP_AND_PROCEED;
Hello.
Do I think the timer in the code above doesn't work because of this?
Sincerely, Laci1959
#19
Posted 07 December 2021 - 09:46 PM
VicenteIR, on 07 December 2021 - 04:08 AM, said:
Is it some way for Signal Script to define a Multiplayer Mode?
Regards
Oleg
Err... what do you mean ?
Laci1959, on 07 December 2021 - 07:31 AM, said:
else if (BLOCK_CLEAR !=# block_state()) { if (Approach_Control_Position (Approach_Control_Req_Position)) { Activate_Timing_Trigger(); } } else if (block_state() !=# BLOCK_CLEAR && ( Check_Timing_Trigger( 120 )) ) state = SIGASP_STOP_AND_PROCEED;
Hello.
Do I think the timer in the code above doesn't work because of this?
Sincerely, Laci1959
I don't know. I have never used those functions in MSTS signal scripts. But anyway, this is a topic about C# signal scripts, so I don't think this is here we should talk about it. Perhaps opening a topic in "Maybe it's a bug" is appropriate.
#20
Posted 08 December 2021 - 09:23 AM
Serana, on 07 December 2021 - 09:46 PM, said:
I don't know. I have never used those functions in MSTS signal scripts. But anyway, this is a topic about C# signal scripts, so I don't think this is here we should talk about it. Perhaps opening a topic in "Maybe it's a bug" is appropriate.
Thanks, I'm sorry, I misunderstood. I thought there might be a connection.