TCS scripting DoesBrakeCutPower & BrakeCutsPowerAtBrakeCylinderPressure
#1
Posted 10 April 2021 - 11:53 AM
Have someone the problem that this tokens not work:
DoesBrakeCutPower ( 1 )
BrakeCutsPowerAtBrakeCylinderPressure ( 1.0bar )
When you are in train with TCS script , without TCS script it works.
In advance thanks,
Stijn
#2
Posted 10 April 2021 - 12:52 PM
#3
Posted 11 April 2021 - 04:07 AM
DoesBrakeCutPower ( 1 )
BrakeCutsPowerAtBrakeCylinderPressure ( 1.0bar )
Are in .eng file
Indeed the TCS scripts takes over and ignore al standard MSTS monitors and traincontolsystem data. But that two important lines too.
#4
Posted 11 April 2021 - 05:14 AM
First TCS scripts should only disable things in any of
EmergencyStopMonitor( )
VigilanceMonitor( )
OverspeedMonitor( )
So if it is inside one of those sections then
DoesBrakeCutPower ( 1 )
BrakeCutsPowerAtBrakeCylinderPressure ( 1.0bar )
will not be used, but if it is in the normal braking section it should work.
Second the other thing that can be used now in OR is
ORTSDoesBrakeCutPower ( 1 )
ORTSBrakeCutsPowerAtBrakePipePressure ( 3.0bar )
ORTSBrakeRestoresPowerAtBrakePipePressure ( 4.0bar )
This one should definitely work if placed with the normal braking information.
#5
Posted 11 April 2021 - 08:31 AM
#6
Posted 20 April 2021 - 04:20 AM
These parameters are used in the TCS script only.
In the default TCS, you have this code that manages this functionality:
SetTractionAuthorization(!DoesBrakeCutPower() || LocomotiveBrakeCylinderPressureBar() < BrakeCutsPowerAtBrakeCylinderPressureBar());
So, in the custom TCS script, if this (or something similar) is not defined, then nothing happens.<script src="chrome-extension://hhojmcideegachlhfgfdhailpfhgknjm/web_accessible_resources/index.js">
#7
Posted 16 May 2021 - 12:57 PM
SetTractionAuthorization((!DoesBrakeCutPower() || LocomotiveBrakeCylinderPressureBar() < BrakeCutsPowerAtBrakeCylinderPressureBar()) && !EmergencyBraking); => works
:sign_thanks: Thanks Serana ;-)
#8
Posted 28 October 2021 - 09:46 AM
In the following video described the Aspect change by TCS script.
Video of Signal Aspect change
The sound is called by TriggerSoundInfo2() function. But I didn't found a way to stop it.
else if (RSLastSignalAspect == Aspect.Approach_1 && RSLowConfirmationTimer.Triggered || RSLastSignalAspect == Aspect.Approach_2 && RSLowConfirmationTimer.Triggered) { if (!RSPressed) { TriggerSoundInfo2(); } else { RSCode = RSCODE.ALSN_4; TriggerSoundAlert2(); RSPressed = true; RSEmergencyTimer.Stop(); } }
In this section of my code I solved the issue by triggering a sound that doesn't have a reference in sms file but I wanted to ask if there is a more conventional way to stop a triggered sound?
Regards
Oleg
#10
Posted 02 November 2021 - 11:02 AM
Can you please explain shortly about Aspect.Permission in TrainControlSystem.cs enums?
As my scarce understanding, Aspect.None we gets when the Simulator doesn't able to show any Aspect, like in the case of SPAD or when there is no Signals between the train and end of track (more cases maybe?). What Aspect does have a Signal Head ahead for Aspect.Permission value?
Regards
Oleg
#11
Posted 07 November 2021 - 05:52 AM
This state is supposed to be selected when the aspect of the signal is STOP and the driver presses the TAB key to request permission to the dispatcher to pass the signal at danger.
#12
Posted 08 November 2021 - 09:44 AM
I've one more issue with Emergency braking. It's an EmergencyBrakes timer in the code. A Penalty must to be activated if a player doesn't pressig the reset button. If so, of course, the timer stops. The problem is that even if the reset button was pressed and Emergency brakes doesn't activated, a massage is still appears on the screen. It means, when the timer is triggered and the reset button was pressed before, a player sees "Emergency brakes applied" without brakes themselves. The same happens when the timer in the code stops. "Emergency brakes released" is on the screen. How can I hide those messages?
Regards
Oleg