Moving doors are a nice touch when a blocker happens to be a door. When purchased, the door will swing on a hinge axis or slide off to the side instead of just disappearing or flying away.
First you must create the door in Radiant. A swinging door blocker consists of these items:
If you need help creating any of the items, refer to the Creating Brushes in Radiant page.
Select the trigger_use brush(es) and give them the following KVP's:
Key |
Value |
---|---|
targetname |
zombie_door |
script_flag |
<zone_name> |
zombie_cost |
<any number> |
script_noteworthy |
<value> |
script_sound |
<soundalias> |
green
are optional.
zombie_cost
key and replace '<any number>' with a numerical value.
script_noteworthy
and replace "<value> with "electric_door" (without
quotes).
script_sound
key and replace '<soundalias>' with a valid soundalias name. If you
would not like any sound to be played other than the purchase noise, use
"none" (without quotes) for the soundalias name.
Select the door script_brushmodel(s) or script_model(s) and give them the following KVP's:
Key |
Value |
---|---|
spawnflags |
1 |
script_string |
<door_type> |
script_angles |
<rotation_angle> |
script_vector |
<vector> |
script_transition_time |
<any number> |
green
are optional.
script_transition_time
key and replace '<any_number>' with a numerical value (measured in
seconds).
Determining the correct value for the script_angles key requires a bit of thinking or trial and error depending on your understanding of angles and axis.
The format for this value is "x y z" (without quotes) where x is the angle of rotation on the x axis, y is the angle of rotation on the y axis, and z is the angle of rotation on the z axis. Generally for a regular door the z angle of rotation should always be 0.
To determine the X and Y value, you need to look at your door in Radiant. If you are using a script_model, this will be easy.
If you are using a script_model , simply select the script_model and rotate it to the position you would like it to rotate to when opened. Open the Entity Window and click the "angles" Key. Copy its value to your clipboard, then paste it as the value of your script_angles key.
If you are using a script_brushmodel , you need to do the following steps:
Now that you have created a rotation origin brush, select the origin brushmodel and rotate it in the direction you want the door to open. Open the Entity Window and click the "angles" Key. Copy its value to your clipboard, then paste it as the value of your script_angles key on the door brushmodel. Now delete the angles KVP from the origin brushmodel so that it snaps back to its original rotation.
note|If your door rotates towards you instead of away from you, reverse the
sign of the script_angles values. For example, 0 165 0 would become 0 -165
0.
Determining the correct value for the script_vector key is relatively straightforward. Select your door entity and move it to the position you would like it to move to when opened. Open the Entity Window and click the "origin" Key. Copy its value to your clipboard, then paste it somewhere safe for reference. Now press Ctrl+Z on your keyboard to move the door back to its original origin. Open the Entity Window and click the "origin" Key. Copy its value to your clipboard, then paste it somewhere safe for reference. Now, using a calculator, subtract the original X value from the moved X value, subtract the original Y value from the moved Y value, and subtract the original Z value from the moved Z value. You should end up with a new set of 3 numbers which are the difference between the original and moved positions, respectively. These 3 numbers are your script_vector value.
Select the clip script_brushmodel(s) and give them the following KVP:
Key |
Value |
---|---|
spawnflags |
1 |
script_noteworthy |
clip |
Now that you have created all of the necessary items and given them the
correct KVP's, it is time to link the items together using targeting.
In this case, the root entity is the trigger_use. If you have more than one
trigger_use, just pick one to link all entities to. Later we will include the
remaining trigger_use's.
The children of the trigger_use are the clip(s) and door model(s). Link them
to the root entity using the instructions above.
Once you have linked all the entities to the root trigger_use, copy the target KVP from the root trigger_use to each of the remaining trigger_use's. The lines should now be going from all trigger_use's.
Now that you have created one working zombie_door blocker, you can copy/paste it as many times as you want. Since we used targeting, the targetnames of the children are dynamic and will be regernerated for every copy. If you used multiple trigger_use's, you will need to manually edit the target KVPs for every copy, just as you did in section 1.3. Be sure to update the script_flag value if you copy the doors for a new zone volume.
Credit: Treminaor