Page 1 of 1
Just Trains ActivScript
Posted: Sat Feb 18, 2012 12:43 am
by 37114
Hi All,
Does anybody know if this can be applied to other locomotives. The one thing I've banged on about as missing from Railworks is the Driver Safety Device and finally we have it on their 67 and 153. Would love it on everything.
Re: Just Trains ActivScript
Posted: Sat Feb 18, 2012 1:09 am
by Darpor
Well, it can presumably be applied on anything, but you cannot just have it done without permission.
Re: Just Trains ActivScript
Posted: Sat Feb 18, 2012 7:30 am
by Kariban
Totally the wrong forum, but you can add a DSD to anything, probably one of the simpler bits of scripting to learn. You can't just apply JT's 67 script to a random diesel, though, any more than you could fit an ECU from a truck in your car.
Ingredients for a DSD:
- A timer variable - every game engine tick ( ie when Update() ticks ) take time away from it, unless ...
- a stop-counting boolean variable - don't take time away when this is set
- a constant holding the dsd timeout time, which you reset the timer to when the DSD goes off. If you want a modern DVD that will probably be a random number instead of a fixed one.
- a constant holding the timeout when the DSD is actually going off, the length of time you have to cancel it.
- an annoying DSD-going-off sound sample, and entries in the cab sound config for it - additionally a new control in the engine blueprint that you tie the sound sample to.
- inputmapper entries tying a key to the above control so when you push a key, it resets it to 0.
- a bit of code to reset the dsd timer.
- a bit of code in OnControlValueChange() checking a bunch of controls ( including the dsd itself ) for changes in value & resetting the timer.
- a bit of code checking for whatever conditions ( reverser in neutral? stopped? ) that disable the DSD and setting the stop-counting flag when they're met.
- a bit of code testing how long it's been since the DSD went off ( it's control value was 1 ) - you can reuse the timer variable to count upwards - and setting the emergency brakes if it's been too long.
Think that's probably it. None of the bits of code are either complicated or very long. Don't ask me for more help, I can't stand DSD/DVD in RW models

Re: Just Trains ActivScript
Posted: Sat Feb 18, 2012 7:41 am
by msey0002
Hi Simon, is it possible to copy/paste off the relevant simulation file?
Re: Just Trains ActivScript
Posted: Sat Feb 18, 2012 8:29 am
by Kariban
Probably, I haven't studied JTs script so I don't know how entwined with other features their DVD code is.