Adding start up/shut down feature onto any diesel

Hi Guys,

Yes I know that encrypted scripts or un-editable loco files do not allow you to learn how to do things. I have had to make my own system, I use the B key to start and stop my locomotives.

Download my model Green Goat GG20B Railpower,<kuid2:60238:9779:1>

It has a script to start and stop the engines.

1. You need to modify the engine sound file to use a silent idle 1.wav file;

2. You provide a start up sound and a stop (wind down) sound in the main loco file;

3. You also need to use the original idle 1.wav sound from the engine sound asset, (I called it engine.wav in my model), place it in the main engine directory. This is the engine sound when the loco is not moving after you have started it up;

4. The script requires that you call up the engine.wav sound from the config file for the loco;

5. In the model there seems to be a couple of old sound files that I forgot to take out (engine_old.wav and idle 1.wav), these are not required.

6. Note: Since the B key actually sounds the bell, if you use a horn sound file for your loco that has the bell sound file in it (idle.wav file), after you start the loco the bell will sound all the time - you will soon get tired of the bell! You need to delete the bell sound (idle1.wav)from the horn asset you use.

7. My script also moves the engineer from the walkway to inside the cab on startup, it swaps the engineer1.im and the engineer3.im files, you do not need to use function.

Read the config description on how to use the loco. It should not be hard to make your own startup loco. I have also made a rule that you can use to start or stop the loco under AI, aircraft_start_command <kuid2:60238:80004:1>, on the DLS.

There is a video on my Youtube site for the loco:

http://www.youtube.com/watch?v=zj_CfLvtvmk

Ian

I think you used a similar feature on your UH-60 blackhawk, you press the bell and the blades start rotating I think. So say I wanted to add this to the 44 class, how would I do that?
 
Correct, but there are a lot more animations used for the aircraft.

Clone and modify the the 44 config to call up my script (place it in the loco file) and follow the steps above to make or modify sound files suited to your loco. I assume you are cloning the 44 for your own personal use and not for upload.

Ian
 
Correct, but there are a lot more animations used for the aircraft.

Clone and modify the the 44 config to call up my script (place it in the loco file) and follow the steps above to make or modify sound files suited to your loco. I assume you are cloning the 44 for your own personal use and not for upload.

Ian

So i drop the script into the 44 classes folder, how do i make it call upon the script? and I just need to add a few sound files? apologies if I'm being annoying, I just like getting things clear when it comes to things like this. Yes all the modifications using this script are all for personal use, by no means will I upload the modified locos without the permission of the author.
 
Clone the 44 class.
Copy the engine1.gs file to your cloned model.

Find the referenced engine sound file for the 44 loco and clone it.
Copy the idle 1.wav file from the cloned 44 engine sound file to your new 44 clone loco, rename it engine.wav.
Replace the idle 1.wav file in the cloned engine sound file with the idle 1.wav file from the gg20 engine sound file, this is a silent sound.
Copy the start.wav and the stop.wav files from the gg20 to your cloned 44 loco. These are suited to the gg20, and are probably not suited to the 44, you might want to make your own start and stop sounds,

Find the referenced horn sound file for the loco, if it has an idle.wav you will need to clone the horn sound and delete the idle.wav file, otherwise the original horn sound should be ok to use.

Edit the config file for the cloned loco to add these lines:

script "engine1"
class "loco"

soundscript
{
engine
{
trigger "engine"
attachment a.sound0
nostartdelay 0
repeat-delay -0,-0
distance 20,170

sound
{
engine.wav
}
}
}

Now make sure your config file for the cloned 44 loco reference the correct cloned engine sound and hornsound assets, also correct the kuid table.

Ian
 
I was just about to drop in here and comment "I notice there's a Start and Stop key in the assignments menu."

Are they used for the 44?
 
The B key starts and stops my loco engines, don't know the 44, not looked at it.
 
Last edited:
I have no doubt the community looks forward to your selfless contribution Paul.

I have described in detail all the things that need to be done to create this capability in other threads on these forums. All you have to do is spend the time to learn about scripting, mesh creation, sound editing and a few other bits and the job is done. How difficult could that be? I'm sure it didn't take me more than 100 hours or so. I suppose the 37 years in the software industry may have helped.

Cheers
Dave

Fair enough Dave, I was being a bit outspoken. I've never had a problem with payware for 'creative' elements for models like mesh, textures, animations etc. But with scripts / code there's a risk of locking off a whole area of activity in the game if an alternative way can't be found. What if Bloodnok's signalling scripts were payware? We'd still basically be using TRS04 signalling rather than the fantastic multiplicity of signals that have been developed, as freeware, since TC3. It's a bit like bio-tech companies trying to patent DNA sequences - the law may permit it, but it still doesn't feel quite right.

