Elvas Tower: System Arithmetic Exception with Steam Engine - Elvas Tower

Jump to content

  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

System Arithmetic Exception with Steam Engine Rate Topic: -----

#1 User is offline   Traindude 

  • Engineer
  • Group: Status: Contributing Member
  • Posts: 668
  • Joined: 17-November 13
  • Gender:Male
  • Location:Seattle, WA
  • Simulator:Open Rails
  • Country:

Posted 27 April 2023 - 01:58 PM

After modding the CTN Duke of Gloucester with some new features, the game crashes immediately upon the start of an activity. This is with U2023.04.25-1821.

#2 User is offline   scottb613 

  • Vice President
  • Group: Status: First Class
  • Posts: 2,973
  • Joined: 06-July 09
  • Gender:Male
  • Location:Downeast Maine (soon)
  • Simulator:ORTS
  • Country:

Posted 27 April 2023 - 02:42 PM

Hi...

I think your parens are messed up in the ENG file. I didn't go through it thoroughly - but Notepad++ does parens matching - red (in my scheme) indicates missing parens pair.

The very last one is missing a match as well as the one against the margin above it under [waterscoop].

Your Engine Controller section looks like it has an extra one in it.


Attached Image: 2023-04-27 18_37_50-Greenshot.jpg


Regards,
Scott

#3 User is offline   Traindude 

  • Engineer
  • Group: Status: Contributing Member
  • Posts: 668
  • Joined: 17-November 13
  • Gender:Male
  • Location:Seattle, WA
  • Simulator:Open Rails
  • Country:

Posted 27 April 2023 - 03:16 PM

View Postscottb613, on 27 April 2023 - 02:42 PM, said:

Hi...

I think your parens are messed up in the ENG file. I didn't go through it thoroughly - but Notepad++ does parens matching - red (in my scheme) indicates missing parens pair.

The very last one is missing a match as well as the one against the margin above it under [waterscoop].

Your Engine Controller section looks like it has an extra one in it.


Attachment 2023-04-27 18_37_50-Greenshot.jpg


Regards,
Scott


I downloaded Notepad ++ and it didn't detect any bad braces.

#4 User is offline   scottb613 

  • Vice President
  • Group: Status: First Class
  • Posts: 2,973
  • Joined: 06-July 09
  • Gender:Male
  • Location:Downeast Maine (soon)
  • Simulator:ORTS
  • Country:

Posted 27 April 2023 - 03:22 PM

View PostTraindude, on 27 April 2023 - 03:16 PM, said:

I downloaded Notepad ++ and it didn't detect any bad braces.


Hi.

Let me check - I thought it was on by default - I haven't changed my config in years.

This feature also helps when you indent consistently - it has a vertical highlight line to define the block contained in the parens. It really helps when working on code.


Example:
Attached Image: 2023-04-27 19_18_25-Greenshot.jpg


Regards,
Scott

#5 User is offline   scottb613 

  • Vice President
  • Group: Status: First Class
  • Posts: 2,973
  • Joined: 06-July 09
  • Gender:Male
  • Location:Downeast Maine (soon)
  • Simulator:ORTS
  • Country:

Posted 27 April 2023 - 03:27 PM

View PostTraindude, on 27 April 2023 - 03:16 PM, said:

I downloaded Notepad ++ and it didn't detect any bad braces.


Hi.

Without debugging your entire file - you definitely have an extra paren on line 437.

You have to actually click on the paren - one at a time - to see if it's missing a match.

Regards,
Scott

#6 User is offline   engmod 

  • Open Rails Developer
  • PipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 1,791
  • Joined: 26-February 08
  • Gender:Male
  • Location:Eltham, Victoria, Australia
  • Simulator:ORNYMG
  • Country:

Posted 27 April 2023 - 03:33 PM

>Warning: When expecting a number, we found a ) marker. Using the default 0 in F:\MSTS Stuff\Train Simulator\trains\trainset\~CTN-71000-Loco-Test\openrails\~CTN-71000-Advanced.eng:line 2
This is puzzling as line 2 is blank and the first brace is on line 3

>ORTSAuxilaryResCapacity ( 0.00ft^3 )
This might upset something? something other that zero would be good.

