Creating a Basic Elevator
By Unsane
First you need to create your lift car. For the purpose of this tutorial I created it out of brushes, selected them all and tied it to entity func_tracktrain. Now being a func_tracktrain it will need tracks; so in the map you should end up with something like this if successful:
You can use any ammount of path_tracks you want, but don't use pathcorners, that was for Half-Life 1 and wont work in Half-Life 2. In this case I have created 3. Now before we keep going; let’s establish names on what we have:
* The liftcar is named: elevator
* The path_tracks are named: lvl01, lvl02, lvl03 from the bottom to the top.
* Remember to set next targets too. For lvl01 set target to lvl02, for lvl02 set the targer to lvl03, for lvl03 set target to lvl01.
Liftcars (func_tracktrain) properties are as follows:
* Name: elevator
* Max speed: use what you like, I used 25.
* Initial speed: 0 (so the elevator doesn’t start moving oddly)
* Height above track: I set mine to around 4, the path Entities are aligned with the bottom of the car.
The rest is default; except for the flags: go in here and tick these 2:
* No Pitch (X-rot)
* No User Control
"What, no user control?" you say "but I want buttons?!" And that you will get, but this is actually a train, right, so user control would mean that it was controllable in the same way as the train in 'On A Rail' in HL1. We don’t want that.
Now the paths. The first one at the bottom, give it a name, and a target and set 'New trainspeed' to '0'. The next one, name, target and set this output:
Do the same for the last one too.
And here comes the buttons:
Make a func_brush w/ a button texture inside the car and parent it to the elevator. Alternatively; you could just make it part of the func_tracktrain, as this is not really a button but just a brush to show where the button is.
* Note: I did it this way for two reasons; first because in this case I created the car before even thinking about buttons (this is my first elevator), and secondly I can move the button if I want to. In the example map the buttons are on the wall on each floor, but it looks better with them inside the car.
Now, over the func_brush make a nodrawed brush and tie to entity func_button. Place one of these on each floor, where your func_brush button will be. Name them. Go into the first: Flag them:
* Dont Move
* Use Activates
Do that for all of them
In the first, set the output:
In the next, set the output:
In the last, set the output:
That’s it! Now you have a very basic elevator that moves when you press the button and stops on each floor.