Just Trains ActivScript

Are you thinking about building your own route? or are you already in progress? Talk to the experts in here and find out the best way to do things!

Moderator: Moderators

Locked
37114
Well Established Forum Member
Posts: 851
Joined: Fri Aug 20, 2010 12:14 pm
Contact:

Just Trains ActivScript

Post 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.
Regards,

Rich
User avatar
Darpor
Very Active Forum Member
Posts: 7322
Joined: Sat Sep 20, 2008 8:51 pm

Re: Just Trains ActivScript

Post by Darpor »

Well, it can presumably be applied on anything, but you cannot just have it done without permission.
DPSimulation - http://www.dpsimulation.org.uk/ - Free High Speed Downloads of TS2012 Content

DPSimulation Blog - http://dpsimulation.blogspot.co.uk/ - News, Views & Development Updates
Kariban
Very Active Forum Member
Posts: 4478
Joined: Sun Nov 07, 2010 4:10 am

Re: Just Trains ActivScript

Post 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 :P
My posts are my opinion, and should be read as such.
msey0002
Very Active Forum Member
Posts: 4527
Joined: Sun Jul 26, 2009 11:34 pm

Re: Just Trains ActivScript

Post by msey0002 »

Hi Simon, is it possible to copy/paste off the relevant simulation file?
Kariban
Very Active Forum Member
Posts: 4478
Joined: Sun Nov 07, 2010 4:10 am

Re: Just Trains ActivScript

Post by Kariban »

Probably, I haven't studied JTs script so I don't know how entwined with other features their DVD code is.
My posts are my opinion, and should be read as such.
Locked

Return to “[RW] Route Building”