quake2 - trigger_elevator
is a very difficult entity to master and I would only recommend
going through this tutorial if you are a pretty experienced level
designer. What it is basically an elevator. That's the easiest
way I can explain it. Lets say there are 4 floors. You hit a button
on the 4th floor and the platform will come to the forth floor.
Hit a button on the 3rd floor and the platform will come to the
third floor or however you want to set it to do. There are other
easier ways to implement an elevator by using a func_train
but the trigger_elevator is more functional as working like a
true elevator but again I stress that it is a very difficult entity
Entities that will be used with the trigger_elevator:
make sure you are familiar how all these entities work before attempting the trigger_elevator
The first thing you need to do is to place the trigger_elevator entity somewhere in the level. This is not the actual elevator. In fact...this entity is not visual in the map, so it does not matter where you put this entity.
Now you need to give the trigger_elevator a targetname and a target. For this example lets give it a targetname of elevator and a target of train which will be the actual elevator. We havnt made the actual elevator object yet though. we will get to that next.
Now we will create the object that will be the actual elevator. Now you need to decide how you want your elevator to look. It could be simply a 1 brush platform or you could go all out and it could be a full blown 200 brush detailed elevator. Does not matter. When you are finished designing the elevator select it and turn it into a func_train. Yep, you heard it right...a func_train....I'll explain in a minute.
Now give the func_train you just made a targetname and a target. The targetname for this example will be train. The target will be to the first path_corner. Lets call this p1. So lets recall what we have done so far:
We have a trigger_elevator entity that is linked
to a func_train
entity which is linked to a path_corner
entity that we have not made yet.
Now we need to create the actual path the elevator will follow. These will be path_corner entities. We will place one at each area the elevator will stop. So if there are 4 floors then we will have to make 4 path_corners. So place path_corners at each floor the elevator will be stoping on INCLUDING the bottom floor.
It will take awhile to get the placing of the path_corners just right so that the elevator will look right.
You can get them precisely placed by positioning the exact
origin of the path_corner at the exact lower left corner (both
top and front views) of any func_train's *bounding box*. In
the case of s nice rectangular train, this is incredibly easy
to be absolutely precise.(thanks Freznor)
Now we are going to give each path_corner a targetname and a pathtarget. Give the first one a targetname of p1, second one of p2, all the way to p4 if you will be having a 4 floor elevator.
Each path_corner will also HAVE to have the key value pair pathtarget. What this is is a unique name of the elevator stop that the path_corner represents. So on this example lets say there are 4 floors. The first path_corner on the bottom floor will have a pathtarget of stop1. The second floor path_corner will have a pathtarget of stop2, third will have a pathtarget of stop3, and the fourth floor will have a pathtarget of stop4.
Now we are going to create the func_buttons that will trigger the elevator. So this means that each floor will have a func_button. So we will create 4 func_buttons for an elevator that will be stoping on 4 floors.
Now you must target each func_button to the trigger_elevator entity. So every func_button will have the key value pair target elevator, because we gave our trigger_elevator a targetname of elevator.
The final thing we have to do is give each func_button a key value pair of pathtarget. This should be set to the cooresponding targetname of the path_corner that you want the elevator to stop on when the button is pressed.
Recall that we have 4 path_corners each with a targetname of p1, p2, p3, and p4 respectfully. So if we wanted the elevator to take us from the top floor to the bottom floor we would set the pathtarget of the func_button on the fourth floor to p1, which is the targetname of the path_corner that is on the bottom floor. Pretty simple huh? yeah right.
As you can see this is a very difficult entity to use but it is very useful and very cool. It was also very hard for me to figure out since there is no comments or anything in the code. I had to decompile a bsp file and see how id did it in one of the mine levels. Not fun. =) Here is a diagram that I might help you out a bit
I definitly suggest you check out the [example
.map] map and see how I got mine to work. Any other questions
please post them in the discussion board.
to Tutorials Page...