>Warning: Found a suffix 'lb/hr' which could not be parsed as a MassRateDefaultLBpH unit in F:\MSTS Stuff\Train Simulator\trains\trainset\~CTN-71000-Loco-Test\openrails\~CTN-71000-Advanced.eng:line 2
The first occurrence of lb/hr is on line 368, so something is VERY confused.

We need to understand why the parser is lost?

#7 User is offline   Traindude 

  • Engineer
  • Group: Status: Contributing Member
  • Posts: 668
  • Joined: 17-November 13
  • Gender:Male
  • Location:Seattle, WA
  • Simulator:Open Rails
  • Country:

Posted 27 April 2023 - 03:43 PM

View Postscottb613, on 27 April 2023 - 03:27 PM, said:

Hi.

Without debugging your entire file - you definitely have an extra paren on line 437.

You have to actually click on the paren - one at a time - to see if it's missing a match.

Regards,
Scott




I went to line 437 and the extra bracket (colored green in the image above) does have a match on line 428.
I also ran the Bracket Match plugin and it too says the file was a-ok...


So...now what?

View Postengmod, on 27 April 2023 - 03:33 PM, said:

>Warning: Found a suffix 'lb/hr' which could not be parsed as a MassRateDefaultLBpH unit in F:\MSTS Stuff\Train Simulator\trains\trainset\~CTN-71000-Loco-Test\openrails\~CTN-71000-Advanced.eng:line 2
The first occurrence of lb/hr is on line 368, so something is VERY confused.

We need to understand why the parser is lost?


That occurence of lb/hr on line 368 is within a comment bracket so ORTS should ignore it. IDK what's going on.

If it is of any help, the crash was accompanied by the following message:


#8 User is offline   scottb613 

  • Vice President
  • Group: Status: First Class
  • Posts: 2,973
  • Joined: 06-July 09
  • Gender:Male
  • Location:Downeast Maine (soon)
  • Simulator:ORTS
  • Country:

Posted 27 April 2023 - 03:57 PM

Hi...

I don't know if you have those comments right - you're trying to comment out [Brake_Engine] - because that's what your image shows?

Here is what I get is you're splitting your [EngineControllers] block in half. The yellow parens are matching pairs and that's wrong.


Attached Image: 2023-04-27 19_53_33-Greenshot.jpg


Regards,
Scott

#9 User is offline   Traindude 

  • Engineer
  • Group: Status: Contributing Member
  • Posts: 668
  • Joined: 17-November 13
  • Gender:Male
  • Location:Seattle, WA
  • Simulator:Open Rails
  • Country:

Posted 27 April 2023 - 06:18 PM

View Postscottb613, on 27 April 2023 - 03:57 PM, said:

Hi...

I don't know if you have those comments right - you're trying to comment out [Brake_Engine] - because that's what your image shows?

Here is what I get is you're splitting your [EngineControllers] block in half. The yellow parens are matching pairs and that's wrong.


Attachment 2023-04-27 19_53_33-Greenshot.jpg


Regards,
Scott


Yes, I am disabling the engine brake. When I disable something in a *.wag or *.eng file, I enclose the parameters in comment tags (instead of completely deleting the code in question) so that I can easily re-enable it if I want to (all that's needed is deleting the comment tags and their brackets).

EDIT: Okay, a few more tests and if I relocated the comment tags to avoid "a comment within a comment", it still crashed. But if I re-enable the engine brake by deleting the comment tags, it works perfectly. So my method of "commenting out" features I want to disable does not always work in all cases.

In any case, how can I configure Notepad ++ to find these "bad brackets" that it somehow does not currently detect? I'm using version 8.5.2 (64-bit).

#10 User is offline   engmod 

  • Open Rails Developer
  • PipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 1,791
  • Joined: 26-February 08
  • Gender:Male
  • Location:Eltham, Victoria, Australia
  • Simulator:ORNYMG
  • Country:

Posted 27 April 2023 - 07:40 PM

Notepad++ is not the easiest tool to use.

I use jedit.

http://www.jedit.org/

  • 2 Pages +
  • 1
  • 2
  • 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