Elevator

Tutorial collection, comprehensive listings on main site.

Elevator

Postby Tutorial on Tue Apr 05, 2005 6:11 pm

category
General Half-Life 2/Entities

description
A simple lift.

keywords
creating, create, elevator, func_tracktrain, lift.

Part 1 - The Basic Setup


In this tutorial i will show you how to create an elevator using a func_tracktrain entity which will allow you to create a very dynamic elevator compared to just using a linear brush entity

First of all create 2 path_track entities, one for the start and one for the end of the elevator path

Now name each one how ever you see fit, for this tutorial i will call the top one P1 and the bottom one P2

Now create a brush, or group of brushes, to be used as the elevator and tie it (them) to a func_tracktrain entity and name it as you wish, for this tutorial i will name it Elevator_1

Now create a brush to be used as the trigger and tie it to a func_button

Now we will set up the rest of the perameters for the entities

First of all select both path_tracks and open their properties window (right click in 2D window>Properties or double click in 3D window if only a single entitiy is selected)

Now under the path_track properties select Orientation Type and set this to "No Change"

With both path tracks still selected go under the Outputs tab, click Add and set the fallowing

-My Output Named OnPass
-Targets Entities Named Elevator_1
-Via This Input SetSpeed
-With A Parameter Override of 0

Now while still in the properties window select each path track seperatly in the 3D view and select the Next Stop Target field and enter the name of the opsite path track, so for the path track named P1 you will set it's next stop target to P2 and for P2 you will set its next stop target to P1

Now select your func_tracktrain and go under the Flags tab and check No Pitch (X-rot) and No User Control now go back under the Class Info tab and set each field as fallows

-First Stop Target P1
-Max Speed (Units/Second) 64
-Change Velocity Linear BLend
-Change Angles Never (Fixed Orientation)
-Move Sound Metal_Barrel.Roll
-Move Ping Sound Metalgrate.StepLeft
-Start Sound Metal_Box.Strain
-Stop Sound Metal_Barrel.ImpactHard
-Min Move Sound Interval 1
-Max Move SOund Interval 2

You can set all of these to whatever you want accept for Change Angles and First Stop Target
Now we will move on to the func_button entity, select this entity and check the fallowing under the Flags tab

Don't Move, Toggle and Use Activates

Now go under the Outputs tab and click Add and in the new output set the fallowing

-My Output Named OnPressed
-Targets Entities Named Elevator_1
-Via This Input StartForward

Now you should have a working 2 stop elevator, as far as the func_button goes you can either parent it to the func_tracktrain or create a seperate func_button for the top and bottom of the elevator shaft depending on what type of elevator your creating

You can also parent other entities to the elevator to create a fully functional elevator with opening doors, lights etc. which i will cover in the 2nd part of this tutorial

Helpful links for this tutorial:

None



Part 2 - Adding Extras

Sorry for the delay, now on to part 2

In part 2 i will explain how to add extras to your elevator, i will use doors as my example

This part of the tutorial will use the same entity parameters as part 1 for the entities we have already created

I will be creating some basic doors that you would see somewhere like a hotel using brush based entities, you can use models if you like just use the same procedure for the point entity

First of all create a single func_door and make the brush cover half of the horizontal space of your elevator opening because we will be copy/pasting this door to the other half after we have it all set up

No go into the door's properties and under the Class Info tab set the fallowing parameters

-Name door_1
-Parent elevator_1
-Start Sound Metal_Box.Strain
-Stop Sound Metal_Barrel.ImpactHard
-Lip 2
-Move Direction (Pitch Yaw Roll) The direction you want the door to move

The Lip parameter tells the doors to stay protruded a certain distance from the direction they are closing toward which keeps them from disappearing into the wall

Now go under the Flags tab and make sure that everything is unchecked

Now copy/paste your func_door to the other side of your elevator opening and leave everything the same accept for Move Direction (Pitch Yaw Roll) which you will set to the opposite direction of your other door

Now go to your func_button and under the Outputs tab click add and set the fallowing for your new output

