quake2 - func_train

A func_train is moving object that travels along a specified path. For those of you familiar with quake1 editing then your probably familiar with func_trains. They are not the easiest entity to use but they are not extremely difficult.

How do I get the dang thing to work?!

It takes at least 2 entities to get a func_train in working order. The actual func_train and more then 1 path_corner. The path_corners specify the actual path that the func_train will follow. We will get to that in a little later though.

First thing you need to do is to build the actual object that will be the func_train. This can be one single brush or multiple brushes, it all depends on what you want the train to be. After you have build the object then you will need to turn the object into a func_train entity. It does not matter where you place the func_train because it will automatically spawn at the first path_corner.

The second thing that you need to do is to make all your path_corners. These will be the actual path that the func_train will follow as mentioned above. Each path_corner will link to the next. So if I made a lift that would travel around the corners of a square room then I would have 4 path_corners. The first one would have a targetname p1, and a target p2. The second one would have a targetname p2 and a target p3. Third one would have a targetname p3 and a target p4. The fourth one would have a targetname p4 and if you wanted the lift to continuously travel around the room then you would give it a target p1, which is the targetname of the first path_corner. Now I am going to go into more detail on all the different key value pairs and spawnflags.

Key Value Pairs of the func_train


speed is simply the speed that the func_train will travel from path_corner to path_corner.

dmg is the amount of damage the train will inflict when it crushes you up agaist a object. What I mean is it won't take off damage by just touching you...only when you are like...trapped up against a wall and the func_train.

noise is the sound that will be played when the func_train is moving. Here is a list of sounds that you can use. Don't forget to include the directory along with the sound name. Example: noise world/pump1.wav.

target will be set to the first path_corner. A func_train MUST have a target key and it MUST be a path_corner.

If a func_train has a targetname then it will have to be triggered before it will be become active.

Spawnflags of the func_train


By default a train will only start moving when triggered by another entity. If you set the start_on spawnflag then the func_train will start moving when the level starts.

toggle will allow the func_train to be toggled on and off numerous times. It will only work when a func_train is triggered into action multiple times by another entity such as a func_button. This is useful in making moving elevator type platforms.

When the spawnflag block_stops is set the func_train will stop completely when an entity like the player is blocking its way and it won't take any damage off. EVEN if the dmg key is set.

Other misc. things you might like to know about the func_train and path_corners

func_trains are very useful entities and can be used for a variety of cool effects. To get some of these cool effects you need to be familiar with some of the spawnflags of a path_corner like, teleport, pathtarget, and wait.
  • teleport will actually teleport the func_train to the next path_corner that is targeted. This was used in the id levels to create the cool conveyor belts in some of the levels. It can also create the effect of moving crates. Just use one func_train that looks like a crate, target it to 2 path_corners, have teleport on for the second one.
  • pathtarget corresponds to a targetname of an entity that will be triggered when the func_train arrives at that path_corner. This can be used for a variety of cool effects. I remember seeing this in the id level where a machine is carrying a barrel from the ceiling and it smashing into the wall and blows a hole in it. This effect was created by placing a path_corner very close to a wall that is actually a func_explosive. Then the pathtarget of that path_corner is set to the targetname of the func_explosive. Pretty cool.
  • wait will make the func_train wait at that path_corner for the specified amount of time before preceding to the next path_corner.

On the [example .map] there are examples of all the different options to the func_train. There is even an example of the conveyor I just mentioned so check it out. If you have any more question the please post them on the discussion board.

Return to Tutorials Page...

Copyright Crap