Forcing Trainz to accept a locally edited script

frogpipe

Yesterdayz Trainz Member
This relates specifically to DefaultLocomotiveCabin.gs, and an attempt by me to correct a bug.

The .GS version is in C:\SteamLibrary\steamapps\common\Trainz Railroad Simulator 2019\resources\scripts
The .GSL version is in C:\SteamLibrary\steamapps\common\Trainz Railroad Simulator 2019\resources\prebuilt\libraries

I thought it would be a simple matter, to change a conditional statement - save the .gs file - compile a .gsl file from that - and place them in the correct directories.

Trainz however complains. From the log:

! <kuid2:175455:100373:1> : SpecsManager GSMachine::GetLibrary> library '0x41627767 0x4DA794FB' not found in link table (defaultlocomotivecabin.gs)

That is one of numerous examples, and it seems my DefaultLocomotiveCabin has a different number that 0x41627767. I did an extended database rebuild, but that did not fix it (made it worse in fact as numerous assets failed because DefaultLocomotiveCabin was not available.

I'm now attempting 'TrainzUtil --force --nofail' but while it's still running right now, it's already thrown errors that tell me it too will not "solve" this.

I AM NOT ASKING HOW TO RESTORE MY GAME - I made backups and if I give up I'll put them back.

What I AM asking is, Is there anyway to force trainz accept my edited DefaultLocomotiveCabin script? OR is this simply locked down to prevent end user tampering?
For those who might be curious, here's what I changed around line 265:
Code:
/*
        if (wheelslip_light)
            wheelslip_light.SetValue(loco.GetEngineParam("wheelslip"));
*/
        // T.E.T. frogpipe
        Interface.Print("frogpipe");
        if (wheelslip_light)
            if (loco.GetEngineParam("wheelslip") != 0)
                wheelslip_light.SetValue(1);
            else
                wheelslip_light.SetValue(0);
        // end T.E.T. frogpipe
 
Write your own script that sub classes DefaultLocomotiveCabin and then override Update(). Within your own Update() just call inherited() first and then do what you want with the wheel slip.

N3V (Chris) once told me that changing any of those scripts in the library will likely break Trainz. For each Trainz version I take a copy of all those scripts and place them somewhere when I can look at them without risk of inadvertently changing them. The information in those scripts is always more up to date than the WiKi.
 
Truth about the info for sure.

I know how to do it per asset, I was trying for a global fix. Seems to be not possible tho - trainz simply won't accept an edited version.

Too bad. I'll just have to wait I guess, even tho that simple change would fix the issue. :(
 
Oh I did. And was asked to submit additional materials, so I know they are taking a look.

I just know that adding a ">0" to a conditional statement will fix it and I'm impatient. LOL.

Meanwhile I edited the cabs I care about and added the appropriate code to compensate. I just wanted to try a "one and done" fix.
 
Back
Top