Skip to end of metadata
Go to start of metadata

Swinging doors are a nice touch when a blocker happens to be a door. What happens is, when purchased, the door will swing on a hinge axis 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

zombie_cost

<any number>

script_noteworthy

<value>

  • Items highlighted in green are optional.
    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" (*quotes included!).
  • 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.

Door

Select the door script_brushmodel(s) or script_model(s) and give them the following KVP's:

Key

Value

script_string

<door_type>

script_transition_time

<any number>

script_sound

<soundalias>

  • Items highlighted in green are optional.
    By default, doors will default to the "rotation" move type. If you wish to change the door to a "sliding open" type, set the script_string key and replace '<door_type>' with "move" (*quotes included!).
  • 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.
  • 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).

Clips

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

Key

Value

script_noteworthy

clip

Targeting in Radiant

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.

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.

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.

Troubleshooting

The UGX Modtools Patch has a developer HUD which will help you identify script errors that may be preventing the doors from working. If after following this guide the doors do not work:

  • Load your map.
  • Type "developer 1" (without quotes) into the console.
  • Pause the game using ESC and press "Restart Game".

Now you should see "UGX Modtools Patch Developer Help Center" on the left side of your screen. It will list any errors it could identify. If nothing listed is relevant to the doors, then you need to re-read the guide and find your mistake manually. Be meticulous!

Credit: Treminaor