Trying to a Train hazard to my map but I'm an idiot.

ZombieGuildford

L1: Registered
Jul 22, 2016
16
3
Between my lack of knowledge and laziness I don't know how to add train hazards to my map.

I'm really just looking for a more skilled person to set it up for me. You shall be credited of course.
 

stopmotiony6

L1: Registered
Apr 17, 2020
8
1
So, I think what you need is #1 a func_tracktrain that allows the player to ride a platform and #2 a path_track which will guide the train, #3 you will need a Trigger_hurt that will damage the player, which you can parent to the func_tracktrain.

There are more in depth tutorials on how to place path_tracks that you should look for as I'm not the best person to explain it, but the gist is, you place one path_track, give it a name so it can be targeted, use somthing like track1 (it needs to have a number on the end of it), then copy it to form a track for the func_tracktrain to ride on, you want to space them evenly apart (not too far or too close) and use multiple path_tracks. You don't have to do anything extra when copying the path_track as hammer automatically sets it up for you. You can then link the func_tracktrain to the first path_track and from there it will automatically connect to the rest. You can change the speed, sound and other characteristic's of the func_tracktrain in the properties menu.

Here's a link to the Valve Developer wiki on path_track: https://developer.valvesoftware.com/wiki/Path_track
You can also look up func_tracktrain and trigger_hurt of you don't already know about them, I have also found some great tutorials here on tf2maps that I'm sure you would find helpful. I suggest making it yourself first so you know how it works before getting someone else to do it.

I hope this helps! And feel free to ask anymore clarifying questions if I missed something or didn't provide enough detail.
 

ZombieGuildford

L1: Registered
Jul 22, 2016
16
3
I know how to make a train... that goes in straight line... and only passes though once. I don't know how to set up multiple trains the follow path that has a turn in it and so I think I need to make a train of func_tracktrains so that the carriages follow the loco correctly. I also don't know how to get them so pass through multiple times.
 

stopmotiony6

L1: Registered
Apr 17, 2020
8
1
Oh, okay, like I said I'm not the most well versed in this, but you could make a path for the train under the map and just link it up into a circle. Probably not the best way to do it, but it will work.
 

stopmotiony6

L1: Registered
Apr 17, 2020
8
1
Ok, I don't know if you have solved it yet, but I did some looking around and I think you can use what's called a trigger_teleport to get func_tracktrains to teleport back to the start, you can then send an output to the func_tracktrains telling them to to stop for a certain amount of time and then continue on the desired path.

Also all you need to do to get it to turn is hook up the path_tracks in a half circular arrangement, I have a test map that displays this but currently cannot take screenshots for some reason.

You might (big emphasis on might) be able to use an env_entity_maker to create func_tracktrains every so often and just have them pre programed to run a certain path, but I don't know as I have never tried it.
 

theatreTECHIE

Yet another Techie for the net...
aa
Jun 19, 2015
446
457
For multiple trains following a curved path, look at: https://tf2maps.net/threads/how-to-multi-car-trains-on-curved-tracks.38170/

As for having trains teleport back to the start, all you need to do is have the following logic set up on the last path_track (make sure to also repeat this for each func_tracktrain):
My Output|Target Entity|Target Input|Parameter|Delay|Only Once
OnPass|train_name_here|Stop||0.00|No
OnPass|train_name_here|TeleportToPathTrack|name_of_starting_track|0.01|No
Also note that for each func_tracktrain, the starting track will be different.