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

Panels: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(This article is already self-explanatory, no need for a separate tutorial)
(replace disambig note with Template:For)
 
(16 intermediate revisions by 9 users not shown)
Line 1: Line 1:
{{otherlang2
{{lang|Panels}}{{p2 topicon}}
|fr=Panels:fr
<span style="color:white; font-weight:bold"> {{For|about=the [[Portal 2]] puzzle element|the base VGUI element|[[panel]]|}} </span>
|ru=Panels:ru
}}
 
[[File:Portal2_panels.jpg|thumb|right|300px|"The planks of tomorrow!" <br>- '''Cave Johnson''']]
[[File:Portal2_panels.jpg|thumb|right|300px|"The planks of tomorrow!" <br>- '''Cave Johnson''']]
 
{{portal2}} [[Panels]] are architectural elements used throughout {{Portal2|3}}. They are individually positioned so that, together, they form the test chamber. Because the panels are moved individually by robotic arms, the room can react to the player. They can form stairs, new ledges, open like doors, and tend to convey a sense that the room itself is alive.
'''Panels''' are architectural elements used throughout [[Portal 2]]. They are individually positioned so that, together, they form the test chamber. Because the panels are moved individually by robotic arms, the room can react to the player. They can form stairs, new ledges, open like doors, and tend to convey a sense that the room itself is alive.


== Creating Panels ==
== Creating Panels ==
 
1. Create a {{ent|prop_dynamic}} entity with the following settings:
1. Create a [[prop_dynamic]] entity with the following settings:
::{| class=standard-table
::{| class=standard-table
!  Property Name || Value
!  Property Name || Value
Line 20: Line 15:
| HoldAnimation || true
| HoldAnimation || true
|-
|-
| Collision || Not Solid
| Collisions || Not Solid
|}
|}


2. Create a <code>256Lx256Wx32H</code> block brush above the model. Tie it to a [[func_brush]] entity with the following settings:
2. Create a <code>32Lx32Wx2H</code> block brush above the model, in the space between the model and its origin. Tie it to a {{ent|func_brush}} entity with the following settings:
::{| class=standard-table
::{| class=standard-table
!  Property Name || Value
!  Property Name || Value
Line 29: Line 24:
| Name || panel1_brush
| Name || panel1_brush
|-
|-
| Parent || panel1
| Parent || panel1,panel_attach
|}
|}


3. Create a [[logic_auto]] entity and set up the output as follows:
{{note|You'll notice that the Parent value has been set to <code>panel1,panel_attach</code>, which is not the name of a real entity. This is a special syntax: the text after the comma (<code>panel_attach</code>) is not a part of the name, but indicates an [[attachment point]], which is used to make the brush follow the animation of the <code>prop_dynamic</code>. Hammer doesn't properly recognize this syntax so it will appear red, but it works in-game.}}
::{| class=standard-table
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
|-
| [[Image:Io11.png]] || OnMapSpawn || panel1_brush || SetParentAttachmentMaintainOffset || panel_attach || 0.00 || Yes(?)
|}


Now the func_brush can follow the animation of the prop_dynamic.
4. Create a {{ent|logic_relay}} with the following settings:
 
4. Create a [[logic_relay]] with the following settings:
::{| class=standard-table
::{| class=standard-table
!  Property Name || Value
!  Property Name || Value
Line 51: Line 39:
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
|-
|-
| [[Image:Io11.png]] || OnTrigger  || panel1 || SetAnimation || (ANIMATION NAME) || 0.00 || Yes(?)
| [[File:Io11.png]] || OnTrigger  || panel1 || SetAnimation || (ANIMATION NAME) || 0.00 || Yes(?)
|}
|}


== List of panels attachments ==
{{tip|Use the Model tab of the entity properties window to view available animations.}}
 
== List of Panel Models and Attachments ==
 
