How to Configure Config.txt file to Use Two Script files?

majekear

Member
I understand that two .gs script files can be used on or in one asset. I have a Wellcar asset in which I use the Kuid2:45324:555246:5 Jointed Rail Train Effects Library v. 1.42 (which provides sounds for the car's coupling and uncoupling), but I also want to add a .gs script file that adds animated brake air hoses with sound as in like scriptfile.gs file (which is NOT a separate asset having a kuid number like the Jointed Rail effects library). I read the Trainz wiki on how to do this, but it might as well be written in another language for all the help it describes to me. I have NOT been able to find an existing asset that uses two scripts.
In the config.txt file I currently only have the Jointed Rail library script :

class "JRTraincar"
script "jr_traincar.gs"

Simply adding the other .gs script's name does not work. Any help will be appreciated. Thanks.
 
In the config.txt use:
Code:
class "MyClass"
script "myscript.gs"

In myscript.gs use
Code:
include "jr_traincar.gs"

class MyClass isclass JRTraincar
{
  #define your code here, and don't forget to use inherited(), where required
};

Peter
 
p-dehnert thanks, but unfortunately for me I am not completely understanding your solution. The actual name of my .gs script file is "gatx_oilco.gs". So if I follow your instructions I would place in the config.txt file the tags:

class "gatx_oilco"
script "gatx_oilco.gs"

then in the gatx_oilco.gs file, I would edit in

include "jr_traincar.gs"

class gatx_oilco.gs isclass JRTaincar

{ I am not sure what I am to write in code here, unless you means the rest of the original gatx_oilco.gs code

}:

More help please..........
 
Back
Top