Elvas Tower: TCS scripting - Elvas Tower

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

TCS scripting DoesBrakeCutPower & BrakeCutsPowerAtBrakeCylinderPressure Rate Topic: -----

#1 User is offline   Stijn D.C. 

  • Engineer
  • Group: Posts: Contributing Member
  • Posts: 559
  • Joined: 20-August 16
  • Gender:Male
  • Simulator:Open Rails
  • Country:

Posted 10 April 2021 - 11:53 AM

Hello,

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 User is offline   darwins 

  • Superintendant
  • Group: Posts: Elite Member
  • Posts: 1,530
  • Joined: 25-September 17
  • Gender:Male
  • Simulator:Open Rails
  • Country:

Posted 10 April 2021 - 12:52 PM

Are they in the TCS script or the eng file? I am not certain, but I think the TCS script overwrites the eng file and so the eng file is ignored and only the TCS script file is read.


#3 User is offline   Stijn D.C. 

  • Engineer
  • Group: Posts: Contributing Member
  • Posts: 559
  • Joined: 20-August 16
  • Gender:Male
  • Simulator:Open Rails
  • Country:

Posted 11 April 2021 - 04:07 AM

Hello,

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 User is offline   darwins 

  • Superintendant
  • Group: Posts: Elite Member
  • Posts: 1,530
  • Joined: 25-September 17
  • Gender:Male
  • Simulator:Open Rails
  • Country:

Posted 11 April 2021 - 05:14 AM

Two things here.

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 User is offline   Laci1959 

  • Superintendant
  • Group: Posts: Elite Member
  • Posts: 1,130
  • Joined: 01-March 15
  • Gender:Male
  • Simulator:Alföld
  • Country:

Posted 11 April 2021 - 08:31 AM

View Postdarwins, on 11 April 2021 - 05:14 AM, said:

Two things here.

First TCS scripts should only disable things in any of

EmergencyStopMonitor( )
VigilanceMonitor( )
OverspeedMonitor( )





Hi there. I tend to delete the MSTS entries in the quote in vehicles where the GPZ TCS script is placed.

#6 User is offline   Serana 

  • Conductor
  • Group: Posts: Contributing Member
  • Posts: 489
  • Joined: 21-February 13
  • Gender:Male
  • Location:St Cyr l'Ecole (France)
  • Simulator:Open Rails
  • Country:

Posted 20 April 2021 - 04:20 AM

Hello,

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 User is offline   Stijn D.C. 

  • Engineer
  • Group: Posts: Contributing Member
  • Posts: 559
  • Joined: 20-August 16
  • Gender:Male
  • Simulator:Open Rails
  • Country:

Posted 16 May 2021 - 12:57 PM

Hello,

SetTractionAuthorization((!DoesBrakeCutPower() || LocomotiveBrakeCylinderPressureBar() < BrakeCutsPowerAtBrakeCylinderPressureBar()) && !EmergencyBraking); => works


:sign_thanks: Thanks Serana ;-)

#8 User is offline   VicenteIR 

  • Fireman
  • Group: Posts: Active Member
  • Posts: 149
  • Joined: 24-April 15
  • Gender:Male
  • Location:Dimona, Israel
  • Simulator:Open Rails
  • Country:

Posted 28 October 2021 - 09:46 AM

Hello!
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

#9 User is offline   Serana 

  • Conductor
  • Group: Posts: Contributing Member
  • Posts: 489
  • Joined: 21-February 13
  • Gender:Male
  • Location:St Cyr l'Ecole (France)
  • Simulator:Open Rails
  • Country:

Posted 28 October 2021 - 12:13 PM

Hi,

The way you described is the conventional way.

#10 User is offline   VicenteIR 

  • Fireman
  • Group: Posts: Active Member
  • Posts: 149
  • Joined: 24-April 15
  • Gender:Male
  • Location:Dimona, Israel
  • Simulator:Open Rails
  • Country:

Posted 02 November 2021 - 11:02 AM

Thank you, Serana.
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 User is offline   Serana 

  • Conductor
  • Group: Posts: Contributing Member
  • Posts: 489
  • Joined: 21-February 13
  • Gender:Male
  • Location:St Cyr l'Ecole (France)
  • Simulator:Open Rails
  • Country:

Posted 07 November 2021 - 05:52 AM

Looking at the code, it seems like this state is not yet usable in the TCS scripts... while the simulator is able to display this state in the track monitor.
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 User is offline   VicenteIR 

  • Fireman
  • Group: Posts: Active Member
  • Posts: 149
  • Joined: 24-April 15
  • Gender:Male
  • Location:Dimona, Israel
  • Simulator:Open Rails
  • Country:

Posted 08 November 2021 - 09:44 AM

Thank you very much! Now it's clear.
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

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users