There are a number of other panel models in Portal 2 which can be used instead of the standard one. Make sure to use the corresponding attachment point name instead of <code>panel_attach</code>, if applicable. Models that do not animate can be placed as {{ent|prop_static}} entities, which do not count towards the entity limit.


''Note: Idle / Static models do not move. These are strictly aesthetic.''
----
----
{|class="prettytable"
{|class="prettytable"
Line 66: Line 57:
| anim_wp\arm_interior_192\arm_interior_128.mdl
| anim_wp\arm_interior_192\arm_interior_128.mdl
| Yes
| Yes
| GLASS - N/A
| N/A
|-
|-
| anim_wp\arm_interior_192\arm_interior_192.mdl
| anim_wp\arm_interior_192\arm_interior_192.mdl
| Yes
| Yes
| GLASS - N/A
| N/A
|-
|-
| anim_wp\arm_interior_192\video_arm.mdl
| anim_wp\arm_interior_192\video_arm.mdl
Line 106: Line 97:
| anim_wp\telescope_arm_128\telescope_arm_128_glass.mdl
| anim_wp\telescope_arm_128\telescope_arm_128_glass.mdl
| Yes
| Yes
| GLASS - panel_top
| panel_top
|-
|-
| anim_wp\telescope_arm_128\telescope_arm_128_idle.mdl
| anim_wp\telescope_arm_128\telescope_arm_128_idle.mdl
Line 118: Line 109:
| anim_wp\telescope_arm_128\telescope_arm_128x256.mdl
| anim_wp\telescope_arm_128\telescope_arm_128x256.mdl
| Yes
| Yes
| GLASS - panel_top
| panel_top
|-
|-
| anim_wp\telescope_arm_trans\telescope_arm_trans.mdl
| anim_wp\telescope_arm_trans\telescope_arm_trans.mdl
| Yes
| Yes
| GLASS - panel_attach
| panel_attach
|-
|-
| props_livingwall\armliving64x64.mdl
| props_livingwall\armliving64x64.mdl
| Yes
| panel_attach
|-
| anim_wp\arm_4panel.mdl
| Yes
| Yes
| panel_attach
| panel_attach
|}
|}
----
----


== Animation Playback Rate ==
== Animation Playback Rate ==
Sometimes it might be required for an arm (or any other [[prop_dynamic]]) to play its animation faster or slower. The playback rate of a [[prop_dynamic]] entity is expressed in numbers as representation of percentage, where 1 is equivalent to 100%, 2 is 200%, 0.5 is 50%, 0 is 0% of the animation playback rate (note that 0 will stop the animation completely). There are two ways to change default playback rate.
Sometimes it might be required for an arm (or any other {{ent|prop_dynamic}}) to play its animation faster or slower. The playback rate of a <code>prop_dynamic</code> entity is expressed in numbers as representation of percentage, where 1 is equivalent to 100%, 2 is 200%, 0.5 is 50%, 0 is 0% of the animation playback rate (note that 0 will stop the animation completely). There are two ways to change default playback rate.


The first method is easier and applied to all of animation of a particular [[prop_dynamic]]. The playback rate can be assigned to the arm and this will have a constant effect on the arm's animations playback rate (it will always be playing any animations at that set rate). In order to do so an new output need to be added in the arm's properties:
The first method is easier and applied to all of animation of a particular <code>prop_dynamic</code>. The playback rate can be assigned to the arm, and this will have a constant effect on the arm's animations playback rate (it will always be playing any animations at that set rate). In order to do so, a new output need to be added in the arm's properties:


::{| class=standard-table
::{| class=standard-table
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
|-
|-
| [[Image:Io11.png]] || OnAnimationBegun || !self || SetPlaybackRate || 5 || 0.00 || No
| [[File:Io11.png]] || OnAnimationBegun || !self || SetPlaybackRate || 5 || 0.00 || No
|}
|}


Above output will make an arm to play all of its animations 5 times faster. The ''!self'' is a special wildcard that selects the entity that is firing that output (arm selects itself).
The above output will make an arm to play all of its animations 5 times faster. <code>[[targetname|!self]]</code> is a special wildcard that selects the entity that is firing that output (the arm selects itself).
 


