Tutorials

Elevator



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

View comments ( 32 )

Back to top