Expand potential of TCS scripting
#21
Posted 12 March 2020 - 03:11 PM
Geoff
#22
Posted 13 March 2020 - 03:18 AM
I hope that the team will add the cruise control as soon possible!!
#23
Posted 15 March 2020 - 03:46 AM
- download and unpack OR_NewYear_MG rev.55.1 from the usual link, that is http://www.interazio..._NewYear_MG.zip
- download, read the readme file and unpack http://www.interazio...SCMT_Rev3.0.zip
- download, read the readme file and unpack http://www.interazio...SCMT_Rev1.0.zip . This last file includes the test activities.
I credit again gpz and Serana for the work done on this field. I could also use (after some adaptations) Serana's script for the part implementing the braking curves.
By the way SCMT foresees that when the overspeed warning threshold (3 Km/h above allowed max speed) is reached, an automatic dynamic braking is started; when the overspeed emergency threshold (5 Km/h above allowed max speed) is reached, the usual emergency braking is started.
15/3/2020 7:18PM: Post updated
#24
Posted 17 March 2020 - 05:12 AM
This occurs on all scenarios with type 1 signaling (Adriatics for example).
#26
Posted 28 March 2020 - 10:21 AM
- download and unpack OR_NewYear_MG rev.56.1 or later
- download, read the readme file and unpack Pack_SCMT_Rev7.0.zip
- download, read the readme file and unpack Pack_Activity_demo_SCMT_Rev4.0.zip . This last file includes the test activities.
Readme's are also in English.
With OR NewYear MG rev. 56.1 I have added what I think is a useful hook for people writing TCS scripts: it is
Script.Locomotive = () => Locomotive;
Locomotive is the actual player locomotive.
It looks like a trivial thing, but with this the TCS script may have access to the whole Simulation environment public classes and methods (trainset, player train, signals and so on).
Therefore it is no more needed to add further personalized hooks, and only general use hooks might be added.
#27
Posted 30 March 2020 - 10:22 AM
#28
Posted 31 March 2020 - 12:42 AM
I am a Spanish railroad enthusiast interested in signalling and TCSs. I have previously developed a TCS script for the most used system in Spain, ASFA, which also included a simple implementation of LZB and ETCS (not very well tested). It can be downloaded at http://www.spaintrai...ex.php?dlid=847
Thanks to Carlo's improvement in TCS API, we decided to create a fully functional version of 'ASFA digital', which uses a lot of buttons and displays. To increase realism, we thought that it could be interesting to modify existing Spanish routes to add 'beacons', using for that purpose REPEATER signals, unused in Spanish signal scripts. It is not an elegant solution, but is as much as we can do at the moment.
I know this is a polemical topic, as signalling code might be refactored in the future, so I understand if you decide to not take into account the changes, which I follow to explain.
First of all, I have added an assembly reference in script compiler for 'Orts.Formats.Msts' to access signal enums from the script. I also modified Find_Next_Object_InRoute in Signals.cs so other sigfn types can be looked for. When testing this functionality, I saw that if two DISTANCE signals were in the same TrackCircuit, only first of them was correctly detected. I have corrected this too.
I attach a diff file with suggested changes.
Thanks in advance
Attached File(s)
-
diff.txt (2.75K)
Number of downloads: 597
#29
Posted 31 March 2020 - 03:03 AM
I have added your diffs in the source code of OR NewYear MG and uploaded them, and I have uploaded OR NewYear MG REv 56.2 , which includes your improvements. Thank you also for spotting the bug.
I will have an interested look at your ETCS script, and will allow myself to use parts of it if you agree, as I have the intention to work on it for Italian HSTs, so, if I can spare work, that's welcome :)
#30
Posted 31 March 2020 - 04:09 AM
Csantucci, on 28 March 2020 - 10:21 AM, said:
Script.Locomotive = () => Locomotive;
Locomotive is the actual player locomotive.
It looks like a trivial thing, but with this the TCS script may have access to the whole Simulation environment public classes and methods (trainset, player train, signals and so on).
Therefore it is no more needed to add further personalized hooks, and only general use hooks might be added.
Originally, it was not accepted to give access to the simulator data structures in order not to have scripts do weird things with the simulator.
That's why we isolated the scripts as much as it is currently.
#31
Posted 31 March 2020 - 04:44 AM
Csantucci, on 31 March 2020 - 03:03 AM, said:
I have added your diffs in the source code of OR NewYear MG and uploaded them, and I have uploaded OR NewYear MG REv 56.2 , which includes your improvements. Thank you also for spotting the bug.
I will have an interested look at your ETCS script, and will allow myself to use parts of it if you agree, as I have the intention to work on it for Italian HSTs, so, if I can spare work, that's welcome :)
I wrote that script years ago, when I did not know much about coding, so it looks like a mess. Anyway, you can use it you find it helpful. I also have a work-in-progress C++ implementation of ETCS following ERA SRS. Everything can be found in my github page https://github.com/cesarBLG/
#32
Posted 31 March 2020 - 04:59 AM
thank you for the link and your authorization!
Hi Cédric,
I studied about this, however this bad case would occur only to people using such scripts, and the script execution can be inhibited by simply checking the related general option.It wouldn't corrupt OR as such, and for sure it is more sure than adding buggy functions to the OR main code. The advantage is that you haven't to add this and the other hook to cover all particularities that the different TCS offer. I was a bit uncomfortable at adding hooks that have very particular usages. So I think that advantages are bigger than disadvantages. But I am open to discuss this.
#33
Posted 31 March 2020 - 06:03 AM
Csantucci, on 31 March 2020 - 04:59 AM, said:
I studied about this, however this bad case would occur only to people using such scripts, and the script execution can be inhibited by simply checking the related general option.It wouldn't corrupt OR as such, and for sure it is more sure than adding buggy functions to the OR main code. The advantage is that you haven't to add this and the other hook to cover all particularities that the different TCS offer. I was a bit uncomfortable at adding hooks that have very particular usages. So I think that advantages are bigger than disadvantages. But I am open to discuss this.
I am not against the idea, I am just reminding why it was chosen to do it like this. ;)
#34
Posted 07 April 2020 - 01:23 AM
One of my TCS script beta-testers noticed that when using a rear cab, DISTANCE signals are not read properly. NextDistanceSignalAspect() and NextDistanceSignalDistanceM() functions still return information related to forward train direction, instead of reading backwards. I have tried to find a solution, but I don't really understand signalling code, so I haven't succeeded.
Kind regards,
César
#35
Posted 07 April 2020 - 07:52 AM
I must admit I didn't bother about reverse direction. In which case do you need it? Explore mode? Or activity mode running from rear cab? Or something else?