The second way of setting up the playback rate is more complex but also more flexible. The triggering entity (trigger_once etc.) has to set the following outputs:
The second way of setting up the playback rate is more complex but also more flexible. The triggering entity (e.g., {{ent|trigger_once}}) has to set the following outputs:


::{| class=standard-table
::{| class=standard-table
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
|-
|-
| [[Image:Io11.png]] || OnStartTouch|| arm_0 || SetAnimation || pitflings_angled_01 || 0.00 || No
| [[File:Io11.png]] || OnStartTouch|| arm_0 || SetAnimation || pitflings_angled_01 || 0.00 || No
|-
|-
| [[Image:Io11.png]] || OnStartTouch|| arm_0 || SetPlaybackRate || 2 || 0.01 || No  
| [[File:Io11.png]] || OnStartTouch|| arm_0 || SetPlaybackRate || 2 || 0.01 || No  
|}
|}


Above set-up, when triggered will cause ''arm_0'' to start animation, one hundredth second later the animation playback will be increased to 200% (note that if both outputs were fired at the same time the playback rate will remain at default - 1).
When triggered, the above setup will cause <code>arm_0</code> to start animation. One hundredth second later, the animation playback will be increased to 200% (note that if both outputs were fired at the same time, the playback rate will remain at default—1).


== Powerup Panels ==
== Powerup Panels ==
 
For some themes in {{Portal2|2}}, panels can be seen doing powerup animations—starting limp and lifeless, then "waking up" and moving back into their proper position. Done correctly, this can make your map feel far more dynamic and will look more realistic for the theme.
For some themes in Portal 2, panels can be seen doing powerup animations - starting limp and lifeless, then 'waking up' and moving back into their proper position. Done correctly, this can make your map feel far more dynamic and will look more realistic for the theme.


Creating these panels, however, is a little different from ordinary panels. This is how Valve does it:
Creating these panels, however, is a little different from ordinary panels. This is how Valve does it:


1. Create a [[prop_dynamic]] entity with the following settings:
1. Create a {{ent|prop_dynamic}} entity with the following settings:
::{| class=standard-table
::{| class=standard-table
!  Property Name || Value
!  Property Name || Value
Line 172: Line 166:
| HoldAnimation || true
| HoldAnimation || true
|-
|-
| Collision || Not Solid
| Collisions || Not Solid
|-
|-
| Default Animation || powerup(X_0Y)idleend
| Default Animation || powerup(X_0Y)idleend
|}
|}


{{note|There is a huge amount of powerup animations to choose from, starting from powerupA_01. Choose whatever fits best.}}
{{note|There is a huge amount of powerup animations to choose from, starting from <code>powerupA_01</code>. Choose whatever fits best.}}


2. Create a brush above the model, making sure it fits, and is aligned to, the panel face. Tie it to a [[func_brush]] entity with the following settings:
2. Create a brush above the model, making sure it fits the panel face and is aligned to it. Tie it to a {{ent|func_brush}} entity with the following settings:
::{| class=standard-table
::{| class=standard-table
!  Property Name || Value
!  Property Name || Value
Line 185: Line 179:
| Name || panel1_brush
| Name || panel1_brush
|-
|-
| Parent || panel1
| Parent || panel1,panel_attach
|}
|}


3. Create a [[logic_auto]] entity and add the following outputs:
3. Create a {{ent|logic_auto}} entity and add the following outputs:
::{| class=standard-table
::{| class=standard-table
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
|-
|-
| [[Image:Io11.png]] || OnMapSpawn || panel1_brush || SetParentAttachmentMaintainOffset || panel_attach || 0.10 || Yes(?)
|[[File:Io11.png]] || OnMapSpawn || panel1 || SetAnimation || powerup(X_0Y)idle || 0.50 || Yes(?)
|-
|[[Image:Io11.png]] || OnMapSpawn || panel1 || SetAnimation || powerup(X_0Y)idle || 0.50 || Yes(?)
|}
|}


