Skip to end of metadata
Go to start of metadata

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.

 

WARNING: This tutorial can only be used if you have applied the UGX Modtools Patch to your World at War installation. To install the patch, refer to "Installing the Files"  in the  Modtools Installation Guide.

Preparation

Items needed

First you must create the door in Radiant. A swinging door blocker consists of these items:

  • One or more trigger_use brushes
  • One or more door script_brushmodels or script_models
  • One or more clip script_brushmodels which prevent players from walking through the closed door

If you need help creating any of the items, refer to the Creating Brushes in Radiant page.

Setting the KVP's

NOTE: KVP is an abbreviation for "Key-Value Pair". When entering a KVP in the Radiant Entity Window, ensure that you have the entity selected first. If you do not have an entity selected, Radiant will automatically add the KVP to the "worldspawn" entity. This is BAD and will likely cause your map to crash while loading! In these pages, KVP's are referred to in this format: Key | Value. Note they are separated by a pipe ( | ) character. This character should be ignored when entering the Key-Value Pair.
To properly add a KVP to an entity:

  • Select the entity by holding the Shift key on your keyboard followed by clicking the entity(ies) that you wish to add a KVP to.
  • Enter the first value (this is the Key) into the text field labeled "Key"
  • Enter the second value (this is the Value) into the text field labaled "Value".
  • Press the Enter key on your keyboard to save the KVP to the entity. You should see the KVP appear in the entity's KVP table (located above the Key text field).

Triggers

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>

  • Items highlighted in green are optional.
  • script_flag's value should be set to the zone name the door unlocks. This is not specifically needed if the door doesn't lead to a new zone.
  • By default, zombie_cost sets itself to 1000. If you would like to set a custom price, set the zombie_cost key and replace '<any number>' with a numerical value.
  • By default, doors can be opened regardless of the power-switch status on the map. If you would like the door to be un-buyable until the power-switch is activated, set the script_noteworthy and replace "<value> with "electric_door" (without quotes).
  • By default, "door_slide_open" is played when a door opened. If you would like to use a custom sound, set the 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.

Door

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>

  • Items highlighted in green are optional.
  • The script_string key can only have two values: "rotate" and "move" (without quotes). "rotate" will make this a swinging door, and "move" will make this a sliding door.
  • The script_angles key is only needed for "rotation" type doors. If you have set your door to the "move" type, you do not need this KVP. See the appropriate section below to determine what to enter for this value.
  • The script_vector key is only needed for "move" type doors. If you have set your door to the "rotate" type, you do not need this KVP. See the appropriate section below to determine what to enter for this value.
  • By default, doors take 1.0 seconds to transition from closed to opened. If you would like to use a custom transition time, set the script_transition_time key and replace '<any_number>' with a numerical value (measured in seconds).

Determining Rotation Values

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:

  • Create a script_brushmodel in the shape of a square. Make it about the size of a script_struct, but the size isn't crucial.
  • Position the brush at the lower left or right corner of your door, whichever side is "hinged". The center of this brush is going to be the point of rotation for your door.
  • Apply the orange-colored "origin" texture to the brushmodel. This texture can be found by going to Textures -> Usage -> Tools in Radiant. To reset your texture filter afterwords, select All in the Usage menu.
  • Select the origin script_brushmodel first, then select your door brushmodel. Press W to link them.

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 Vector Values

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.

Clips

Select the clip script_brushmodel(s) and give them the following KVP:

Key

Value

spawnflags

1

script_noteworthy

clip

Targeting in Radiant

NOTE: "targeting" is a method for linking entities together in a group. Targeting has menu useful applications, such as controlling an entity that has multiple pieces. For example, the Mystery Box uses targeting to link each separate script_model part of the box to the main trigger_use. Targeting generates automatic targetname and target KVP's on the affected entities. When two items are properly linked together, a red or blue line is drawn from the main entity to each of its targets/links in Radiant.
To properly target one item to another:

  • Determine which of the affected entities is going to be the "root entity". The root entity is the entity that will be referenced by name in script. Root entities are found in script by using getEnt("root_entity_targetname", "targetname");.
  • Determine which of the affected entities is going to be the target/link. The target/link entity(ies) are the "children" of the root entity and do not need specific targetnames. Target/link entities are found in script by using getEnt(root_entity.target, "targetname");
  • Deselect all items by pressing ESC on your keyboard
  • Select the root entity first.
  • Next, select one of the target/link entities and press W on your keyboard. This will create the link between the two entities. Repeat this step for all target/link children of the root entity until all entities have red or blue lines connecting them to the root entity.

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.

Finishing Up

Creating copies of the Door

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