Can someone explain this red bug please?

AntonyVW

Active member
Im trying to learn how to use the path rule. I have one path set up with 2 yards. When one of the yards (not sure which one at this point), is triggered it gives me a red bug with the following script:

Thread Exception: ER_NullReference, line 299, file path.gse


Stack dump:


function $void@Path::lock_path(ExtPermit), line -1
function $int@Path::set_path(Train), line 464
function $bool@PathCommand::lock_path(), line 118
function $bool@PathCommand::init(int,Path,Train,Trackside), line 84
function $PathCommand@PathCommandMap::create_command(Path,Train,Trackside), line 341
function $PathCommand@PathCommandMap::create_command(Path,Train), line 332
function $string@CreatePathCommand::execute(string[],GSObject[]), line 1215
function $string@LibFunctions:Process(string,string[],GSObject[]), line 97
function $string@PathLibrary::LibraryCall(string,string[],GSObject[]), line 184
function $string@PathLibrary::call(string,string[],GSObject[]), line 122
function $PathCommand@PathLibrary::create_command(Path,Train), line 269
function $bool@PathCustomCommand::Execute(Train,int,int,int), line 48
function $void@Train::RunSchedule(Schedule,bool,float), line 1955


Anyone able to explain to me in simple terms what is happening and how to correct it please? Thank you.
 
Hi AntonyVW

Which Path Rule are you using (there are two of them)? One is by brummfondel from the DLS and the other one is built in and is by _mutton_ . I am afraid that scripting is a bit beyond me but looking at the message I think that there is a problem with the way that you have set it up and used it.

Have a look at this thread and the other one which is linked from it in post #1

http://forums.auran.com/trainz/show...f-DAP-regarding-Path-Rule&highlight=path+rule

I have a session for the ECML route on the DLS which uses the _mutton_ rule and if you have a look at how it is set up and used it may help you get to grips with it. It's the only thing I have on the DLS so just search for my username. Apart from the odd rule or two it uses built in content from TS12 SP1 HF3 and so should only take a few seconds to download.

If you have any further problems just post back and I'll try to help.

Regards

Brian
 
Hi Brian. The red bug came while using the built in rule. Though before I go to far with this Im pretty sure its my implementation of the rule. Ive tried following the notes about it but it doesnt really go into issuing the commands and what needs to be done along with it. What Im hoping to do is set up the rule on a non-moving loco so that as a player driven one passes triggers it will set the lights and junctions correctly. Assuming of course this is possible - which I assum is from another post elsewhere.

Edit: But first I need to get it working with an AI loco I think.
 
Last edited:
I finally got the path rule to work correctly. The red bug was simply as a result of one junction being set incorrectly along the path. However I wanted to compare Brummfondels as it offers slightly more options. However despite setting it so that it reflected the path rule I get the following red bug error:

Thread Exception: ER_NativeCallError, line -1, file pathcontrol_lib.gse


Stack dump:


function $void@GameObject::SendMessage(GameObject,string,string), line -1
function $string@PathControl_lib::LibraryCall(string,string[],GSObject[]), line 1034
function $string@PathControlLibrary::call(string,string[],GSObject[]), line 74
function $int@Path::queuePath(), line 119
function $bool@setpath_Custom::run(Train), line 58
function $bool@setpath_Custom::Execute(Train,int,int,int), line 85
function $void@Train::RunSchedule(Schedule,bool,float), line 1955

Im sure its going to be something simple Ive not yet done but it is not something Ive done before so Im pretty sure its me that is causing the problem not the rule.

Edit: I note from checking the line when the red bug appears, that it is not setting the first 2 junctions. Not sure if that is of any help?
 
Last edited:
Hi again

Are all the signals named along the path as the brummfondel rule requires this to be the case? This is why I didn't use the brummfondel rule in my session as there is an unnamed signal just inside the King's Cross end of the Gasworks Up Main tunnel. I don't understand what the error is telling us but it is obviously to do with the PathControl Library which suggests a problem with the way it is set up. Are you using your own route or is it built in or on the DLS? If it's either of the latter then let me know what it is and I'll have a look at setting a path or two up for you so that you can see how I've done it.

Setting it up is much the same as the _mutton_ rule but I find it easier and quicker to use as it finds the junctions along the path for you. I also prefer it because of the Path Trigger rule that can be used in conjunction with it which makes programming AI trains very quick and simple.

Regards

Brian
 
