This article relates to the game "Portal". Click here for more information.

Test Chamber Door: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Portal tutorial on how to use the clipping tool...initial page.)
 
No edit summary
 
(36 intermediate revisions by 12 users not shown)
Line 1: Line 1:
=Goal=
{{Portal topicon}}
The goal is to use the [[Hammer Clipping Tool]] to cut a cylindrical shape out from a block to use as a Portal Door frame for the door created in the [[Creating a button and door]] Portal tutorial.
{{Lang}}__NOTOC__


=Overview=
[[Category:Portal]]
The most difficult shape to implement in a map is a large hole in a wall.  [[Reshaping_Solids#Carving|Carving]] does not leave the remaining sections in convenient symetrical shapes, so the Clipping Tool needs to be used.  The ideal method is to create the shape that will be cut out of the wall and keep it displayed alongside the section that is going to be clipped.  In this tutorial a sample Portal door frame has been provided with the Source SDK in the TestChmb_a_05 map.  Beginners are encouraged to have the door frame from the sample displayed in Hammer alongside the new one being created in the tutorial in order to better understand why cuts are being made.
[[Category:Level Design]]
[[Category:Tutorials]]


=The Procedure=
{{Subpage|[[Portal Level Creation]]}}
==Create the block brush==
1. Create a <code>128Lx8Wx128H</code> block brush with texture [[nodraw]].


2. Set Snap On Grid: 4 units and zoom to 2.30.
This tutorial will show step-by-step how to create the '''test chamber doors''' seen throughout the {{portal|1}} test chambers. Test chamber doors are often used to gate the player until they have completed a puzzle, but can also be used as a puzzle element themselves.
{{tip|Press {{key|[}} until the Grid: # in the bottom right status bar is 2 then press {{key|8}} in the active window and then press {{key|D}} twice.}}


[[Image:Hammer_ClippingTool_exmpl_01.png|150px]]
== Construction ==
=== Step 1 ===
Create a <code>32w*128l*128h</code> brush. Next use the [[Hammer Clipping Tool|clipping tool]] to create three horizontal clips at 24, 48 and 84 units from the top, respectively.


==Split it into upper and lower sections==
After that, select the second brush from the top and create a diagonal clip 48 units from the side of the brush at the top to 16 units in from the side at the bottom. Do the same thing on the other side of the brush and delete the wedge that remains in the middle.
3. Select the Clipping Tool and draw a horizontal line from side to side 36 units from the top.


4. Click the Clipping Tool button two more times until both the upper and lower sections are white then press {{key|Enter}}.
Next, select the brush below the previous brush and create a diagonal clip from 16 units in from the side at the top to the bottom side corner of the brush. Do the same on the other side and delete the remaining wedge.


[[Image:Hammer_ClippingTool_exmpl_02.png|150px]]
Now, select the bottommost brush and create a diagonal clip from the top side corner to 20 units in from the side at the bottom. Do the same thing on the other side of the brush, then delete the remaining wedge.


Finally, select all of the brushes and tie them to a {{Ent|func_detail}} entity. After that, texture the front and back sides with the same texture of the wall that the door is set into. Texture all of the remaining faces with <code>tools/toolsnodraw</code>.


5. Select the [[Hammer Selection Tool]] then click the Ungroup selected groups button [[Image:hammer_ungroupicon.jpg]] from the top [[Hammer Map Tools Toolbar]].
==== Gallery (These photos have 4 unit grid snap) ====
<gallery>
Image:Test door frame1.png|The starting brush
Image:Test door frame2.png|First horizontal clip
Image:Test door frame3.png|Second horizontal clip
Image:Test door frame4.png|Third horizontal clip
Image:Test door frame5.png|Diagonal clip
Image:Test door frame6.png|Ditto
Image:Test door frame7.png|Ditto
Image:Test door frame8.png|The brushes tied to a <code>func_detail</code> entity
Image:Test door frame9.png|The frame clipped and textured
</gallery>


6. Next, click in some empty space to unselect the brushes.
=== Step 2 ===
[[File:Test door prop frame.png|200px|thumb|right|The door frame prop]]
Create a {{Ent|prop_static}} entity and set its ''World Model'' to <code>models/props/door_01_frame_wide_reference.mdl</code>. Align the door frame model within the frame brushes.
{{clr}}


==Inscribe the lower section==
=== Step 3 ===
7. Now select just the lower section.
[[File:Test door door left.png|200px|thumb|right|The left door]]
[[File:Test door door right.png|200px|thumb|right|The right door]]
Create a <code>8w*56l*104h</code> brush textured with <code>tools/toolsnodraw</code>. Align it to the left of the center of the door frame, and tie this brush to a {{Ent|func_door}} entity. Make sure that all of its flags are unchecked and set the following keyvalues on it:
{| class="standard-table sortable"
|-
! Property Name !! Value
|-
| Name || door_left
|-
| Speed || 250
|-
| Stop Sound || Doors.FullClose8
|-
| Delay Before Reset || -1
|-
| Lip || 12
|-
| Move Direction || 0 270 0
|}


8. Set Snap On Grid: 2 units.
Next create an identical <code>8w*56l*104h</code> nodraw textured brush, but align it to the right of the center of the door. Tie this brush to a <code>func_door</code> entity, make sure all of its flags are unchecked, and set the following keyvalues:
{| class="standard-table sortable"
|-
! Property Name !! Value
|-
| Name || door_right
|-
| Speed || 250
|-
| Stop Sound || Doors.FullClose8
|-
| Delay Before Reset || -1
|-
| Lip || 12
|-
| Move Direction || 0 90 0
|}
{{clr}}


9. Select the Clipping Tool again and draw a line starting from the top of the lower section 22 units from the left down to the left edge at 44 units from the bottom then press {{key|Enter}}.
=== Step 4 ===
[[File:Test door prop door left.png|200px|thumb|right|The left door model]]
[[File:Test door prop door right.png|200px|thumb|right|The right door model]]
Create a {{Ent|prop_dynamic}} entity and set the following keyvalues on it:
{| class="standard-table sortable"
|-
! Property Name !! Value
|-
| Parent || door_right
|-
| World Model || models/props/door_01_rtdoor_reference.mdl
|-
| Name || model_door_right
|}
Align it so it covers <code>door_right</code>.


[[Image:Hammer_ClippingTool_exmpl_03.png|150px]]
Next, create another <code>prop_dynamic</code> entity and set the following keyvalues on it:
{| class="standard-table sortable"
|-
! Property Name !! Value
|-
| Parent || door_left
|-
| World Model || models/props/door_01_lftdoor_reference.mdl
|-
| Name || model_door_left
|}
Align this model so it covers <code>door_left</code>
{{clr}}


10. Now draw a line starting from the bottom of the lower section 22 units from the left up to the left edge at 44 units from the bottom then press {{key|Enter}}.
=== Step 5 ===
[[File:Test door lighting relative.png|200px|thumb|right|The <code>info_lighting_relative</code> entity]]
Create an {{Ent|info_lighting_relative}} entity in front of the door, about 56 units above the ground. Name this entity <code>lighting_relative</code>. Now set the ''Lighting Origin'' keyvalue of both <code>model_door_right</code> and <code>model_door_left</code> to <code>lighting_relative</code>.


[[Image:Hammer_ClippingTool_exmpl_04.png|150px]]


11. Repeat steps 9 and 10 for the right side.
The test chamber door is now finished and is ready to be implemented in a map.
{{clr}}


[[Image:Hammer_ClippingTool_exmpl_05.png|150px]]
== Implementation ==
[[File:Test door ingame.jpg|300px|thumb|right|The test chamber door in-game]]
=== Step 1 ===
Place the door within the wall the door should be in so that the sides of the frame brushes are flush with the wall. If the door is rotated, the ''Pitch Yaw Roll'' keyvalues of the doors must be altered so that the door opens in the right direction.


12. Select the Selection Tool then click the Ungroup selected groups button [[Image:hammer_ungroupicon.jpg]].
=== Step 2 ===
Set up the item that should open the door so that it sends the <code>Open</code> input to both <code>door_left</code> and <code>door_right</code> when the door should open, and the <code>Close</code> input when the door shoul close.


13. Next, click in some empty space to unselect the brushes.
== See also ==
 
* [[Portal Level Creation]]
14. Select the center section and press {{key|Delete}}.
 
[[Image:Hammer_ClippingTool_exmpl_06.png|150px]] [[Image:Hammer_ClippingTool_exmpl_07.png|150px]]
 
==Split then cut triangles from the top section==
15. Select the top section and select the Clipping Tool again and draw a line from the top middle down to the bottom middle to cut the top section in half.
 
[[Image:Hammer_ClippingTool_exmpl_08.png|150px]]
 
16. Select the Selection Tool then click the Ungroup selected groups button [[Image:hammer_ungroupicon.jpg]].
 
17. Next, click in some empty space to unselect the brushes.
 
18. Now select the top left section and select the Clipping Tool again and draw a line from the bottom edge 22 units from the left over to the right edge 20 units from the top then press {{key|Enter}}.
 
[[Image:Hammer_ClippingTool_exmpl_09.png|150px]]
 
19. Select the Selection Tool then click the Ungroup selected groups button [[Image:hammer_ungroupicon.jpg]].
 
20. Next, click in some empty space to unselect the brushes.
 
21. Now select the lower triangle and press {{key|Delete}}.
 
[[Image:Hammer_ClippingTool_exmpl_10.png|150px]]
 
22. Repeat the preceding steps 18 through 21 for the top right section.
 
==Group the pieces together and paint it==
23. Finally, select all 6 sections while holding down {{key|Ctrl}} then click the Group selected objects button [[Image:hammer_groupicon.jpg]].
 
[[Image:Hammer_ClippingTool_exmpl_11.png|150px]]
 
24. Select the frame in the 3D view and move it into place using the 2D views then texture it using the [[Hammer_Face_Edit_Dialog|Face Edit Sheet]] dialog by clicking the [[Hammer_Map_Tools_Toolbar#Toggle_Texture_Application_Shift.2BA|Toggle Texture Application Tool]]...don't use the [[Hammer_Map_Tools_Toolbar#Apply_Current_Texture_Shift.2BT|Apply Current Texture ]]tool in order to avoid applying textures to faces which won't be visible, thus won't need to be rendered. 
 
25. Select all sections of the frame while holding {{key|Ctrl}} down.
 
26. Select the desired texture in the Current texture dropdown combo box or click Browse and double click on the desired texture.
 
27. Select a Texture shift of X: 160 units using the Face Edit Sheet so that the texture will line up with the edges.
 
28. Click Apply.
 
[[Image:Hammer_ClippingTool_exmpl_12.png|150px]]
 
=The Finished Product=
 
[[Image:Hammer_ClippingTool_exmpl_13.png|150px]]

Latest revision as of 05:23, 6 January 2024

English (en)Translate (Translate)

This tutorial will show step-by-step how to create the test chamber doors seen throughout the Portal test chambers. Test chamber doors are often used to gate the player until they have completed a puzzle, but can also be used as a puzzle element themselves.

Construction

Step 1

Create a 32w*128l*128h brush. Next use the clipping tool to create three horizontal clips at 24, 48 and 84 units from the top, respectively.

After that, select the second brush from the top and create a diagonal clip 48 units from the side of the brush at the top to 16 units in from the side at the bottom. Do the same thing on the other side of the brush and delete the wedge that remains in the middle.

Next, select the brush below the previous brush and create a diagonal clip from 16 units in from the side at the top to the bottom side corner of the brush. Do the same on the other side and delete the remaining wedge.

Now, select the bottommost brush and create a diagonal clip from the top side corner to 20 units in from the side at the bottom. Do the same thing on the other side of the brush, then delete the remaining wedge.

Finally, select all of the brushes and tie them to a func_detail entity. After that, texture the front and back sides with the same texture of the wall that the door is set into. Texture all of the remaining faces with tools/toolsnodraw.

Gallery (These photos have 4 unit grid snap)

Step 2

The door frame prop

Create a prop_static entity and set its World Model to models/props/door_01_frame_wide_reference.mdl. Align the door frame model within the frame brushes.

Step 3

The left door
The right door

Create a 8w*56l*104h brush textured with tools/toolsnodraw. Align it to the left of the center of the door frame, and tie this brush to a func_door entity. Make sure that all of its flags are unchecked and set the following keyvalues on it:

Property Name Value
Name door_left
Speed 250
Stop Sound Doors.FullClose8
Delay Before Reset -1
Lip 12
Move Direction 0 270 0

Next create an identical 8w*56l*104h nodraw textured brush, but align it to the right of the center of the door. Tie this brush to a func_door entity, make sure all of its flags are unchecked, and set the following keyvalues:

Property Name Value
Name door_right
Speed 250
Stop Sound Doors.FullClose8
Delay Before Reset -1
Lip 12
Move Direction 0 90 0

Step 4

The left door model
The right door model

Create a prop_dynamic entity and set the following keyvalues on it:

Property Name Value
Parent door_right
World Model models/props/door_01_rtdoor_reference.mdl
Name model_door_right

Align it so it covers door_right.

Next, create another prop_dynamic entity and set the following keyvalues on it:

Property Name Value
Parent door_left
World Model models/props/door_01_lftdoor_reference.mdl
Name model_door_left

Align this model so it covers door_left

Step 5

The info_lighting_relative entity

Create an info_lighting_relative entity in front of the door, about 56 units above the ground. Name this entity lighting_relative. Now set the Lighting Origin keyvalue of both model_door_right and model_door_left to lighting_relative.


The test chamber door is now finished and is ready to be implemented in a map.

Implementation

The test chamber door in-game

Step 1

Place the door within the wall the door should be in so that the sides of the frame brushes are flush with the wall. If the door is rotated, the Pitch Yaw Roll keyvalues of the doors must be altered so that the door opens in the right direction.

Step 2

Set up the item that should open the door so that it sends the Open input to both door_left and door_right when the door should open, and the Close input when the door shoul close.

See also