System Arithmetic Exception with Steam Engine
#1
Posted 27 April 2023 - 01:58 PM
#2
Posted 27 April 2023 - 02:42 PM
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.

Regards,
Scott
#3
Posted 27 April 2023 - 03:16 PM
scottb613, on 27 April 2023 - 02:42 PM, said:
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.

Regards,
Scott
I downloaded Notepad ++ and it didn't detect any bad braces.
#4
Posted 27 April 2023 - 03:22 PM
Traindude, on 27 April 2023 - 03:16 PM, said:
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:

Regards,
Scott
#5
Posted 27 April 2023 - 03:27 PM
Traindude, on 27 April 2023 - 03:16 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
#6
Posted 27 April 2023 - 03:33 PM
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
Posted 27 April 2023 - 03:43 PM
scottb613, on 27 April 2023 - 03:27 PM, said:
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?
engmod, on 27 April 2023 - 03:33 PM, said:
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
Posted 27 April 2023 - 03:57 PM
#9
Posted 27 April 2023 - 06:18 PM
scottb613, on 27 April 2023 - 03:57 PM, said:
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.

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
Posted 27 April 2023 - 07:40 PM
#11
Posted 27 April 2023 - 10:40 PM
#12
Posted 28 April 2023 - 03:10 AM
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:

Number of downloads: 129
Hope this helps.
Regards,
Scott
#13
Posted 28 April 2023 - 08:03 AM
It's a great file editor , reads anything , easy setup and excellent options for ever preference .
Just a Thought !