Complimentary Victory Lift: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Unicodifying, replaced: [[Image: → [[File: (2), See Also → See also)
 
(20 intermediate revisions by 9 users not shown)
Line 1: Line 1:
== Introduction ==
{{DISPLAYTITLE: Portal - Tutorial - Lift Platform}}
In this tutorial you will learn how to make a Complimentary Victory Lift in the Hammer Editor.
{{back | Portal Level Creation}}


=== The piston ===
This tutorial will show how to create the '''Lift Platform''' seen in the [[Portal]] test chambers. The lift usually starts in its raised position, and lowers when a certain object is activated, such as an energy pellet catcher or a switch. The lift then raises when the player steps on it.
First thing to do is to make the [[func_door|func_door]].
{{Note|Lift Platforms are usually activated by energy ball catchers or things that can be only activated once (non-togglable objects).}}


You can use '''mini_piston_inside.mdl''' or you can copy the fake piston from the example map provided with Portal.


I'm using the fake piston for the tutorial, you may want to use the [[clipping_tool|clipping_tool]] to cut the fake piston to the appropriate size. If you're using the model piston, then simply parent it to a [[func_door|func_door]] brush that is an appropriate size.
== Construction ==
 
=== Step 1 ===
Place your piston where you want it and give it the following parameters:
[[File:Lift lift.png|200px|thumb|right|The <code>lift</code> brush]]
::{| class=standard-table
Create a <code>16w*16l*128h</code> brush textured with <code>[[Tool textures#invisible|tools/toolsinvisible]]</code>. Tie this brush to a <code>[[func_door]]</code> entity and make sure all of its flags are unchecked. Next, set the following keyvalues on it:
!  Property Name || Value
{| class="standard-table sortable"
|-
|-
| Name || victory_lift
! Property Name !! Value
|-
|-
| Delay Before Reset || 0
| Name || lift
|-
|-
| Speed || 25
| Speed || 20
|-
|-
| Move Direction || (Use the top view to set this parameter) '''or''' Up '''or''' Down
| Start Sound || apc_engine_start
|}
 
=== Platform ===
Now you need something to stand on. Create a [[prop_dynamic|prop_dynamic]] and set its '''World Model''' to '''lift_platform.mdl''' or '''light_rail_platform.mdl''' and place it at the top of your piston.
 
Give the model the following parameters:
::{| class=standard-table
!  Property Name || Value
|-
|-
| Name || victory_lift_model
| Stop Sound || apc_engine_stop
|-
|-
| Parent || victory_lift
| Delay Before Reset || -1
|-
|-
| World Model || lift_platform.mdl '''or''' light_rail_platform.mdl
| Move Direction || 90 0 0
|}
|}
{{clr}}


Make sure to uncheck the '''Touch opens''' Flag.
=== Step 2 ===
[[File:Lift brush lift.png|200px|thumb|right|The <code>brush_lift</code> brush]]
Create a <code>24w*24l*136h</code> 12-sided cylinder and position it so it's in the same place as the <code>lift</code> brush. Tie it to a <code>func_brush</code> and set its ''Name'' to <code>brush_lift</code> and its ''Parent'' to <code>lift</code>.


=== Glass ===
Finally, texture the sides of the cylinder with <code>metal/metal_lift001</code>.
You'll notice there is no glass to stand on, so go ahead and make a 116L x 116W x 2H block and texture it with '''glass/glasswindow_frosted_004''' and place it where it should be. Set your grid size to '''2''' for easy placement.
{{clr}}


== The trigger ==
=== Step 3 ===
[[File:Lift model lift platform.png|200px|thumb|right|The <code>model_lift_platform</code> entity]]
[[File:Lift model lift platform2.png|200px|thumb|right|Positioning of the <code>model_lift_platform</code> entity]]
Create a <code>[[prop_dynamic]]</code> entity and set its ''Name'' to <code>model_lift_platform</code>, its ''Parent'' to <code>lift</code> and its ''World Model'' to <code>models/props/lift_platform.mdl</code>. Position it on top of the <code>brush_lift</code> brush so its origin is 2 units below the top of the brush.
{{clr}}


This tutorial assumes you have moderate knowledge of I/O's.
=== Step 4 ===
Add the Outputs to those which apply.
[[File:Lift glass.png|200px|thumb|right|The glass brush]]
[[File:Lift glass2.png|200px|thumb|right|Positioning of the glass brush]]
Create a <code>120w*120l*1h</code> brush. Texture the top and bottom sides of the brush with <code>glass/glasswindow_frosted_003</code>, and texture all of the sides with <code>[[Tool textures#nodraw|tools/toolsnodraw]]</code>. Position the brush so its in the middle of the <code>model_lift_platform</code> entity, with its bottom side being 6 units above the origin of <code>model_lift_platform</code>.
{{clr}}


=== Area trigger ===
[[File:Lift playerclip.png|200px|thumb|right|Playerclip brush]]
Encase the desired area with a brush textured with the trigger texture. Tie it to a [[trigger_multiple|trigger_multiple]] and add the following outputs:
[[File:Lift playerclip2.png|200px|thumb|right|Positioning of the playerclip brush]]
Next, create a <code>128w*128l*4h</code> brush textured with <code>[[Tool textures#playerclip|tools/toolsplayerclip]].</code> Position it so it surrounds the <code>model_lift_platform entity</code> with its bottom side being 4 units above the origin of <code>model_lift_platform</code>.


::{| class=standard-table
Now, select both the glass brush and the playerclip brush and tie them to a single <code>func_brush</code> entity. Set its ''Name'' to <code>lift_brush_2</code> and set its ''Parent'' to <code>lift</code>.
|| My Output || Target Entity || Target Input || Parameter || Delay || Only Once
{{clr}}
 
=== Step 5 ===
[[File:Lift trigger.png|200px|thumb|right|Trigger brush]]
[[File:Lift trigger2.png|200px|thumb|right|Positioning of the trigger brush]]
Create a <code>112w*128l*92h</code> brush textured with <code>[[Tool textures#trigger|tools/toolstrigger]]</code>. Tie it to a <code>[[trigger_multiple]]</code> entity and set its ''Name'' to <code>lift_up_trigger</code>, its ''Parent'' to <code>lift</code> and ''Start Disabled'' to <code>Yes</code>. Next, add the following outputs to it:
{| {{OutputsTable}}
| [[File:Io11.png]] || OnTrigger || lift || Close || &nbsp; || 0.00 || No
|-
|-
| [[Image:Io11.png]] || OnEndTouchAll || victory_lift || Close || <none> || 0.00 || No
| [[File:Io11.png]] || OnEndTouch || lift || Open || &nbsp; || 0.00 || No
|-
| [[Image:Io11.png]] || OnStartTouchAll || victory_lift || Open || <none> || 0.00 || No
|}
|}
{{clr}}


=== Button trigger ===
The Lift Platform is now completed and ready to be implemente in a map.
 
Add these outputs to both triggers on the button:
 
::{| class=standard-table
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
|-
| [[Image:Io11.png]] || OnEndTouchAll || victory_lift || Close || <none> || 0.00 || No
|-
| [[Image:Io11.png]] || OnStartTouchAll || victory_lift || Open || <none> || 0.00 || No
|}


=== Switch Trigger ===
== Implementation ==
[[File:Lift ingame.jpg|300px|thumb|right|Lift Platform in-game]]
=== Step 1 ===
Place the lift where it should be in the map. The top of the <code>lift_brush_2</code> playerclip brush should be 2 units below the floor level of the upper floor. If the lift needs to travel more than 128 units, stretch the <code>brush_lift</code> and <code>lift</code> brushes down to the lower floor level. The length of the <code>lift</code> brush determines how far the Lift Platform travels.


Add these outputs to the trigger on the switch:
=== Step 2 ===
Add an output to the entity that will activate the lift that sends the ''Open'' input to <code>lift</code> and the ''Enable'' input to <code>lift_up_trigger</code>. {{clr}}


::{| class=standard-table
== See also ==
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
*[[Portal Level Creation]]
|-
| [[Image:Io11.png]] || OnOut || victory_lift || Close || <none> || 0.00 || No
|-
| [[Image:Io11.png]] || OnPressed || victory_lift || Open || <none> || 0.00 || No
|}


And now your Complimentary Victory Lift is done! Just compile and test for errors!
[[Category:Portal]]
[[Category:Level Design]]
[[Category:Tutorials]]

Latest revision as of 08:32, 8 January 2024

Portal Level Creation

This tutorial will show how to create the Lift Platform seen in the Portal test chambers. The lift usually starts in its raised position, and lowers when a certain object is activated, such as an energy pellet catcher or a switch. The lift then raises when the player steps on it.

Note.pngNote:Lift Platforms are usually activated by energy ball catchers or things that can be only activated once (non-togglable objects).


Construction

Step 1

The lift brush

Create a 16w*16l*128h brush textured with tools/toolsinvisible. Tie this brush to a func_door entity and make sure all of its flags are unchecked. Next, set the following keyvalues on it:

Property Name Value
Name lift
Speed 20
Start Sound apc_engine_start
Stop Sound apc_engine_stop
Delay Before Reset -1
Move Direction 90 0 0

Step 2

The brush_lift brush

Create a 24w*24l*136h 12-sided cylinder and position it so it's in the same place as the lift brush. Tie it to a func_brush and set its Name to brush_lift and its Parent to lift.

Finally, texture the sides of the cylinder with metal/metal_lift001.

Step 3

The model_lift_platform entity
Positioning of the model_lift_platform entity

Create a prop_dynamic entity and set its Name to model_lift_platform, its Parent to lift and its World Model to models/props/lift_platform.mdl. Position it on top of the brush_lift brush so its origin is 2 units below the top of the brush.

Step 4

The glass brush
Positioning of the glass brush

Create a 120w*120l*1h brush. Texture the top and bottom sides of the brush with glass/glasswindow_frosted_003, and texture all of the sides with tools/toolsnodraw. Position the brush so its in the middle of the model_lift_platform entity, with its bottom side being 6 units above the origin of model_lift_platform.

Playerclip brush
Positioning of the playerclip brush

Next, create a 128w*128l*4h brush textured with tools/toolsplayerclip. Position it so it surrounds the model_lift_platform entity with its bottom side being 4 units above the origin of model_lift_platform.

Now, select both the glass brush and the playerclip brush and tie them to a single func_brush entity. Set its Name to lift_brush_2 and set its Parent to lift.

Step 5

Trigger brush
Positioning of the trigger brush

Create a 112w*128l*92h brush textured with tools/toolstrigger. Tie it to a trigger_multiple entity and set its Name to lift_up_trigger, its Parent to lift and Start Disabled to Yes. Next, add the following outputs to it:

  My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnTrigger lift Close   0.00 No
Io11.png OnEndTouch lift Open   0.00 No

The Lift Platform is now completed and ready to be implemente in a map.

Implementation

Lift Platform in-game

Step 1

Place the lift where it should be in the map. The top of the lift_brush_2 playerclip brush should be 2 units below the floor level of the upper floor. If the lift needs to travel more than 128 units, stretch the brush_lift and lift brushes down to the lower floor level. The length of the lift brush determines how far the Lift Platform travels.

Step 2

Add an output to the entity that will activate the lift that sends the Open input to lift and the Enable input to lift_up_trigger.

See also