Freight Elevator

Tutorial collection, comprehensive listings on main site.

Freight Elevator

Postby Tutorial on Tue Mar 08, 2005 12:56 am

category
General Half-Life 2/Entities

description
A proper lift with working doors, similar to that seen at the start of HL2.

keywords
freight, elevator, lift.

Where 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 from you press the button again.

First you want make a prop_dynamic with the models/props_lab/freightelevator.mdl. 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.

Image

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 where ever the func_tracktrain goes so will the elevator and the door. Now we just need to tell it where to go.<p>

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

Image

Image

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.

Image

Image

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.

Image

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

Image

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 your set.
- Don't send PM's to this user -
Tutorial
Not A Real User
 
Joined: Sun Mar 06, 2005 11:00 pm

Postby booker on Wed Mar 09, 2005 1:26 pm

snice i can't do it now you need to change the 2nd paragraph to this.

First you want make a prop_dynamic with the models/props_lab/freightelevator.mdl. 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.
User avatar
booker
Dumpling
Dumpling
 
Joined: Sun Jan 09, 2005 11:50 pm

Postby Blink on Wed Mar 09, 2005 1:41 pm

Done, thanks
User avatar
Blink
Cool 'n that
Cool 'n that
 
Joined: Fri Oct 08, 2004 4:16 pm
Location: UK

Postby RabidGoat on Wed Mar 30, 2005 11:26 pm

wow, that tutorial is awesome!!! so easy to read and follow! thank you!

I did want to see if I could change and add something however......

Change: Its just a minor typo, but had me wondering for a couple minutes.....

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

My outputs named: OnPass
Target entities named: elevator
Via this input: StartForward
With a parameter override of: none "


Instead of "OnPass" it should be "OnPressed"

Also, something to add: I noticed the delay of 1 for the StartForward portion.......that was never mentioned, it was in the picture however.

Once again, awesome tutorial! If you can instruct me......anyone can do this!

(Admin/Moderator......please delete after changes are made.....if they are made)

Your friendly neiborhood Hammer n00b
-Rabid Goat :? [/quote]
RabidGoat
Regular
Regular
 
Joined: Sun Mar 20, 2005 4:52 am
Location: Florida (It's just as hot as you think it is) =P

Postby Blink on Wed Mar 30, 2005 11:34 pm

Thanks for the heads up Rabid, and maybe add that tag into your signature ;)
User avatar
Blink
Cool 'n that
Cool 'n that
 
Joined: Fri Oct 08, 2004 4:16 pm
Location: UK

Trouble

Postby Juvenile on Mon Apr 04, 2005 5:26 am

Hey i'm having a lot of troulbe with this tutorial, I even downloaded the example map, and that doesn't work. What could I be doing wrong, I believe I followed the map exactly. Thx.
Juvenile
Just Joined
Just Joined
 
Joined: Mon Apr 04, 2005 5:25 am

Postby Google [Bot] on Wed Apr 13, 2005 9:57 pm

It took me a while, but by golly, it works at last.

It frankly hasn't added much to my level, but great tutorial all the same.

And i seriously doubt you care.
Google [Bot]
 

Postby anti-hero on Wed Jun 08, 2005 5:41 pm

fo some reason my door starts closed. could someone help? :-)
anti-hero
Member
Member
 
Joined: Mon Jun 06, 2005 5:15 pm

Postby Frozen Flame on Wed Jun 29, 2005 10:33 am

my elevator is invisible, it still works, as when i press the button which u cant see it goes down but its all invisible, i even added my own lift by haveg just a box of brushes that u could walk in, but that was invisible too, errr help
Frozen Flame
Member
Member
 
Joined: Wed Jun 29, 2005 10:31 am

Postby g-tang on Fri Jul 15, 2005 1:17 am

my elevator always starts without the playerclips or the button. can somebody tell me what i am doing wrong?
g-tang
Dumpling
Dumpling
 
Joined: Tue Jul 12, 2005 5:31 pm
Location: USOFA

Postby kaos4u on Wed Aug 17, 2005 8:22 am

Nice tutorial very easy to understand. However i tried doing everything you said and it didn't work. 1st the door is closed. 2nd nothing happens when you push the button, only the door breifly opens and closes real quick. I tried messing with many other settings and still couldn't get it to work right. Did this tutorial work for anyone? If so did you have to do anything that wasn't in this tutorial?
kaos4u
Just Joined
Just Joined
 
Joined: Wed Aug 17, 2005 8:17 am

Postby Cmpfreak88 on Sun Aug 21, 2005 8:44 am

I was just following along and did the same thing. Make sure your track paths are pointing to each other. The Next Track Path thing.

Yeah... and for some reason my clips aren't working... Not even on the sample map do the clips work. What's wrong?
Cmpfreak88
Member
Member
 
Joined: Fri Jul 15, 2005 10:48 pm

Postby AquilaPhamas on Mon Aug 29, 2005 3:02 am

Yeah... and for some reason my clips aren't working... Not even on the sample map do the clips work. What's wrong?


Ensure that the clips do not touch the models. Same for the people that are complaining that theyre elevators are invisible. Make sure no NODRAW brushes are touching your models because this causes the models to take on the vvis definition of the brush.
Image
AquilaPhamas
Dumpling
Dumpling
 
Joined: Mon Aug 29, 2005 2:08 am
Location: CT

Postby <niT> on Mon Nov 21, 2005 3:22 am

hey... i've got my elevator to work fine with a light that moves with it but the elevator is very jerky going up but very smooth going down. Is there anyway that i can make it smooth on the way up too???
<niT>
Dumpling
Dumpling
 
Joined: Mon Nov 21, 2005 3:19 am

Postby mendax on Mon Nov 21, 2005 3:52 am

I seem to have a wierd problem with this. Everything works fine, but when I play the location of the elevator is at is in the center of the map (0, 0, 0, where the colored lines are in Hammer) and it's facing a wierd angle.
Other than that, it's fine. I use noclip to get to it, start it up, and it goes right through the wall to where I want it to go. It just doesn't start out in the right place.
By the way, it does look fine in Hammer, it's just in-game.
EDIT: I fixed it, but now it doesn't do anything when I press the button.
mendax
Regular
Regular
 
Joined: Sun Oct 23, 2005 9:21 pm
Location: US
Next

Return to Tutorials

Who is online

Users browsing this forum: No registered users