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.
2023-04-27 18_37_50-Greenshot.jpg
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.
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
Posted 27 April 2023 - 07:40 PM