-My Output Named OnPressed
-Targets Entities Named door_1
-Via This Input Close

Then select your previous output which should be for elevator_1 and After A Delay in Seconds of to 2, this will tell the button to close the doors emidiatly and then move the elevator after 2 seconds have passed, depending on the size of your doors you might need to change this delay to suit your needs

Now select both of your path_tracks and go under the Outputs tab and click add and set the fallowing

-My Output Named OnPass
-Targets Entities Named door_1
-Via This Input Open
-After A Delay in Seconds of 0.5

Remember that you may need to change the delay depending on the size of your doors, for the doors im working with a delay of 0.5 is more quick and has a better flow for gameplay but 1-1.5 would be more realistic

So now you should have a perfectly working elevator with doors that open and close realistically, attaching any entity to an elevator uses pretty much the same process, for physics point entities you just set Entity 1 as the elevator so you could have physically simulated light hanging from the top of the elevator or even just a dynamic light that is parented with the elevator to keep the lighting constant

Helpful links for this tutorial:

None


Someth|ng W|cked
- Don't send PM's to this user -
Tutorial
Not A Real User
 
Joined: Sun Mar 06, 2005 11:00 pm

Postby Someth|ng W|cked on Thu Apr 07, 2005 2:22 am

Glad to see that my tutorials are being posted

If you want i will send you some pics to go with this tutorial when i get my system back from being repaired

It is sort of hard to go from a beast 3.2gig to a p3 550 with a gf3 but i should have my system back in less then a month
User avatar
Someth|ng W|cked
Regular
Regular
 
Joined: Thu Mar 24, 2005 7:48 am

Postby smeerkat on Thu Apr 07, 2005 12:36 pm

all tutorials should come with a sample map. :)
über dumpling.
User avatar
smeerkat
Regular
Regular
 
Joined: Sun Apr 03, 2005 5:36 pm
Location: Babylon 4

Postby Someth|ng W|cked on Thu Apr 07, 2005 12:48 pm

I actually had a map for this tutorial but i lost it along with 2 others i was working on becuase my system restarted durring saves, pissed me off so much . . .

Soon as i get my system back i will able to post more indepth tutorials with pics and example maps
User avatar
Someth|ng W|cked
Regular
Regular
 
Joined: Thu Mar 24, 2005 7:48 am

Postby White Kirby on Sat May 28, 2005 12:44 am

What about adding how to make multilevels (like 3) so if people need to have more than 2 (like i want) they can work it out
White Kirby
Dumpling
Dumpling
 
Joined: Fri May 27, 2005 8:36 pm

Postby Spartan on Sat May 28, 2005 1:01 am

How many more fricken elevator tuts are we going to have?
Spartan
Veteran
Veteran
 
Joined: Sat Oct 09, 2004 2:58 pm

Postby White Kirby on Sat May 28, 2005 2:29 am

well there arent any that ive seen that show how to make elevators with buttons that can do directly from Ground to lvl 4. or Roof to lvl 2. etc.
White Kirby
Dumpling
Dumpling
 
Joined: Fri May 27, 2005 8:36 pm

Postby RaccoonKing on Tue May 31, 2005 1:37 am

This is the best-written tut I think I've ever seen. It's obviously well-thought-out.

The only comment I have is this: when I try to open my door, WHILE the elevator is moving, it moves out, stops (the elevator keeps moving away from the door) then the door wakes up after a couple seconds and runs back to the elevator.

Most likely I implemented something wrong, or it's unavoidable. Thanks for the tut.
RaccoonKing
Been Here A While
Been Here A While
 
Joined: Wed May 18, 2005 2:15 pm

Postby novalin on Fri Jul 15, 2005 5:35 pm

I went thru all of the steps in part 1, and the elevator worked (CS:S). It is a two floor lift that starts on the bottom floor. But I am having a few issues I am hoping you can help me with:

