Test Door (Portal 2)
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.
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).
prop_testchamber_door
is the main entity that creates the door visuals, collisions and sounds.
Its corresponding instance makes use of func_areaportalwindow
s, 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:
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:
- One
func_brush
with the invisible (tools/toolsinvisible
) texture applied to it - Two
logic_branch
es - One
logic_branch_listener
- One
prop_testchamber_door
- One
trigger_multiple
with the trigger (tools/toolstrigger
) texture applied to it - One
trigger_portal_cleanser
with the trigger (tools/toolstrigger
) texture applied to it
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
On your prop_testchamber_door
, set these keyvalues and outputs:
Property Name Value Name test_chamber_door
On your trigger_multiple
, set these keyvalues and outputs:
Property Name Value Name player_in_door_trigger
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: