|
|
|
| |||||||||||||||||||
Crushing Gordon
In this project:
1) Gordon opens a set of Double doors to enter a large room. 2) Doors close behind Gordon once inside. 3) Walls begin to move towards him. 4) Gordon gets squashed. To create the moving walls that squash Gordon I’ve used func_movelinear. This is a versatile entity which can be made to move in any direction. It can be used for Elevators, Lifts, Doors and Compactor walls like this. One thing that causes a problem for many mappers is the Move Direction. If you’re not sure about Pitch Yaw and Roll, (Y Z and X), take a look at this tutorial. Tip: If you’re still not sure there’s an easy method you can use. Create several of them with different Move Directions and compile you map. One of them should be moving in the direction you need. Note: At times your func_movelinear brushes map spawn facing the wrong direction. When this happens press Alt+P in Hammer to check for errors. Typically if you do this and use the Fix option it will repair your brush. To create func_movelinear simply create a brush the size required, press Ctrl+T and choose func_movelinear from the entity list then click Apply. Both of the walls have the same name so we can easily trigger them together. Notice that half of the wall, the upper half, is textured with tools/toolsinvisible. This creates an invisible part of the wall. I’ve done this to illustrate how you can give your func_movelinear the appearance of a smaller size. In this project the walls doing the work appear to be much shorter than they are.
The properties for the wall: Class: func_movelinear Name: wall01 Move Direction: (left) 0 270 0 (right) 0 90 0 Start Position: 0 Speed: 12 Move Distance: 160 Block Damage: 40 Sound Played when it starts: ambient/machines/wall_move1.wav (One wall only) Tip: To determine the needed Move Distance create a temporary brush the size of the distance you want your func_movelinear to move. Use this as a ruler by noting the unit dimensions; then delete this temporary brush. In this project there are 174 units from each wall to the center of the room. I don’t want the brushes to touch because it looks odd when Gordon dies between them, so I’ve allowed some space for dead Gordon by using a Move Direction of 160. In this project I’ve used a trigger_once to determine when the walls reach the center area. I could have used the Output OnFullyOpen from func_movelinear. You decide what’s best for your needs, the outcome is the same. To make sure only the walls can trigger that trigger_once I’ve applied a filter. The entity filter_activator_name is really simple to use and comes in very handy. This one has the name of the walls, wall01, as its Filter Name property. The Filter Mode is Allow entities that match criteria.
Inside the large room is another kind of trigger, trigger_hurt. When the walls reach the trigger_once it will activate the trigger_hurt. This is what will kill Gordon with a Damage Type of CRUSH. The properties for the trigger_hurt are: Start Disabled: Yes Damage: 999 Damage Cap: 100 Damage Type: CRUSH Damage Model: Normal Flags, Clients, Checked When Gordon steps into this room I’m using a trigger_once to close the doors behind him and start the walls moving: OnTrigger, double_doors, Close OnTrigger, double_doors, Lock OnTrigger, wall01, Open, 1.0
Notice that I’m allowing enough time for the doors to close and lock before starting the walls 1.0 seconds later. Also notice the position of this trigger_once, it is far enough away from the doors that Gordon doesn’t have time to jump back through the doors once it’s triggered. I’ve placed some prop_physics objects, Pallets and Crates, in the Crush area to illustrate they can also be squashed, and to offer a tip about in-game performance. I’ve given all of these prop_physics’s the same name with an Output back to themselves so they all break at the same time: OnHealthChanged, phys_objects, Break I’ve also applied the same wall filter so only the walls can damage them. The physics objects aren’t needed for the overall effect but if you do use breakable objects do be aware of the performance hit. Keep in mind that if you run this project but allow the Crates/Pallets to break independently you will experience a penalty on performance.
|