- the elevator shakes as it goes down, but not up...
- the elevator stops on the top floor fine, but when I take it from the top floor to the bottom floor, it does not stop and goes back up to the top.
- i have a button model in my brush built elevator and I wanted to know how to make it move with my elevator. there is no parent option with it (its a prop_static) and it wont group with the brush.
- i want to put a breakable vent in the top of the elevator so players can jump down on the top of the lift and bust into it from above...I have the model for it found, but once again, need to know how to make it stay there and move with the elevator.

thanks.
User avatar
novalin
Regular
Regular
 
Joined: Tue Jun 07, 2005 9:19 am
Location: San Francisco

Postby g-tang on Sun Jul 17, 2005 3:00 am

novalin, i assume that you are using an elevator that is comprised of brushes, and not an elevator prop. for your vent, thats easy. cut a hole the size of your vent in the top of your elevator with the clipping tool, and put a prop_dynamic in there. change the world model to the vent, parent it to your elevator, and make sure you set "health override whatever whatever" to a number other than 0, so that it does not fall to the ground when the map loads. change your button to a brush, and place it where you want. change it to a func_button, parent it to the elevator, add the proper outputs, yadda yadda. if you look in the textures, there is one for an elevator button. (i use it so i know its there). as for the shaking problem, make sure that none of your track paths are too close to the wall. they pull the center of your func_tracktrain into line with their center, which will cause your elevator to move into the wall by a certain degree. this makes the elevator slower and causes it to jitter like crazy. i don't know about your last problem though.
g-tang
Dumpling
Dumpling
 
Joined: Tue Jul 12, 2005 5:31 pm
Location: USOFA

Postby novalin on Tue Jul 19, 2005 5:24 pm

vent:
I am not seeing health override for prop_dynamic.

elevator:
yes, it is brushes. i started a new one last night. also, my last one was touching one of the walls so im not sure if that would have caused the bouncing issue. Pathtracks are going straight up and down and are alligned right over each other.
however, it still does the thing where it goes to the 1st floor then goes right back up to the 2nd. i will get more information on this later (at work and internet isnt set up at home yet).

button:
i made the button a prop_dynamic and parented it to the elevator and it works great.
User avatar
novalin
Regular
Regular
 
Joined: Tue Jun 07, 2005 9:19 am
Location: San Francisco

Postby novalin on Wed Jul 20, 2005 5:09 pm

I got the vent to work by using 3 brushes for the top of the elevator, with the middle brush lined up with the vent and the top and bottom ones coming out a few untis farther to hold the prop_physics_mp in place and it works :)

So my main issue right now is the elevator not stop at the first floor when i take it from the top floor down to the first (it returns to the top floor).
User avatar
novalin
Regular
Regular
 
Joined: Tue Jun 07, 2005 9:19 am
Location: San Francisco

Postby novalin on Mon Jul 25, 2005 5:59 pm

got my elevator to stop correctly on each floor but i dont know how to make the light move with the elevator. i tried adynamic light that is parented to the elevator but when i run the game i dont see any light in there at all.
User avatar
novalin
Regular
Regular
 
Joined: Tue Jun 07, 2005 9:19 am
Location: San Francisco

Elevator help.

Postby Ghost49 on Mon Jul 25, 2005 11:41 pm

I know this topic may be a bit dead but I do need help. I followed the tutorial and did everything. Runs fine but it doesn't stop at any of the stops. If anyone can think of some thing instant msg me on AIM or please reply to this post. Thank you very much.

(Aim: AgentDoggit49)
Ghost49
Just Joined
Just Joined
 
Joined: Mon Jul 25, 2005 11:37 pm

Postby novalin on Tue Jul 26, 2005 9:28 pm

u might be the person i talked to yesterday, but jsut in case you arent, i got mine to stop corectly by doing this:

the output to my bottom pathtrack was blank and needed to be set up just like the top one which is as follows:

onpass - elevator01 - setspeed - 0 parameter - 0 delay - no (only once)

after setting both to this it worked correctly.

QUESTION: how do i get a light inside my elevator to move with the elevator?
User avatar
novalin
Regular
Regular
 
Joined: Tue Jun 07, 2005 9:19 am
Location: San Francisco
Next

Return to Tutorials

Who is online

Users browsing this forum: No registered users