Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Thanks for all your help in trying to get this problem solved.I'm taking a look at the ACSLib exceptions to see if I can knock up a workaround for them, but it's taking longer than I hoped. Just wanted to let you know I'm not ignoring this thread, just won't be able to reply with the response I want to until I've finished a little debugging![]()
Thanks for all your help in trying to get this problem solved.
Nathan
Personally, I'm of the mindset that errors should be headed off, so when you write a function that takes a vehicle as a parameter, if the parameter is null then you should bail out of that function at that point, as nothing you can do will result in anything good. Sadly auran's script writer and many other script writers haven't taken that route - largely due to the fact that until recently script errors were silently ignored, I suspect.
void findConnectedEnds (Vehicle callingVehicle) {
Train cvTrain = callingVehicle.GetMyTrain();
Vehicle[] cars = cvTrain.GetVehicles();
void findConnectedEnds (Vehicle callingVehicle) {
if (callingVehicle == null) return;
Train cvTrain = callingVehicle.GetMyTrain();
Vehicle[] cars = cvTrain.GetVehicles();
} else {
if(wasVehicleCoupled(callingVehicle, !callingVehicle.GetDirectionRelativeToTrain(), false)) {
// investigate vehicle in front
} else {
if (cars[cvIndex-1] == null)
return;
if(wasVehicleCoupled(callingVehicle, !callingVehicle.GetDirectionRelativeToTrain(), false)) {
// investigate vehicle in front
} else {
if(wasVehicleCoupled(callingVehicle, callingVehicle.GetDirectionRelativeToTrain(), false)) {
// investigate vehicle behind
} else {
if (cars[cvIndex+1] == null)
return;
if(wasVehicleCoupled(callingVehicle, callingVehicle.GetDirectionRelativeToTrain(), false)) {
// investigate vehicle behind
I do hope this is the last problem and I really appreciate the time you are spending on this.
Scottish
class class222 isclass Vehicle {
class class222 isclass Locomotive {
This is, I think, because the config defines "engine 1" and, since TS2009, Trainz won't allow a vehicle script class with what is essentially a locomotive - or powered coach if you prefer
The fix is to open the class222.gs script file and change the line
toCode:class class222 isclass Vehicle {
This is essentially the same thing that stops Andi06 coaches from working in TS2010 Native, except in that case you need to change the script class from Locomotive to Vehicle.Code:class class222 isclass Locomotive {