Snarkpit Articles


We're going to make an elevator with two props and have it close the door once you press the button inside and go to the next level. Once at the next level the door will open and wait for you press the button again.

First you want make a prop_dynamic with the models/props_lab/freightelevator.mdl model. Give it a Name of prop_elevator and make the Parent elevator (we will be getting to that in a moment). Now make another prop_dynamic with the model models/props_lab/elevatordoor.mdl. Give it the Name prop_door and Parent it to elevator. If you look at the front of the elevator model you will see a dark beam on both sides of the door and wouldn't you know it the elevatordoor.mdl fits right in there.

Now we come to the parent I was talking about. Get the NODRAW texture and make a brush the size of your elevator from the top. Here is the important part. Make sure the top of the brush is level with the floor in the elevator. If not, wherever the top of the brush is where the player will walk. So it?s better to have even with the elevator floor.



Now make the brush you just make a func_tracktrain (Ctrl+T) with the name elevator and change the Max Speed to 50 (the default of 100 is a little fast). Also change the Height above track to 0 and for First Stop Target put path_track_01. Go to the flags tab and check only No Pitch and No User Control.

To make it clear what we have done so far is get our elevator and door and tied them to the func_tracktrain. So wherever the func_tracktrain goes so will the elevator and the door. Now we just need to tell it where to go.

To do that you need 2 path_track entities. Name the first one path_track_01 and for the Next Stop Target put path_track_02. Go to the Outputs tab and add these 2 outputs.

My outputs named: OnPass
Target entities named: elevator
Via this input: Stop
With a parameter override of: <none>

My outputs named: OnPass
Target entities named: prop_door
Via this input: SetAnimation
With a parameter override of: open





Since we changed the Height above track to 0 for our func_tracktrain we can set the floor of the elevator right where we need to. In the x/y (top) view put the X in the middle of the path_track entities right where the X for the func_tracktrain is at. In the y/z (front) or the x/z (side) view put the X for the path_track even with the top of the floor you want it to start on.





Do the same as above for the other path_track but name it path_track_02 and set the Next Stop Target to path_track_01. Of course put this one above or below depending on what way you want it to go.

Now we need to trigger all this. To do that we get our NODRAW texture again and make a small brush that covers the button inside the elevator.



Make this brush a func_button (Ctrl+T), give it the Name of elevator_button and made the Parent elevator. Go to the Flags tab and check only Don't move and Use Activates. Now go the Outputs tab and add the following two outputs.

My outputs named: OnPressed
Target entities named: prop_door
Via this input: SetAnimation
With a parameter override of: close

My outputs named: OnPressed
Target entities named: elevator
Via this input: StartForward
With a parameter override of: <none>



And there you have it. The door will start open, you get inside and press the button, the door will close and the elevator will move. But theres one more thing. If you try it now you can just walk out the sides and back. To stop this get the Player Clip texture and made a brush for the sides and back. Select all of them and make it a func_brush (Ctrl+T). Make the Parent elevator and you're set.


Post ReplyView Topic
Discussion
0 starsPosted by jrich3600 on Wed Apr 23rd 2008 at 10:11am

His tutoral works...If your elevator flips 180 degrees or spins etc it's because the func_tracktrain entity is not lined up exactly with the two path_track entities. Remember where he says line up the red x on the nodraw floor func_tracktrain with the two path_track entities. You must line them up or the elevator will face the wrong way...spin or even disappear. The nodraw floor texture also must be and even brush size such as 146 if it is 145 you will not be able to line the path_track up with the no draw func_tracktrain floor entitly. I just though I'd post because mine was flipping all over and took me an hour to find out that because these were not lined up it was causing this problem.
0 starsPosted by RedBlade2021 on Tue Jan 29th 2008 at 9:35pm

Hey, is the nodraw texture for the elevator suposed to be hollow? It looks like that in your pictures, just message me at steam plz, RedBlade2021
0 starsPosted by nightlord on Mon Sep 3rd 2007 at 7:58pm

Nice tutorial my elevator works, but it starts the wrong way round, goes up and spins round at the top, then when it goes back down spins round again
0 starsPosted by FIDDLER on Mon Jun 25th 2007 at 9:56am

I have one that has 4 buttons inside that you can press. Each one taking you to a specific floor. When on the floor calling for the elevator it shows up at your floor as well. More floors can be added as well.

I will post a link when I get it uploaded somewhere.
0 starsPosted by night0200 on Sun May 13th 2007 at 9:42pm

Awsome tutorial.
0 starsPosted by kj53 on Fri Jun 23rd 2006 at 12:20am

Great tutorial, but unfortunatly my elevator is very messed up. It looks perfect in Hammer but when I run the map it is facing a diffrent direction, also when I press the button to start it the doors close then open again.

Can some one please help me?
0 starsPosted by G4MER on Mon May 16th 2005 at 11:34pm

This helped me a bunch thank you booker for a well made tutorial.
0 starsPosted by finlaybob on Fri Feb 25th 2005 at 4:13pm

0 starsPosted by -Nisse- on Tue Feb 15th 2005 at 10:23pm

Nice tut, to make more than 2 levels just place more path_track s
the config is very easy so i dont think i need to explain it :P
0 starsPosted by Dark|Killer on Tue Jan 25th 2005 at 7:32am

Post ReplyView Topic