{{note|You can use any delay, but make sure the 'SetParentAttachmentMaintainOffset' output happens BEFORE the 'SetAnimation' one.}}
4. Create a {{ent|logic_relay}} with the following settings:
 
 
4. Create a [[logic_relay]] with the following settings:
::{| class=standard-table
::{| class=standard-table
!  Property Name || Value
!  Property Name || Value
Line 210: Line 199:
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
|-
|-
| [[Image:Io11.png]] || OnTrigger  || panel1 || SetAnimation || powerup(X_0Y) || 0.00 || Yes(?)
| [[File:Io11.png]] || OnTrigger  || panel1 || SetAnimation || powerup(X_0Y) || 0.00 || Yes(?)
|}
|}


Now just add a trigger somewhere and activate the relay - a [[trigger_look]] works great for this.
Now just add a trigger somewhere and activate the relay. A {{ent|trigger_look}} works great for this.
 


The idle powerup animations are horribly off-grid in Hammer, and are therefore impossible to correctly parent the brush to.
The idle powerup animations are horribly off-grid in Hammer, and are therefore impossible to correctly parent the brush to.
Line 220: Line 208:


== See also ==
== See also ==
* [[Panels Rotate]]
* [[Creating rotating panels]]
* [[Entity Hierarchy (parenting)]]


[[Category:Portal 2 Level Design]]
[[Category:Portal 2 Level Design]][[Category:Portal 2 Tutorials]]
[[Category:Portal 2 Tutorials]]

Latest revision as of 22:27, 18 July 2025

English (en)Français (fr)Русский (ru)中文 (zh)Translate (Translate)
This article is about the Portal 2 puzzle element. For the base VGUI element, see panel.
"The planks of tomorrow!"
- Cave Johnson

Portal 2 Panels are architectural elements used throughout Portal 2. They are individually positioned so that, together, they form the test chamber. Because the panels are moved individually by robotic arms, the room can react to the player. They can form stairs, new ledges, open like doors, and tend to convey a sense that the room itself is alive.

Creating Panels

1. Create a prop_dynamic entity with the following settings:

Property Name Value
World Model models/anim_wp/room_transform/arm64x64_interior.mdl
Name panel1
HoldAnimation true
Collisions Not Solid

2. Create a 32Lx32Wx2H block brush above the model, in the space between the model and its origin. Tie it to a func_brush entity with the following settings:

Property Name Value
Name panel1_brush
Parent panel1,panel_attach
Note.pngNote:You'll notice that the Parent value has been set to panel1,panel_attach, which is not the name of a real entity. This is a special syntax: the text after the comma (panel_attach) is not a part of the name, but indicates an attachment point, which is used to make the brush follow the animation of the prop_dynamic. Hammer doesn't properly recognize this syntax so it will appear red, but it works in-game.

4. Create a logic_relay with the following settings:

Property Name Value
Name relay_panel1_animation

and the following outputs:

My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnTrigger panel1 SetAnimation (ANIMATION NAME) 0.00 Yes(?)
Tip.pngTip:Use the Model tab of the entity properties window to view available animations.

List of Panel Models and Attachments

There are a number of other panel models in Portal 2 which can be used instead of the standard one. Make sure to use the corresponding attachment point name instead of panel_attach, if applicable. Models that do not animate can be placed as prop_static entities, which do not count towards the entity limit.


