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

Jump to content

Page 1 of 1
  • 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 

  • Foreman Of Engines
  • Group: Posts: Contributing Member
  • Posts: 814
  • 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 

  • Executive Vice President
  • Group: Status: First Class
  • Posts: 3,187
  • 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 

  • Foreman Of Engines
  • Group: Posts: Contributing Member
  • Posts: 814
  • 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 

  • Executive Vice President
  • Group: Status: First Class
  • Posts: 3,187
  • 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 

  • Executive Vice President
  • Group: Status: First Class
  • Posts: 3,187
  • 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
  • PipPipPipPipPipPipPipPip
  • Group: ET Admin Group
  • Posts: 2,146
  • 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 

  • Foreman Of Engines
  • Group: Posts: Contributing Member
  • Posts: 814
  • 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 

  • Executive Vice President
  • Group: Status: First Class
  • Posts: 3,187
  • 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 

  • Foreman Of Engines
  • Group: Posts: Contributing Member
  • Posts: 814
  • 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
  • PipPipPipPipPipPipPipPip
  • Group: ET Admin Group
  • Posts: 2,146
  • 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/

#11 User is offline   Traindude 

  • Foreman Of Engines
  • Group: Posts: Contributing Member
  • Posts: 814
  • Joined: 17-November 13
  • Gender:Male
  • Location:Seattle, WA
  • Simulator:Open Rails
  • Country:

Posted 27 April 2023 - 10:40 PM

View Postengmod, on 27 April 2023 - 07:40 PM, said:

Notepad++ is not the easiest tool to use.

I use jedit.

http://www.jedit.org/


Couldn't get it to work properly. It says it needs a Java package in order to run, but after downloading the Java package, I didn't know how to install it, so I couldn't get it to work at all.

I'll stick with PSPad for now...

#12 User is offline   scottb613 

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

Posted 28 April 2023 - 03:10 AM

Hi Folks,

If you're still having issues - I would suggest - keeping the comment format to single line entries as you did in the beginning of your file. If you need multiple lines - comment each one. I think the multiline comments are throwing off the parens checking. Indent and place the parens - consistently. It's all about keeping track of the parens and a nice clean formatted uniform ENG/WAG file goes a long way towards that goal.

When troubleshooting - start big and work small - there are two parts to the ENG - the Wagon and Engine section - I usually start checking the parens on these blocks - typically - if they are good - that means there's a good chance everything below them is good.

Here's an example of one of mine (Steam Physics) that works. I've tried to remove all the old stuff from MSTS that doesn't get used in ORTS. FYI: I'm pretty sure - unless something has changed since I last looked - only a single coupler block is used in ORTS. I do a great deal of testing and the file seems to work pretty well. When creating physics for a new locomotive - I usually start with my boiler plate example and just plug in the values for the new locomotive.

Example:
Attached File  BM482A.zip (3.48K)
Number of downloads: 129

Hope this helps.

Regards,
Scott

#13 User is offline   Hobo 

  • Foreman Of Engines
  • Group: Posts: Contributing Member
  • Posts: 992
  • Joined: 19-December 04
  • Gender:Male
  • Location:Paris,Ont- Canada
  • Simulator:OPEN RAILS & MSTS
  • Country:

Posted 28 April 2023 - 08:03 AM

I've used " Context " and the " Contexta " plugin which has a " chi " for MSTS , successfully for many years ..

It's a great file editor , reads anything , easy setup and excellent options for ever preference .


Just a Thought !

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