Best way for train hazards?

Ctrl Alt Defeat

L1: Registered
Jun 10, 2014
31
5
I couldn't find any in depth tutorial on this, so I figured I'd ask. For train hazards (such as those on Well or Freight), what's the best entities to use? There's so many different brush entities that can move. Would a func_tanktrain or a func_movelinear be better? What else would be needed for resetting position, etc?
 

worMatty

Repacking Evangelist
aa
Jul 22, 2014
1,258
999
You make a good point about needing to reset the position. func_movelinear can't have its position reset immediately. The train would need to go backwards at a fast speed, which would be noticeable.

The simplest way is to use a func_tracktrain and a couple of path_track. When the train reaches the end path node, you can teleport it to the 1st using the TeleportToPathTrack output, and putting the name of the 1st path node as the parameter.

Parent a trigger_hurt brush to the front of the train. Give the train the spawn flag 'Unblockable by player'. Then put a trigger_hurt brush inside the wall around the tunnel exit of the train. This is because players can stand on top of the train and can be pushed in to the wall brushes. The submerged hurt brush will kill them if they try to exploit this.