Model Path Animated Panel Attachment Name
anim_wp\arm_interior_192\arm_interior_128.mdl Yes N/A
anim_wp\arm_interior_192\arm_interior_192.mdl Yes N/A
anim_wp\arm_interior_192\video_arm.mdl Yes monitor_attach
anim_wp\arm_interior_192\video_arm_big.mdl Yes monitor_attach
anim_wp\circle_shield\circle_shield.mdl Yes panel_top
anim_wp\framework\circle_shield_static.mdl No N/A
anim_wp\room_transform\arm64x64_interior.mdl Yes panel_attach
anim_wp\room_transform\arm64x64_interior_rusty.mdl Yes panel_attach
anim_wp\telescope_arm\telescope_arm.mdl Yes panel_top
anim_wp\telescope_arm_128\telescope_arm_128.mdl Yes panel_top
anim_wp\telescope_arm_128\telescope_arm_128_glass.mdl Yes panel_top
anim_wp\telescope_arm_128\telescope_arm_128_idle.mdl No N/A
anim_wp\telescope_arm_128\telescope_arm_128_upidle.mdl No N/A
anim_wp\telescope_arm_128\telescope_arm_128x256.mdl Yes panel_top
anim_wp\telescope_arm_trans\telescope_arm_trans.mdl Yes panel_attach
props_livingwall\armliving64x64.mdl Yes panel_attach
anim_wp\arm_4panel.mdl Yes panel_attach

Animation Playback Rate

Sometimes it might be required for an arm (or any other prop_dynamic) to play its animation faster or slower. The playback rate of a prop_dynamic entity is expressed in numbers as representation of percentage, where 1 is equivalent to 100%, 2 is 200%, 0.5 is 50%, 0 is 0% of the animation playback rate (note that 0 will stop the animation completely). There are two ways to change default playback rate.

The first method is easier and applied to all of animation of a particular prop_dynamic. The playback rate can be assigned to the arm, and this will have a constant effect on the arm's animations playback rate (it will always be playing any animations at that set rate). In order to do so, a new output need to be added in the arm's properties:

My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnAnimationBegun !self SetPlaybackRate 5 0.00 No

The above output will make an arm to play all of its animations 5 times faster. !self is a special wildcard that selects the entity that is firing that output (the arm selects itself).

The second way of setting up the playback rate is more complex but also more flexible. The triggering entity (e.g., trigger_once) has to set the following outputs:

My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnStartTouch arm_0 SetAnimation pitflings_angled_01 0.00 No
Io11.png OnStartTouch arm_0 SetPlaybackRate 2 0.01 No

When triggered, the above setup will cause arm_0 to start animation. One hundredth second later, the animation playback will be increased to 200% (note that if both outputs were fired at the same time, the playback rate will remain at default—1).

Powerup Panels

For some themes in Portal 2 Portal 2, panels can be seen doing powerup animations—starting limp and lifeless, then "waking up" and moving back into their proper position. Done correctly, this can make your map feel far more dynamic and will look more realistic for the theme.

Creating these panels, however, is a little different from ordinary panels. This is how Valve does it:

1. Create a prop_dynamic entity with the following settings:

Property Name Value
World Model models/anim_wp/room_transform/arm64x64_interior.mdl
Name panel1
HoldAnimation true
Collisions Not Solid
Default Animation powerup(X_0Y)idleend
Note.pngNote:There is a huge amount of powerup animations to choose from, starting from powerupA_01. Choose whatever fits best.

2. Create a brush above the model, making sure it fits the panel face and is aligned to it. Tie it to a func_brush entity with the following settings:

Property Name Value
Name panel1_brush
Parent panel1,panel_attach

3. Create a logic_auto entity and add the following outputs:

My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnMapSpawn panel1 SetAnimation powerup(X_0Y)idle 0.50 Yes(?)

4. Create a logic_relay with the following settings:

Property Name Value
Name relay_panel1_animation

and the following outputs:

My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnTrigger panel1 SetAnimation powerup(X_0Y) 0.00 Yes(?)

Now just add a trigger somewhere and activate the relay. A trigger_look works great for this.

The idle powerup animations are horribly off-grid in Hammer, and are therefore impossible to correctly parent the brush to. By using this method, we can align the brush to the panel face in Hammer on-grid, but when the map spawns, it will move into an idle powerup animation, with the brush perfectly parented.

See also