Portal script error

cgwright

New member
Hello

I have a layout that uses portals to spawn and consume trains. The ones that produce trains just do that, and the ones that consume do not produce. This is TS10.

This normally works fine, but occasionally I get a script error, and one of the consuming portals stops working. The red button appears at bottom right, and when I click it I get the following information:

PortalTunnel: ThreadException: ER_NullReference, line 405, file portaltunnel.gs (1)

If I press the "More" button:

ThreadException: ER_NullReference, line 405, file portaltunnel.gs
Stack Dump:
<kuid:-3:10192> "Portal"
function$void@ProtalTunnel::ConsumeTrain(Train,Vehicle), line -1

If I look at the portal - I have to search to find which one has broken - there is a train derailed in the portal, and the driver is still on the list with an exclamation point on his/her face. The signals before the portal remain red, so no further trains will go that way.

This happens randomly in a session, sometimes not at all, otherwise at some point in the session one portal crashes in this way, it can be any one of the portals.

I just wondered if anyone else has seen this type of script error and if there is a work round for it. It is annoying, because when it occurs, it invariably results in the session becoming unplayable.

Thanks in anticipation.
Chris
 
Yep. One thing I found with my bi-level push-pull commuter trains is that an AI train has to enter a portal with the same locomotive on the lead that it spawned with or it will derail and throw script errors. For that reason I can't spawn a commuter with an E8 or F7 on the lead, run it out to the suburbs, then reverse and run back into the city, entering the downtown destination portal with the cabcar first. Also can't do way freights with a car or two coupled ahead of the engine. Workaround for the commuter is to either do out-back-out again going headfirst into the portal out in the suburbs, or have a switchback near the destination portal so it enters the portal headfirst instead of backing into it. For way freights you would have to have it uncouple the cars ahead of the engine and run around so it enters the portal engine first instead of with a car on the lead.
 
I get it randomly, usually after about 2-3 hrs. But nothing appears, it just fails to emit.
My portals spawn at 45 min intervals and I save in session, so I just re start from the last save.
Your solution I think is to use the delete derailed consist ( or similar named).
 
Back
Top