NON FATAL SCRIPT ERROR

tomurban

New member
I am using Trainz 2006 and have become fairly adept at repairing broken assets and missing dependencies. However, I recently downloaded a Tank Car UTLX 67544 LARS (kuid2:56063:150601:2) from the DLS. When placing this car on a route followed by a driving session I get the following non fatal error message before and after the route loads into driver. CMP shows it as being not faulty.

* beginning of error message
Thread Exception ER NullReference, line 1326, file

Stack dump;

function $Permit[]@Train::TakePermitOnTrack(bool), line-1
function $void@Train::Init0, line 1397


continue or abort
*end of error message


Author Rene N. Steinkamp


In addition to the non fatal error, the car will not accept loads.


My question? : Can I fix what is causing the error or is it something that the creator has to do? NOTE: When I try to edit script in CMP, it tells me "No script found"

Any assistance is greatly appreciated.

tomurban
 
Last edited:
If you want to edit the script, open the asset in Explorer, then open the .gs file in your text editor (I like ConText because it has a TrainzScript template).
I was somewhat successful in editing the script of one asset, but then ended up e-mailing the CC and got his help.

Good luck

FW
 
Thank you for your reply FW, but I need to know what the error message means and what changes/corrections are needed in order to eliminate the message from appearing each time. Any ideas or suggestions?

tomurban
 
When I am troubleshooting an asset that has given me such an error, I always look at the jetlog file to see what was going on when the error was encountered. In your case it appears that the command on line 1326 or possibly the preceeding line has a null reference when the software expected something else. Open the .gs code file and look at what was going on at line 1326. With a little detective work, you may be able to figure out why there is a null rather than valid data.

If you are not familiar with .gs code (which looks a bit like C++), you might not be able to make sense of anything. If there is no .gs file but there is a .gse file, it is a compiled file and you will not be able to look at it.

Happy Hunting for the bug.
 
To FW ad Dap. Thanks for your assistance gentlemen. Problem solved. The error message was caused by the lack of a .gs file in the vehicle folder. When I found this was the problem, all I had to do was copy and paste the .gs file referenced in the problem vehicle's config. file from a similar built in item. Bingo, no more script error. I am sure they are not all that easy to solve.

Regards, tom
 
Last edited:
Just downloaded a diesel locomotive and received a script error message similar to the above. The fix was the same. Copy and Paste the needed .gs file into the problem engines folder. It took me over a year to find this relatively simple fix since performing a forum search did not turn up much concerning script errors.

tomurban
 
How do you do that? I copied the Metro North M7a/ b cars along with the ACMU, FL9, and Metro North engines. (The other one is in a New Haven color scheme.) I tried copying other cabs to them , but they just didn't work. I looked at the .gs file, copied everything and pasted, and I still get that nonfatal script error when I click on either the ACMU or the M7a/b cars.
 
How do you do that? I copied the Metro North M7a/ b cars along with the ACMU, FL9, and Metro North engines. (The other one is in a New Haven color scheme.) I tried copying other cabs to them , but they just didn't work. I looked at the .gs file, copied everything and pasted, and I still get that nonfatal script error when I click on either the ACMU or the M7a/b cars.

You first have to open the config file in notepad using open for edit in CMP. The file name for the pasted script file must be exactly the same as the script listed in the items config file including quotation marks. Paste, then save the file and commit in CMP. If you don't do this the config file will not recognize the newly pasted script file (gs) and the script error remains. Quite simple once you get the hang of it.

Regards, tomurban
 
Last edited:
I followed your instructions. However, I ended up having to uninstall and re-install the game. I gave up trying to fix the problem.
 
I followed your instructions. However, I ended up having to uninstall and re-install the game. I gave up trying to fix the problem.

I found the script (.gs) files to be item specific. Meaning that to fix a tank car for example, you need to use the .gs file from a working tank car. Same holds for Diesel Engines, box cars. etc. Give me a specific kuid # that is giving you trouble and I will have a go at it.

tomurban
 
I have six kuids that gave me trouble. They are:

1)kuid 523:10062
2)kuid 523:762762
3)kuid2:126323:54012:1
4)kuid 523:100953
5)kuid1: 42004229
6)kuid -13:174001
 
OK: I will take a look at the above and let you know.

tomurban

These kuids relate to the built in Metro North cars. I installed them on one of my routes and they all installed error free in TRS2009 and without any script errors. However, I did not open them for editing. When you do that to a built in item (open for edit) and then recommit, you can introduce many errors that were previously hidden and that was probably the source of your original problem.The best solution in that case, assuming the majority of files are still intact is to (in CMP) open the item for edit and then click on "revert to original". Editing of built in items is not recommended. If you want to modify a built in item make a clone of the item. If the clone gets messed up in the process you can delete the clone and start over. Hope this helps.

tomurban
 
Last edited:
I modified the built-in items(Metro North M7A/B cars, NH-Metro North engines.) Guess what? As I started the game, it stalled for over an hour. It just sat there motionless all day. I pressed control+alt+delete. The task manager said : Jet[OpenGL 3.4] Not Responding. Again, I had to uninstall and rei-install the game. It din't work for me. That's it.
 
I modified the built-in items(Metro North M7A/B cars, NH-Metro North engines.) Guess what? As I started the game, it stalled for over an hour. It just sat there motionless all day. I pressed control+alt+delete. The task manager said : Jet[OpenGL 3.4] Not Responding. Again, I had to uninstall and rei-install the game. It din't work for me. That's it.

I repeat

Editing of built in items is not recommended. If you want to modify a built in item make a clone of the item. If the clone gets messed up in the process you can delete the clone and start over. Hope this helps.
 
Last edited:
I Gave Up

I repeat

Editing of built in items is not recommended. If you want to modify a built in item make a clone of the item. If the clone gets messed up in the process you can delete the clone and start over. Hope this helps.

I have since gotten rid of both Trainz 2006 and Trainz Classics 1&2.:(:n:
 
Back
Top