Elvas Tower: Does OR support this syntax of signal script? - Elvas Tower

Jump to content

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

Does OR support this syntax of signal script? Rate Topic: -----

#1 User is offline   Railcat 

  • Hostler
  • Group: Status: Active Member
  • Posts: 51
  • Joined: 19-January 12
  • Gender:Male
  • Simulator:Open Rails
  • Country:

Posted 16 February 2020 - 12:37 AM

Hi, I want to know whether OR support this syntax of signal script?

Logfile:
Warning: sigscr-file line 216 : Unexpected number of = in string : H_G_P = SIG_FEATURE ( SIGFEAT_GRADIENT_PLATE ) OR( CFGSIG_MR !=# CFGSIG_LR AND CFGSIG_MR ==# 0 AND CFGSIG_LR > 0 )

script comes from WupperExpress12:

SCRIPT KS_OPTIK_GRUEN

extern float block_state ();
extern float sig_feature ();
extern float this_sig_lr ();
extern float next_sig_lr ();
extern float next_sig_mr ();
extern float enabled;
extern float state;
extern float draw_state;

float speed_reduction;
float next_state_rptr;
float next_state;
float h_n_p;
float h_g_p;
float this_state;
float cfgsig_mr;
float cfgsig_lr;

this_state = this_sig_lr ( SIGFN_NORMAL );
speed_reduction = next_sig_lr ( SIGFN_SHUNTING );
next_state_rptr = next_sig_mr ( SIGFN_REPEATER );
next_state = next_sig_lr ( SIGFN_NORMAL );
h_n_p = sig_feature ( SIGFEAT_NUMBER_PLATE );
cfgsig_mr = next_sig_mr ( SIGFN_SHUNTING );
cfgsig_lr = next_sig_lr ( SIGFN_SHUNTING );

h_g_p = sig_feature ( SIGFEAT_GRADIENT_PLATE ) or
( cfgsig_mr !=# cfgsig_lr and cfgsig_mr ==# 0 and cfgsig_lr > 0 );


state = 7;
draw_state = 0;

if ( this_state ==# -1 )
{
if ( ( next_state ==# 7 and not h_g_p ) or ( ( next_state_rptr ==# 7 ) and h_g_p ) )
{
draw_state = 1;
}
else
{
draw_state = 0;
}
}
else
{
if ( this_state < 3 or next_state < 3 ) // next_state_rptr einf黦en !!
{
draw_state = 0;
}
else
{
if ( ( next_state > 6 and not h_g_p ) or ( next_state_rptr > 6 and h_g_p ) or
( next_state >=# this_state and not h_g_p ) or ( next_state_rptr >=# this_state and h_g_p ) )
{
draw_state = 1;
}
}
}

return;

#2 User is offline   ebnertra000 

  • Superintendant
  • Group: Status: Elite Member
  • Posts: 1,234
  • Joined: 27-February 17
  • Gender:Male
  • Location:East-Central Minnesota
  • Simulator:OR/TSRE
  • Country:

Posted 16 February 2020 - 08:00 AM

I recommend this:

h_g_p = sig_feature ( SIGFEAT_GRADIENT_PLATE );

if ( cfgsig_mr !=# cfgsig_lr and cfgsig_mr ==# 0 and cfgsig_lr > 0 )

Since the first half is defining the variable h_g_p, and it looks like the second half is supposed to be a conditional statement, which if fulfilled, will show state 7 using draw state 0

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