How to make a train+track

DrSquishy

we've all had better times to die
aa
Feb 10, 2017
1,297
974
How can I make a train in hammer? I'm interested in the train itself, how to make the logic for the train and what props to use, anything that would help me be able to fully implement a train into my map.

Thanks in advance!
 

henke37

aa
Sep 23, 2011
2,075
515
It is fairly simple, use a func_tracktrain for the train itself and path_track to define the path(s) it takes. If you want to use a prop instead of a brush for the train, parent a prop_dynamic to the tracktrain.
 

DrSquishy

we've all had better times to die
aa
Feb 10, 2017
1,297
974

henke37

aa
Sep 23, 2011
2,075
515
You can use any props you like for the tracks. Some maps don't even have any! They just paint the tracks onto the ground with a texture. Really, just use the property browser to search for "track", it's sure to find plenty.

As for making the train loop, just set the next stop of the path_track to a previous node. Nothing special needed! Or, if you don't want a loop, but the train to teleport back, try the teleport to this track spawnflag for the path_track. There is also supposed to be some teleport input for the tracktrain, but VDC doesn't seem to list any...
 

Powerlord

L3: Member
May 8, 2010
127
60
You can use any props you like for the tracks. Some maps don't even have any! They just paint the tracks onto the ground with a texture. Really, just use the property browser to search for "track", it's sure to find plenty.

As for making the train loop, just set the next stop of the path_track to a previous node. Nothing special needed! Or, if you don't want a loop, but the train to teleport back, try the teleport to this track spawnflag for the path_track. There is also supposed to be some teleport input for the tracktrain, but VDC doesn't seem to list any...
Wouldn't it just be TeleportToPathTrack ? I always assumed this is what mappers used to teleport trains in on a timer.
 

DrSquishy

we've all had better times to die
aa
Feb 10, 2017
1,297
974
Wouldn't it just be TeleportToPathTrack ? I always assumed this is what mappers used to teleport trains in on a timer.
The teleporting onto the next track worked fine with the flag; only problem is that I have a very long train, so may need to do multiple trains, each tied to a different section of the train props so it teleports over time, not 1 massive teleport.
 

Vel0city

func_fish
aa
Dec 6, 2014
1,947
1,589
The teleporting onto the next track worked fine with the flag; only problem is that I have a very long train, so may need to do multiple trains, each tied to a different section of the train props so it teleports over time, not 1 massive teleport.
That, or you just make the train extend into the skybox for as long as you need and until it's completely invisible for players, then teleport it back. Maps like Cactus Canyon and Freight do this.
 

DrSquishy

we've all had better times to die
aa
Feb 10, 2017
1,297
974
That, or you just make the train extend into the skybox for as long as you need and until it's completely invisible for players, then teleport it back. Maps like Cactus Canyon and Freight do this.
How would I make it seamlessly extend into the skybox? I would want something similar to the banana bay train, where it goes through part of the map, and disappears off into the distance.
 

Vel0city

func_fish
aa
Dec 6, 2014
1,947
1,589
How would I make it seamlessly extend into the skybox? I would want something similar to the banana bay train, where it goes through part of the map, and disappears off into the distance.
Make it go in a tunnel behind a black brush. Then extend the tunnel to the lenght of the train you're trying to teleport back. Do the same for the starting point of the train.