Advanced Elevators
With some clever level designing, it is possible to make an elevator akin to one in a real-life one that'll move, have doors, and use buttons. Due to limitations to the map format and engine, our elevator won't be a perfect simulation, but it should be sufficient. We'll need to use trigger_elevator, func_train, and path_corner to accomplish our imitation elevator. Previous experience with entities is a must; this tutorial is neither short nor easy.
Quick Summary
To sum up all our steps quickly:
- Make the floors and make the walls. Leave room on a side for the elevator shaft;
- Create the invisible func_elevator entity anywhere on the map:
- Set
targetnametoelevator; - Set
targettocar.
- Set
- Create the actual moving elevator car:
- Create the elevator platform;
- Create the three walls of the car;
- Create the ceiling for the car;
- Create a large tall wall outside the car above it, making sure that it blocks the entrances to all the levels;
- Do the same below the car;
- Turn the car brushes into a func_train entity;
- Set
targetnametocar; - Set
targettolevel1(it will be targeted at a path_corner we will create).
- Create the path_corner to mark the level stop locations:
- For level one, insert the path_corner entity into your map at the lower left corner of your elevator car (don't forget to take into account the large tall walls above and below the car);
- Set
targetnametolevel1; - Set
pathtargettostop1; - For every other level, make a path_corner entity, remembering to change the level numbers in
level1andstop1to their respective floor numbers.
- Add the in-car level buttons:
- For a goto level one button, create a func_button entity;
- Set
targetnametoelevator; - Set
pathtargettolevel1; - Create a func_button for every floor;
- Duplicate the set of in-car buttons for each floor.
- Add the floor elevator buttons:
- Do the same kind of func_button as the in-car buttons but make one for each floor that goes to its respective floor.
- Create the elevator doors:
- Create a func_door on level one between the elevator car/shaft and the floor;
- Duplicate these doors for every level;
Step-by-step
Make the Structure
The elevator has to move you somewhere. Create the multi-floor building with one side to use for the elevator.
Create the func_elevator
You'll need to create the func_elevator entity somewhere on your map. It is not visible so you are free to put it anywhere. Then, set targetname to elevator and target to car. car will refer to the actual moving elevator car.
Create the Moving Car
Now we're onto creating the actual elevator car. Most of the car will be a platform with three walls and a ceiling.
In addition, there will be two walls: one above and one below. These two walls will prevent people on other floors from falling into the shaft. All of these components move as part of the car. Both the walls must be higher than the combined height of all the levels served.
In the above screenshot, the moving components of the elevator car are colored red. Note how the two walls above and below the actual car block players from falling into the shaft. The back wall of the elevator car is not part of the car itself (this is your choice).
Convert all the brushes that are part of the elevator car into a single func_train. Set targetname to car and target to level1 (it will be targeted at a path_corner we will create).
Creating the path_corner(s)
To define where the elevator stops, create path_corner entities for each level. Create a path_corner on the bottom of the car for every level. After you are done, shift all the path_corners down to compensate for the walls that are above and below the car. Set targetname to level1 and pathtarget to stop1. For other floors, change the 1 in level1 and stop1 to the respective floor level number.
The path_corners are brown in the above screenshot. Two out of three are showing. The first path_corner for floor one is below the image. Note how much the path_corners have been shifted down from where the levels truly are. You must consider the whole car when working with path_corner placements. We recommend creating the path corners in their right place and shifting all of them down later.
Creating the In-Car Buttons
Create a func_button and set targetname to elevator. Set pathtarget to level1 or whatever level you want the elevator to go to when the button is triggered. You should put this on every level. In the screenshot below, note how there are set of buttons for the three levels in the map.
Creating the Out-of-Car Buttons
Do the same thing for the in-car buttons but do not put them in the car. You need to put this button on every level or there will be no way to call the car to your floor.
Adding the Doors
The doors will be triggered by proximity from a player. We do not have to worry about players falling into the shaft because of the two walls above and below the car preventing this. The doors will still open, but it won't be more than just a cosmetic problem.
Done!
You should be done!
Issues
- Getting stuck will kill you. This can be disabled but some malicious player could block the elevator.
- Getting stuck in the car between the car buttons will kill you. This can be fixed by making an "indent" in the control panel so the buttons don't stick out. It can also be done by adding a see-through shoot-through brush that cannot be walked through.
- When going down or up, if you are too close to the elevator entrance, all the doors will open as you pass them.
Extensions
- In-car floor numbers: This is easily possible. The numbers will have to be somewhere where the doors aren't are (vertically). Remember to make the floor numbers in an indent or they may kill players.
| Attachment | Size |
|---|---|
| _advelevator.map | 21.33 KB |
| _advelevator.bsp | 42.99 KB |
