Test Door (Portal 2)

From Valve Developer Community
Jump to navigation Jump to search
English (en)Français (fr)Русский (ru)Translate (Translate)

Stub

This article or section is a stub. You can help by expanding it.

A Test Chamber Door corresponds to the double round doors found in the regular testing courses. One of the sides displays Portal 2's Exit symbol.

Test Door

In the official levels, this type of door is used specifically in test chambers to show the beginning and the end of the test chamber, in order to separate unrelated puzzles (as opposed to Portal where the same type of door can be found in the middle of the course as an integral puzzle element).

Note.pngNote:In Portal 2 co-op, test chamber doors are not used to separate puzzles. Instead airlocks are used.

prop_testchamber_door is the main entity that creates the door visuals, collisions and sounds. Its corresponding instance makes use of func_areaportalwindows, tweaks, and further exploit prevention mechanisms.

To create a door, you will need to place a prop_testchamber_door and an entity that can activate it. You will need to set the Inputs and Outputs to open the door when activated, and close the door when deactivated.

If using a prop_dynamic, use logic flags such as SetAnimation to open it. If you want multiple inputs before it opens, have a math_counter entity with the MaxLegalValue field set to the number of connections. In this math counter, set its outputs to OnHitMax (prop_dynamic name) SetAnimation (animation name), and OnChangedFromMax (prop_dynamic name) SetAnimation (animation). In each entity that should trigger the prop_dynamic, have them add/subtract a value of one on activation/deactivation.

Manually Debugging Doors, Method 1

Sometimes the player or an object can get stuck inside a door and not get killed. To fix this you'll need:

  • One func_brush with the invisible (tools/toolsinvisible) texture applied to it
  • One trigger_hurt with the trigger (tools/toolstrigger) texture applied to it
  • One trigger_portal_cleanser with the trigger (tools/toolstrigger) texture applied to it

Each of these should be 128 units wide, 104 units high, and 8 units thick; they should all be centered in the door.

On your func_brush, set these keyvalues and flags:

Property Name Value
Name door_blocker
Flags Value
Physics Objects Yes

On your trigger_hurt, set these keyvalues:

Property Name Value
Name stuck_in_door_killer
Damage 1000
Damage Cap 1000
Damage Type CRUSH

On your trigger_portal_cleanser, set these keyvalues:

Property Name Value
Name stuck_in_door_killer

Now your prop_testchamber_door will need to use its outputs to control the above entities as follows:

My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnClose door_blocker Enable 0.25 No
Io11.png OnClose stuck_in_door_killer Enable 0.00 No
Io11.png OnOpen door_blocker Disable 0.00 No
Io11.png OnOpen stuck_in_door_killer Disable 0.00 No

Manually Debugging Doors, Method 2

This method is a little more complicated to set up, but it is also more humane in that it does not kill test subjects nor test objects. It may also open up unintended solutions in your puzzles, so be wary of using this method. To use this method, you'll need:

The func_brush and trigger_portal_cleanser should be 128 units wide, 104 units high, and 8 units thick. The trigger_multiple should be 128 units wide, 104 units high, and 16 units thick. All of these brush entities should be centered in the door.

On your func_brush, set these keyvalues and flags:

Property Name Value
Name door_blocker
Flags Value
Physics Objects Yes

On your first logic_branch, set these keyvalues:

Property Name Value
Name player_in_door_branch

On your second logic_branch, set these keyvalues:

Property Name Value
Name door_wants_to_close_branch

On your logic_branch_listener, set these keyvalues and outputs:

Property Name Value
Logic Branch 01 player_in_door_branch
Logic Branch 02 door_wants_to_close_branch
My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnAllFalse test_chamber_door Close 0.00 No

On your prop_testchamber_door, set these keyvalues and outputs:

Property Name Value
Name test_chamber_door
My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnClose door_blocker Enable 0.25 No
Io11.png OnClose stuck_in_door_fizzler Enable 0.00 No
Io11.png OnOpen door_blocker Disable 0.00 No
Io11.png OnOpen stuck_in_door_fizzler Disable 0.00 No

On your trigger_multiple, set these keyvalues and outputs:

Property Name Value
Name player_in_door_trigger
My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnStartTouch player_in_door_branch ToggleTest 0.00 No
Io11.png OnEndTouchAll player_in_door_branch ToggleTest 0.00 No

On your trigger_portal_cleanser, set these keyvalues:

Property Name Value
Name stuck_in_door_fizzler

To use all of this with a floor button for example, you'll need to use these outputs:

My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnPressed test_chamber_door Open 0.00 No
Io11.png OnPressed door_wants_to_close_branch ToggleTest 0.00 No
Io11.png OnUnPressed door_wants_to_close_branch ToggleTest 0.00 No