Brushes 201: Lesson 6
Auto-Moving Platforms (func_train, func_plat)

Adding a train or platform is a slightly more complicated procedure than a simple door.  First of all, we should differentiate the two.

A func_plat will move from its original position to a set waypoint straight up on straight lines, possibly stopping, before returning to its original position.

A func_train will move from its original position to a series of waypoints on straight lines, possibly stopping et each, repeating the pattern until a script tells it otherwise.

Thus, you want a func_train for objects that will constantly be in motion and a func_plat for objects like simple lifts/elevators that are triggered.

 

func_train
First, create the object that you want to be the moving platform itself.  It doesn't necessarily need to be where your train will actually start moving from.  Next, create a small square in the center of that platform and cover it with the system/origin shader.  This will be the brush by which your platform will move from waypoint to waypoint.  For example, if you place your origin brush in the center of what you want to move but 3 grid units below it, the train itself will be 3 grid units above the path you make in Radiant.  Now, select both your platform and the origin brush (Shift-Click each), then select func_train from the func menu to convert the brushes into a func_train entity.  In your own func_trains, you can add as many brushes as you want.  You should have something like this:

Now, deselect your train and create path_corner entities in the places you want your train to stop along it's path.  After you have all your path_corners put down, select your func_train and then the path_corner you want your train to start from (in that order), and press CTRL+K to link them together.  Remember that your func_train will spawn at the path_corner it is linked to, NOT wherever you actually place it:

Now, link each path_corner to the others in the order that you want the train to move in (remember to select the path_corner you want it to move from first and then the path_corner you want it to move to).  You should create a complete circular path with your path_corners.

That's it!  Compile and your platform will be moving between it's corners.  If you want to change the speed with which the train launches itself off from any corner, add the key speed and an appropriate value.  If you want to change the amount of time that the train waits at any corner (default is 0), then add the key wait and a value in seconds.

You can add a soundset to func_train in the same way you can with a func_door, utilizing the sound.txt file and soundset key.

 

func_plat
A func_plat is a little bit more complicated, but not too much more so.  For our example, we will make a small platform to lift up to the edge of the tub.  First of all (of course) make the platform itself.  This time, however, put it where you want the platform to actually sit - at the top of its movement.  func_plats always need to be physically placed at the top of their movement.  You should end up with something like this (note that I added a caddy for the platform to fit into when it is at its lowered position):

Now it gets a little bit complex.  You need to figure out how many units the platform needs to move between its upper and lower positions.  The easiest way to do this is simply to duplicate the platform brush from a side view and resize it to figure out the distance.  After you figure out the distance, you can delete it.

As you can see, the distance in my example is 80.  Thus, I added the key height and the value 80 to my func_plat.  After compiling, the platform is right in place!  Make sure you delete the extra brush you created to measure the distance.

Back to Home