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?
Sigscr script error
Moderator: Moderators
- johny
- Very Active Forum Member
- Posts: 2609
- Joined: Fri Dec 07, 2001 12:00 am
- Location: N. Warks, UK.
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
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
#WolvesAyWe
- 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
///////////////////////////////////////////////////////////////////////////////
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 ( .
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.
Why does DOS never Say Excelent Command or filename ?!!?!??
To Err is human, computers output the errors at higher speed.
- johny
- Very Active Forum Member
- Posts: 2609
- Joined: Fri Dec 07, 2001 12:00 am
- Location: N. Warks, UK.
{ } 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
( ) 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
#WolvesAyWe
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
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
- johny
- Very Active Forum Member
- Posts: 2609
- Joined: Fri Dec 07, 2001 12:00 am
- Location: N. Warks, UK.
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
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
#WolvesAyWe