Sigscr script error

The MSTS 1 Route Editor can be a beast to use, but it's capable of some amazing results, here you can talk with the wizards that are building some of the fantastic routes available and learn how to make your own.

Moderator: Moderators

Locked
User avatar
JohnEyres
Creating the WCML at Warrington
Posts: 511
Joined: Sun Dec 30, 2001 12:00 am
Location: Warrington
Contact:

Sigscr script error

Post by JohnEyres »

I have been adding the greate semaphore signal set by edmundkinder to my route but seem to be getting a an irritating error message everytime I load the route into the RE. The error points to a line which is at the bottom of the script each time. This is at the bottom of the script:

///////////////////////////////////////////////////////////////////////////////
SCRIPT BRSemHomeBranch

// BR Semaphore Branch Home

extern float block_state ();
extern float route_set ();
extern float def_draw_state ();
extern float state;
extern float draw_state;
extern float enabled;

if (!enabled || // Not enabled/cleared to show natural state?
block_state() !=# BLOCK_CLEAR || // Block ahead not clear?
!route_set()) // Switch not set as per link?
{
state = SIGASP_STOP;
}
else
{
state = SIGASP_CLEAR_1;
}

// Get draw state
draw_state = def_draw_state (state);

///////////////////////////////////////////////////////////////////////////////

// End of File


Has anybody else had any problems adding the lines to the signal script files? I cant seem to see any error in this section of text but the RE insists it is here.
BTW I am adding these signals to a script which already holds the default S&C semaphores and the old style 3/4 aspect colour lights.

Any Ideas?
Warrington Railways Route Author

Route Progress: http://johneyres.tripod.com/railway/msts/newms.htm
User avatar
johny
Very Active Forum Member
Posts: 2609
Joined: Fri Dec 07, 2001 12:00 am
Location: N. Warks, UK.

Post by johny »

John,

It is something that you are doing or not doing during the copy and paste exercise. Are you sure that it is the sigscr.dat file and not the sigcfg.dat file giving the error report? Most problems occur with the latter and in most cases it is entirely due to not copying and pasting correctly. Unfortunately the line numbers reported do not always mean what they say, I have had a line number reported that does not exist. I assume these line numbers are some sort of code used by MS/Kuju.

The bottom line is you must copy and paste scripts exactly as they are written, spaces and brackets must be there, miss any one of them and you're in trouble.

John
Technical Authors Do It Manually

#WolvesAyWe
User avatar
alan2
Peak Rail Route Author
Posts: 5512
Joined: Tue Jan 01, 2002 12:00 am
Location: Secret Routebuilders Castle lost on the way to the toilet!

Re: Sigscr script error

Post by alan2 »

///////////////////////////////////////////////////////////////////////////////
SCRIPT BRSemHomeBranch

// BR Semaphore Branch Home

extern float block_state ();
extern float route_set ();
extern float def_draw_state ();
extern float state;
extern float draw_state;
extern float enabled;

if (!enabled || // Not enabled/cleared to show natural state?
block_state() !=# BLOCK_CLEAR || // Block ahead not clear?
!route_set()) // Switch not set as per link?
(
state = SIGASP_STOP;
)
else
(
state = SIGASP_CLEAR_1;
)

// Get draw state
draw_state = def_draw_state (state);

///////////////////////////////////////////////////////////////////////////////

// End of File





Try copying the above text, The Bracket's were wrong. you have { when you should have ( . :)
Alan Heath
Why does DOS never Say Excelent Command or filename ?!!?!??
To Err is human, computers output the errors at higher speed.
User avatar
JohnEyres
Creating the WCML at Warrington
Posts: 511
Joined: Sun Dec 30, 2001 12:00 am
Location: Warrington
Contact:

Post by JohnEyres »

I think the brackets were right in the actual script file. Just the way it went when I pasted it. I will give it a try Alan.
Warrington Railways Route Author

Route Progress: http://johneyres.tripod.com/railway/msts/newms.htm
User avatar
johny
Very Active Forum Member
Posts: 2609
Joined: Fri Dec 07, 2001 12:00 am
Location: N. Warks, UK.

Post by johny »

{ } are block markers and are correct in John's example.

( ) are brackets for expressions.


The following is an exact copy and paste from the sigscr.dat file

///////////////////////////////////////////////////////////////////////////////
SCRIPT BRSemHomeBranch

// BR Semaphore Branch Home

extern float block_state ();
extern float route_set ();
extern float def_draw_state ();
extern float state;
extern float draw_state;
extern float enabled;

if (!enabled || // Not enabled/cleared to show natural state?
block_state() !=# BLOCK_CLEAR || // Block ahead not clear?
!route_set()) // Switch not set as per link?
{
state = SIGASP_STOP;
}
else
{
state = SIGASP_CLEAR_1;
}

// Get draw state
draw_state = def_draw_state (state);


// End of File




John
Technical Authors Do It Manually

#WolvesAyWe
TFormoso
Been on the forums for a while
Posts: 224
Joined: Thu Sep 19, 2002 3:30 pm

Post by TFormoso »

Is it possible that the editor you are using to paste in the script is causing SIGSCR.DAT to be a UNICODE file? (SIGSCR.DAT somehow escaped from the MS/KUJU standards and does need to be an ordinary ASCII text file).

You can Check this by opening your amended version in NOTEPAD. The file should appear as normal, if the text has the 'additional spaces' between characters it is UNICODE.

Tony
User avatar
johny
Very Active Forum Member
Posts: 2609
Joined: Fri Dec 07, 2001 12:00 am
Location: N. Warks, UK.

Post by johny »

Tony

You raise an interesting point.

The following is from the "How to edit configuration and scripting files" documentation supplied with MSTS:

"As with most other Train Simulator configuration files, a Unicode capable text editor like WordPad is required. Signal scripting files, however, are ASCII text format annd so can be edited in any text editor (e.g. Notepad)."

I have always used WordPad for both and have never experienced any difficulties, it does mean checking the save format box each time before saving. I can see an amendment to the readme file, drawing attention to this is necessary, in the new GWR kit to be released shortly.

John
Technical Authors Do It Manually

#WolvesAyWe
Locked

Return to “[MSTS1] Route Building”