But apologies if I spoke too bluntly.

Paul
 
i disagree. there is usually another way to approach it, even if it must be developed again from scratch. i used to agree with you, until i started finding my own code used elsewhere without any mention of it's origin or otherwise tip of the hat in the right direction.

even with that being said, i have a startup/shutdown feature available in my library that is fairly easy to use and does not require major changes to all files involved. i know of a few European engines that use a script to enable a startup/shutdown system. i am also aware of the World of Trainz method mentioned earlier. that alone tell you it is possible to create ways of doing it. yes, it is a bit of brainwork and takes some time and effort to develop, and is probably why it is so well protected.
 
I'm not a programmer but I've done some sound editing before in MSTS. A reasonable compromise between complex scripts and widespread use would be the illusion of a locomotive shutdown. In other words, when the Shut Down command is issued in the task bar, the engine stopping sound will play once and then it becomes silent, even though the locomotive is still *virtually* running and can move if you advance the throttle.

Likewise, issue the Start Up command and the engine spool up sound plays once and it's back to business as usual.

There's still the issue of exhaust, but it's mostly an on-off 1/0 thing. I think.

Cheerio,
Nicholas
 
... i used to agree with you, until i started finding my own code used elsewhere without any mention of it's origin or otherwise tip of the hat in the right direction...

I see your point and, of course, this can be addressed with a standard freeware license where you will retain control over copyright. The problem with payware is that, by definition, it can't be made available to other creators, so it becomes a kind of creative 'dead end' which starts and finishes with its original author. Not perhaps a problem with meshes and textures, but perhaps a loss to the community if it's a script that represents the 'best way' or 'only way' of performing certain functions in the game?

Paul
 
I see your point and, of course, this can be addressed with a standard freeware license where you will retain control over copyright

No it does not. Anyone can (and will) copy and reuse it copyright or no copyright.

Other then that, it doesn't stop anyone else from putting in the time to learn scripting and then research and experiment to develope their own script. If there's only ONE way to do something, then you will discover it for yourself. And similarities between your script and "their" script will be strictly the result of that research.

On the other hand, I appreciate an un-encripted script, as it's often how I learn...
 
I'm not a programmer but I've done some sound editing before in MSTS. A reasonable compromise between complex scripts and widespread use would be the illusion of a locomotive shutdown. In other words, when the Shut Down command is issued in the task bar, the engine stopping sound will play once and then it becomes silent, even though the locomotive is still *virtually* running and can move if you advance the throttle.

Likewise, issue the Start Up command and the engine spool up sound plays once and it's back to business as usual.

There's still the issue of exhaust, but it's mostly an on-off 1/0 thing. I think.

this is usually how they work as of now, trouble is, there is no way of stopping the idle sound without it being scripted. and something needs to play the start and stop sounds, also scripted. once you get that far in, there is no reason not to have the throttle unresponsive and turning off the smoke effects too - then you have a complex script.

I see your point and, of course, this can be addressed with a standard freeware license where you will retain control over copyright. The problem with payware is that, by definition, it can't be made available to other creators, so it becomes a kind of creative 'dead end' which starts and finishes with its original author. Not perhaps a problem with meshes and textures, but perhaps a loss to the community if it's a script that represents the 'best way' or 'only way' of performing certain functions in the game?

well i have never stopped anyone from using my train fx library for freeware if they ask permission and give credit. i use the same code for freeware and payware myself. nobody has ever asked me if they can use it or how to enable such features however, and i do not intend to leave the code open for viewing any longer because it shows up elsewhere without credit for the long hours staying up late at night to figure out the logic in the first place. even though the ability exists in there somewhere, it still takes a lot of work and ideas on how to work around certain things to get your end result. to have that simply copied is undesirable. if anyone wishes to see some code or ask about how something was done they are free to, but too often they just take it without asking. i would gladly share ideas and specific codes to anyone who has the guts to ASK.

the other issue i have with start/stop etc is that i feel there really isnt a 'good' way in TRS to accomplish it. sure i did it, but i feel it is inefficient and should be better left to the internal software to handle, as well as there being no way to properly play it back under the 3d sound engine without a few hiccups.

if you are interested in seeing some freeware items using the features look at http://jointedrail.com/index.php/freeware/rbmn-packs.html

these have custom smoke, startup and shutdown, isolation from consist abilities (they can be on and running but not contribute to pulling power of the consist), and fuel/sand consumption.
 
Last edited:
Back
Top