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
[author]
Posted by booker on Sat Jan 22nd 2005 at 2:55pm

Corona: this should help <a href="http://www.hl2world.com/wiki/index.php/Elevator" target="_blank">http://www.hl2world.com/wiki/index.php/Elevator</a>

Kuusi1: its for HL2

pef03 &amp; HarPooned: your right, there was a typo. Fixed now.
0 starsPosted by HarPooned on Fri Jan 21st 2005 at 4:56pm

Models/props_lab/elevatordoor.mdl model. Give it a Name of prop_elevator

Isn't this supposed to be models/props_lab/freightelevator.mdl?
0 starsPosted by pef03 on Fri Jan 21st 2005 at 2:23pm

Oi blud oi blud.

nuff respect.

I mean...nice tutorial. Is it my imagination or is there a typo at the top when you say the two different models for the elevator and it's door.....but give the same filename?
0 starsPosted by Kuusi1 on Sat Jan 15th 2005 at 3:42pm

I have a problem iwe done everything as sayd but the elevator just shuts the doors and doesnt move anywhere... smiley
is this thing only compatible with HL2 and not with CS: S?
0 starsPosted by Corona on Thu Jan 13th 2005 at 9:07am

What about multiple levels?
0 starsPosted by Orpheus on Wed Jan 12th 2005 at 8:48am

Booker, i truly appriceate the thought, but this wasn't exactly what i meant.
i guess i really am going to have to make a tutorial on screenshots..
[author]
Posted by booker on Tue Jan 11th 2005 at 9:38pm

You can see it with .gifs below

<a href="http://www.planetquake.com/booker/tuts/elev_with_props.html" target="_blank">http://www.planetquake.com/booker/tuts/elev_with_props.html</a>
0 starsPosted by Orpheus on Tue Jan 11th 2005 at 1:17pm

I would like to comment but the screens won't allow me to smiley
i would like to ask, which admin authorized this tutorial, so i can send a thank you PM for supporting my cause.

277k ? :eyeroll:
0 starsPosted by Guessmyname on Mon Jan 10th 2005 at 5:52pm

0 starsPosted by dibz on Mon Jan 10th 2005 at 11:25am

This looks very good and it doesnt confuse me smiley

i will have to implement this in future maps
Post ReplyView Topic