Hi Brian,
This is a route Im attempting to build myself. If you look at the following website: http://www.roscalen.com/signals/DroitwichSpa/ - you will see at the bottom of the page the layout for the signals and junctions. The path Im trying to build starts on the right at the station with the first signal being DS10. From this signal it takes the right hand line at the points (which I have call DSD1) - upto the next signal (DS9) where it takes the left line at the junction (DSD3) to signal DS15 and on to DS16. It should be fairly simple I know and as Ive managed to get this working with the built in path rule I cant figure out why its failing with Brummfondels rule.
I have checked all the signals on thie route of the path rule and all are correctly named. Do I also have to name the signals and junctions that are not on the route of the rule?
 
Ok I am now certain it is not me doing it wrong. I set up a test track with just 1 junction and 2 signals. As soon as the path control was called up it gave a red bug with the following error:

Thread Exception: ER_NativeCallError, line -1, file pathcontrol_lib.gse


Stack dump:


function $void@GameObject::SendMessage(GameObject,string,string), line -1
function $string@PathControl_lib::LibraryCall(string,string[],GSObject[]), line 1034
function $string@PathControlLibrary::call(string,string[],GSObject[]), line 74
function $int@Path::queuePath(), line 119
function $bool@setpath_Custom::run(Train), line 58
function $bool@setpath_Custom::Execute(Train,int,int,int), line 85
function $void@Train::RunSchedule(Schedule,bool,float), line 1955
 
Hi Stagecoach, Ive tried following what is on the website already. Its full of useful information but unfortunately does not help to solve my problem.. Not being able to solve it on my route I decided to set up a test track asI said it has 2 signals and one junction by the first signals. The second one was placed just to allow the signal to operate correctly. however even though I can get this to successfully work with the built in path rule, I cannot seem to get it to do the same with Brummfondels. Im just stumped as to why it wont do it. Clearly Im missing out one something quite simple - and I shall kick myself when i find it - but I just cant figure out why Im getting the red bug error.
 
Ok I have further reduced the test track to 1 signal and 1 junction. I placed a buffer at the end of each line and tried again. Even changing the signal from semaphore to colour light did not stop the red bug coming up. I have also tried deleting the asset and reinstalling it but still get the same red bug.
 
Hi Antony

I have built the route as shown in the plan on the website and named the signals as shown and the junctions as you have mentioned. The brummfondel rule works perfectly without any errors. You are using the "PathControl setpath" and "Autopilot" driver commands to set the path and drive the train aren't you?

If you can send me an e-mail I'll reply with this test route and session attached so you can compare the way that I have set it up with what you are doing.

Stagecoach: You do have to name all the signals along the path in TS12 as, when entering the path, it can't see any junctions behind un-named signals. I left a signal un-named on the test route in order to check this and I was unable to enter the path behind the un-named signal. Perhaps 2010 acts a little differently to 2012 with this rule.

Regards

Brian
 
Hi Brian
I have tried to send you a pm but it tells me you have to many messages there.
I have used both the "autodrive" and "pathcontrol setpath". The only thing I can think of at present is that my files are corrupt. So I will try deleting them again and re-downloading them. Other than that Im stumped, particulaly as I have made a test track with just the one signal and one junction and it still fails.
 
Hi Brian. Thanks for the test track. A couple of things I want to mention.
First if I load the session up and run it it works as it should. However if I open the session in surveyor and then try to run the session - I get the red bug. I have no idea why and this is down to my not understanding why there should be a difference.
second. Having used your example on my own route I now get the same results as above. This is a step forward as now I only have the red bug when going from surveyor to run session. No red bug when just running the session.

The only other issue I now have with that is on my route train 2 goes via the loop not straight up the main track. I suspect this might be the signal type I'm using or something equally simple to solve like track mark in wrong place etc.

As for the trigger - I shall attempt that once I have the basics running. Thanks again.
Antony
 
Hi Antony

I've just tried going straight into driver from surveyor and it produced the same error that you are getting. The reason that I haven't seen this error before is that I always close surveyor before opening driver. Going directly from surveyor to driver sometimes caused problems in earlier versions of Trainz and I just got into the habit of never doing it.

Looking at the error, my guess is that the path library is having problems initialising when using the shortcut from surveyor. At least you know how to avoid it now.

Regards

Brian
 
Hi All of you!
Thanks to this thread /conversations I found also the solution on ( I quess) the same error. I've spent many days dealing with the Pathcontrol rule on a simpel test route and every time I received the bug beatle with the cryptic error message. Tried all the hints you mentioned here and at least the hint to go NOT direct to the drive mode from the editing mode but save all the changes en start from the menu solved also my problem. Anyhow: in the test route. Now I can go for the real work. Rotterdam Central Station 4 tracks switching to 15 platforms. In AI mode it is a disaster.
Thanks to all of you

Frans
 
Back
Top