Half-Life Re-imagined competition results on their way...
Check out Skewing textures in Hammer, our newest tutorial!
Welcome, csapdani, our newest member!

logo

Site Stuff

Reference

Maps

Community

ShoutBOX

Poll

Feeling Blue

What's your favourite shade of blue?

Azure

8

Cobalt

15

Turquoise

4

Cyan

7

Royal

3

Teal

3

Onliners

20 secs

Windawz

17 mins

Bruce

21 mins

Jessie

22 mins

Strider

23 mins

Admer456

24 mins

Solokiller

33 mins

Urby

Affiliates

A gaming and technology blog by TWHL admins Penguinboy and Ant. A music blog by TWHL users Ant and Hugh.

Door With Turning Handle

By Chris 'autolycus' Bokitch

Introduction

It's simple. You go up to a door, turn its handle, and then open it. But it seems like things work differently in Half-Life. Where are the doorknobs? Unfortunately, in Half-Life, it's impossible to bind one entity to another. Some mods (notably Spirit of Half-Life) have achieved this effect, but it sadly isn't available in normal Half-Life. Some situations can be faked though. This article covers how to make a door that has a handle that turns when it opens.

Setup

This door event breaks down into four physical pieces (the actual door, a fake door, a handle that starts in the closed position, and a handle that starts in the open position) and a set of control entities.


The Actual Door

The actual door is a func_door_rotating. Create it as you would normally, including as part of it the handle as it would appear in its open state (as shown above, assuming the handle would be pointing left/right when closed). Give it a Name (targetname) of door1. Set its Render Mode (rendermode) to Texture (2). This will make the door start invisible. Finally, set the Fire on close (netname) to closedoor1.


The Fake Door

The fake door is what the player will actually see at first. It has no handle attached to it and doesn't open. Create the fake door and turn it into a func_wall_toggle. Give it a Name (targetname) of fakedoor1.


Handle #1

Handle #1 is the door handle the player will first see when he sees the door. It is a func_rot_button. It should be created in the closed position. Give it a Name (targetname) of handle1a. Give it a Target (target) of opendoor1. Set its Master (master) to _handle1a. In the Flags properties, enable the Not solid flag along with any flags you need to make the button rotate correctly into the closed position.


Handle #2

Handle #2 is what the player will see when the door returns to its closed position. It will start in the open position and move to the closed position. It is also a func_rot_button. Create it in the open position as shown above. Give it a Name (targetname) of handle1b. Give it a Target (target) of lockdoor1. Set its Render Mode (rendermode) to Texture (2) so it starts invisible. Set its Master (master) to _handle1b. In the Flags properties, enable the Not solid flag along with any flags you need to make the button rotate correctly into the closed position.

Coordination


Ok, now to coordinate the event. This is where it gets ugly. Are you sure you want to make a door with a rotating handle? Allllright then, read on. One note about the control entities - their location is unimportant. They're used purely to control the four entities listed above.

Controls Entities 1 - 6

These entities control the On/Off state of the handles through the use of multisource and env_global entities.

  1. The first entity is an env_global. Set its Name (targetname) to enablehandle1a. Set the Global State to Set (globalstate) to g_handle1a. Set the Trigger Mode (triggermode) to On (1). Set the Initial State (initialstate) to On (1). In its Flags properties, enable the Set Initial State flag.

  2. The second entity is a multisource. Set its Name (targetname) to _handle1a. Set its Global State Master (globalstate) to g_handle1a.

  3. The third entity is an env_global. Set its Name (targetname) to disablehandle1a. Set the Global State to Set (globalstate) to g_handle1a. Set the Trigger Mode (triggermode) to Off (0). Set the Initial State (initialstate) to Off (0).

  4. The fourth entity is an env_global. Set its Name (targetname) to enablehandle1b. Set the Global State to Set (globalstate) to g_handle1b. Set the Trigger Mode (triggermode) to On (1). Set the Initial State (initialstate) to On (1).

  5. The fifth entity is a multisource. Set its Name (targetname) to _handle1b. Set its Global State Master (globalstate) to g_handle1b.

  6. The sixth entity is an env_global. Set its Name (targetname) to disablehandle1b. Set the Global State to Set (globalstate) to g_handle1b. Set the Trigger Mode (triggermode) to Off (0). Set the Initial State (initialstate) to Off (0). In its Flags properties, enable the Set Initial State flag.

Control Entities 7 - 12

These are the env_renders that control whether the actual door and handles are visible or not.

  1. Set the first env_render Name (targetname) to showdoor1. Set the Target (target) to door1.
  2. Set the second env_render Name (targetname) to hidedoor1. Set the Target (target) to door1.

  3. Set the third env_render Name (targetname) to showhandle1a. Set the Target (target) to handle1a.
  4. Set the fourth env_render Name (targetname) to hidehandle1a. Set the Target (target) to handle1a.

  5. Set the fifth env_render Name (targetname) to showhandle1b. Set the Target (target) to handle1b.
  6. Set the sixth env_render Name (targetname) to hidehandle1b. Set the Target (target) to handle1b.

Control Entities 13 - 15

These are multi_managers that control the three sequences of the event (opening the door, closing the door, locking the door).

  1. Give the first multi_manager a Name (targetname) of opendoor1. Turn off SmartEdit mode and add the following keys and values.

    • showdoor1, 0 - makes the normal door visible.
    • fakedoor1, 0 - turns off the fake door.
    • door1, 0 - activates (opens) the normal door.
    • hidehandle1a, 0 - hides handle #1.
    • disablehandle1a, 0 - disables handle #1.

  2. Give the second multi_manager a Name (targetname) of closedoor1. Turn off SmartEdit mode and add the following keys and values.

    • hidedoor1, 0 - hides the normal door.
    • fakedoor1, 0 - turns on the fake door.
    • showhandle1b, 0 - shows handle #2.
    • enablehandle1b, 0 - enables handle #2.
    • handle1b, 0.01 - activates (closes) handle #2.

  3. Give the third multi_manager a Name (targetname) of lockdoor1. Turn off SmartEdit mode and add the following keys and values.

    • showhandle1a, 0 - shows handle #1.
    • enablehandle1a, 0 - enables handle #1.
    • hidehandle1b, 0 - hides handle #2.
    • disablehandle1b, 0 - disables handle #2.

The End

So, as you can see, its a bit of a hassle to get a door with a rotating handle, but if you need or want to do it, it can be done. As you might be able to tell, the most important things to know when trying to create this type of illusion is how to use multisource, multi_manager, env_global, and env_render entities. The most important thing, from the players point of view, is that everything should integrate seamlessly. For all intents and purposes, the rotating handle is part of the door, as far as anyone playing the level is concerned.

Example

For a more concrete illustration, check out the example map linked below.