Script Exceptions after Build 97556

boat

Active member
In Build 96000 I had a working set of ATLS with new script designed for streaming.

In 97556 the Slave falls over. But so do a lot of other things. Some sort of timing problem?

Not really expecting an answer but just making aware. Some of the errors I don't think were there in 96000...

SlaveTF : TrainzGameObject.GetAsset> invalid call to GetAsset() prior to Init(Asset) being inherited (file gs.gs)
Vehicle : TrainzGameObject.GetAsset> invalid call to GetAsset() prior to Init(Asset) being inherited (file gs.gs)
ACSlib : File acslib.gs, Line 204, ER_NullReference
Unknown : File jag_utils.gse, Line 960, ER_NullReference
Vehicle : TrainzGameObject.Init> Unable to call script initialiser for object with asset: <kuid2:79563:1185:3>
Vehicle : TrainzGameObject.Init> Unable to call script initialiser for object with asset: <kuid2:2512:2371:8>
Vehicle : TrainzGameObject.Init> Unable to call script initialiser for object with asset: <kuid2:79563:1226:2>
Vehicle : TrainzGameObject.Init> Unable to call script initialiser for object with asset: <kuid2:2512:15010:40>

Boat
 
Hi Boat
If these are your assets on the DLS then they all work fine in 97556. I just downloaded my ATLS advanced demo from the DLS and it all works with no problems.
 
Hi Stagecoach – No these are my new scripts, removing the obsolete calls. The DLS ATLS should work OK in TRS19 in Maximum Compatibility mode but it will probably run into trouble if you Stream routes.

Chris, OK, this is at the limits (or just over) of my amateur scripting knowledge. How do I find Callstack info?

Interestingly, the problem with the Slave is not there on a simple test route. The invisible train generates when it should and its all OK if ATLS is the only thing on the map.

These new problems seem to occur if ATLS is used on a big route which itself has several unrelated errors causing stack dumps. Then it doesn’t seem to be able to find the invisible train which is the asset GetAsset is trying to call above.

Not just my Slave though. I see Bloodnock’s ACSlib is also having issues. As his scripting is likely to be far better than mine, here’s his exception results...

ACSlib : File acslib.gs, Line 204, ER_NullReference

Vehicle : TrainzGameObject.GetAsset> invalid call to GetAsset() prior to Init(Asset) being inherited (file gs.gs)

<null-spec>

Stack dump:

function $void@GameObject::Exception(string), line -1
function $Asset@TrainzGameObject::GetAsset(), line 132
function $Soup@ACSlib::readACSfromCache(Vehicle,bool), line 204
function $void@ACSlib::compareVehicleCapabilities(Vehicle,Vehicle,bool,bool), line 323
function $void@ACSlib::findConnectedEnds(Vehicle), line 797
function $string@ACSlib::LibraryCall(string,string[],GSObject[]), line 824
function $void@Open::CheckCouple(int,bool), line 265
function $void@Open::VehicleDecoupleHandler(Message), line 145

As I say, a bit above my paygrade.... but my Slave was happy in 96000 even on big routes
 
Mike,

My ATLS crossings work as well, but with a big delay as if the gate logic is slow responding. As the trains, no matter how slow, pass through the crossings, the gates start flashing and putting the arms down when the train is about half way through the crossings. These worked fine in TS12, T:ANE, and previous versions of TRS19.

I may tweak my gate detection circuits and see if that helps by putting the triggers out a bit further from the crossing. These kinds of adjustments maybe needed to get around this.
 
I have spent some time on Trainz over the weekend and I find 2 problems which were working perfectly in 96000 but do not work in 97556.

1 - My script no longer loads an unloaded asset using World.GetGameObjectByID(GameObjectID,true);

2 - I am still getting loads of GetAsset() failures on a large route with many consists.


1)
I have a test route, (modified ECML) with a remote ATLS controller. In streaming mode the Controller is not expected to be loaded. The below script calls for the Controller to be loaded as required, (and posts to it).
PHP:
thread void PostTrigInfo(GameObjectID trigid,GameObjectID trainid,int channel,int scrroute, int mode) {
        int i;
        Message msg;
        for (i = 0; i < ControllerIds.size(); i++) { // To Controllers.
            if (Str.ToInt(Channels[i]) != channel) continue;
            AsyncObjectSearchResult searchObj = World.GetGameObjectByID(ControllerIds[i],true);
            Sniff(searchObj, "ObjectSearch", "AsyncLoadComplete", true);
            wait()
                {
                    on "ObjectSearch", "AsyncLoadComplete", msg:
                    if (msg.src != searchObj)  continue;
                    break;
                }
            NamedObjectInfo[] results = searchObj.GetResults();
            if (results.size()) GameObject obj = cast<GameObject> (results[0].objectRef);
            if (obj) PostMessage(obj, "newATLStrig76656","ATLS"+channel + "[" + scrroute +"~"+mode+"~"+trainid.SerialiseToString()+"~"+trigid.SerialiseToString()+"]",0.0f);
            }
     }

This script worked perfectly in 9600 but AsyncLoadComplete is never returned in 97556 Streaming.
Note the script works as it should in 97556 Compatibility mode. Integrity of ControllerIds is confirmed in both Compatibility and Streaming as 0,3,24049315,-365,-197,ATLS CONTROLLER TRS19 1.
I did try changing to World.SynchronouslyLoadGameObjectByID(mySavedID) but couldn’t get that to work either.

2)
I disabled the unrelated assets which were causing stack dumps on my large multi consist route but I still get ‘invalid call to GetAsset() prior to Init(Asset) being inherited (file gs.gs)’ on both my ATLS Slave and Bloodok’s acslib.gs.
Could this be due to a large number of consist on this route taking too long to initialise? I have well over 100 consists totalling probably nearly 1,000 vehicles.
I did not have ‘Show script Exceptions’ enabled on 96000 so maybe some of those were there then too. I didn't have it enabled because the ATLS Slave worked OK in 96000. Now it cannot Get the invisible train asset when used on this large route.

JCitron – John, thanks for that info. I thought I noticed some sluggishness too. When the above is sorted, I will look. Note that the above issues relate to my NEW atls script which I am still testing. The ATLS on the DLS should be OK in Compatibility mode.

ZikChil – I tried submitting a script bug report a few months ago on another issue but the Helpdesk Bug Reporting said they couldn’t assist with script issues and to use the forums.

So this is what I have found with 97556. I can only hope it is of interest.

Boat (Mike)
 
Thank you for the interesting update. Those object names in those functions are huge! Keeping track of those, is a job and half in its self.

Take your time sorting out the bigger things first. I can live with slow crossing gates and will assign a flagman and a maintenance to these sites to investigate. :)

Submit your bug report via the TRS19 bug report link here:

https://n3vgames.typeform.com/to/xRdryu

For the build version, you need to choose other and in the description and details put in the build number until Tony adds in the new 97556 build.
 
Last edited:
Thanks for the bug link John.

I've bugged the World.GetGameObjectByID(GameObjectID,true) issue but not the 'exception' one. The latter seems to be route dependent so difficult to reproduce. I will continue to investigate that one.

The non loading issue was there on another route too so maybe they can reproduce it.

Regards,

Mike
 
Back
Top