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).
 is the main entity that creates the door visuals, collisions and sounds.
Its corresponding instance makes use of 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 , 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 with the invisible (tools/toolsinvisible) texture applied to it
*One with the trigger (tools/toolstrigger) texture applied to it
*One 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
	OnClose 	door_blocker 	Enable 	 	0.25 	No
	OnClose 	stuck_in_door_killer	Enable 	 	0.00 	No
	OnOpen 	door_blocker 	Disable 	 	0.00 	No
	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:
*One with the invisible (tools/toolsinvisible) texture applied to it
*Two es
*One 
*One 
*One with the trigger (tools/toolstrigger) texture applied to it
*One 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
::
	My Output 	Target Entity 	Target Input	Parameter	Delay	Only Once
	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
	OnClose 	door_blocker 	Enable 	 	0.25 	No
	OnClose 	stuck_in_door_fizzler	Enable 	 	0.00 	No
	OnOpen 	door_blocker 	Disable 	 	0.00 	No
	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
	OnStartTouch 	player_in_door_branch	ToggleTest 	 	0.00 	No
	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
	OnPressed 	test_chamber_door 	Open 	 	0.00 	No
	OnPressed 	door_wants_to_close_branch	ToggleTest 	 	0.00 	No
	OnUnPressed	door_wants_to_close_branch	ToggleTest 	 	0.00 	No
Category:Portal 2 Level Design
Category:Portal 2 Tutorials