Train (and gates) lazy-person's prefab

Freyja

aa
Jul 31, 2009
2,994
5,813
This is just a VMF file containing all the logic required to make a train work.

This is the logic setup I used in Keikoku (modified to be a single engine). It is fully commented so everything has a note on it to what it does, even includes gates.

Notes:

  • Position the prefab wherever you like. The gates can be moved to any distance apart, they are triggered to open by the path node a bit in front of the doors, so as long as you keep the distance between the doors and the node it should work fine.
  • The doors close by default after 1 second, this works for the speed and length of the train, if you change those you'll need to adjust this accordingly
  • the entity called train_timer fires the train a random time between 30 and 50 seconds. Edit or disable the timer, and you can use train_start to fire it manually by any means you wish.
  • By default, warning bells are stopped when the train reaches the first gate. They're disabled by a node, so move that to wherever you wish the warning bells to end.
  • Will destroy buildings

Download.
 
Last edited:

Yabayabayaba

L5: Dapper Member
Jun 2, 2016
243
77
download broken:(
 

SnickerPuffs

(*single chuckle*)
aa
Apr 10, 2014
1,315
1,857
This post was made in 2014 that is why it's not working.

Also because Dropbox changed how public folders work and basically broke everything, but you're probably more right than I am.