This article relates to the game "Portal 2". Click here for more information.
This article's documentation is for anything that uses the Source engine. Click here for more information.

Coop Door (Portal 2): Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Unicodifying, replaced: [[Image: → [[File: (22))
 
(6 intermediate revisions by 4 users not shown)
Line 1: Line 1:
'''Co-Op doors''' consist of two triggers that both bots step on to open the door and for each trigger a person sign lights up.
{{Underlinked|date=January 2024}}
[[Image:Portal2CoopDoorFromMp_Coop_Doors.jpg|thumb|right|300px|The co-op door from mp_coop_doors.]]
{{lang|title=Co-Op Door|Coop Door (Portal 2)}}{{p2 topicon}}{{source topicon}}
 
{{Portal2}} '''Co-Op doors''' consist of two triggers that both bots step on to open the door and for each trigger a person sign lights up.
[[File:Portal2CoopDoorFromMp_Coop_Doors.jpg|thumb|right|300px|The co-op door from <tt>mp_coop_doors</tt>.]]
==Instance==
==Instance==
1.)  
1.) Create a {{ent|func_instance}} with the following settings:
Create a [[func_instance]] with the following settings:
::{| class=standard-table
::{| class=standard-table
!  Property Name || Value
!  Property Name || Value
Line 11: Line 13:
| VMF Filename || instances/coop/coop_team_double_exit_door.vmf
| VMF Filename || instances/coop/coop_team_double_exit_door.vmf
|}  
|}  
2.)
2.) Create a block brush with the Trigger texture. Tie this brush to a {{ent|trigger_playerteam}} with the following outputs:
Create a block brush with trigger texture, tie this brush to a [[trigger_playerteam]] with 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]] || OnStartTouchBluePlayer || coop_exit_door || instance:relay_blue_in;Trigger || <none> || 0.00 || No
| [[File:Io11.png]] || OnStartTouchBluePlayer || coop_exit_door || instance:relay_blue_in;Trigger || <none> || 0.00 || No
|-
|-
| [[Image:Io11.png]] || OnEndTouchBluePlayer || coop_exit_door || instance:relay_blue_out;Trigger || <none> || 0.00 || No
| [[File:Io11.png]] || OnEndTouchBluePlayer || coop_exit_door || instance:relay_blue_out;Trigger || <none> || 0.00 || No
|-
|-
| [[Image:Io11.png]] || OnStartTouchOrangePlayer || coop_exit_door || instance:relay_orange_in;Trigger || <none> || 0.00 || No
| [[File:Io11.png]] || OnStartTouchOrangePlayer || coop_exit_door || instance:relay_orange_in;Trigger || <none> || 0.00 || No
|-
|-
| [[Image:Io11.png]] || OnEndTouchOrangePlayer || coop_exit_door || instance:relay_orange_out;Trigger || <none> || 0.00 || No
| [[File:Io11.png]] || OnEndTouchOrangePlayer || coop_exit_door || instance:relay_orange_out;Trigger || <none> || 0.00 || No
|}
|}


==Manual Creation==
==Manual Creation==
===The Door===
===The Door===
1.)
1.) Add a {{ent|prop_testchamber_door}} with the following settings:
Add a [[prop_testchamber_door]]. With the following settings:
::{| class=standard-table
::{| class=standard-table
!  Property Name || Value
!  Property Name || Value
Line 36: Line 35:
|}
|}


2.)
2.) Add a {{ent|logic_coop_manager}} with the following settings:
Add a [[logic_coop_manager]] with the following settings:
::{| class=standard-table
::{| class=standard-table
!  Property Name || Value
!  Property Name || Value
Line 47: Line 45:
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
|-
|-
| [[Image:Io11.png]] || OnChangeToAllTrue || door_01 || Open || <none> || 0.00 || No
| [[File:Io11.png]] || OnChangeToAllTrue || door_01 || Open || <none> || 0.00 || No
|}
|}


===Triggers===
===Triggers===
1.)
1.) Add a {{ent|logic_relay}} with the following Settings:
Add a [[Logic_relay]] with the following Settings:
::{| class=standard-table
::{| class=standard-table
!  Property Name || Value
!  Property Name || Value
Line 63: Line 59:
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
|-
|-
| [[Image:Io11.png]] || OnTrigger || coop_man || SetStateATrue || <none> || 0.00 || No
| [[File:Io11.png]] || OnTrigger || coop_man || SetStateATrue || <none> || 0.00 || No
|}
|}
2.)
2.) Add a <tt>logic_relay</tt> with the following Settings:
Add a [[Logic_relay]] with the following Settings:
::{| class=standard-table
::{| class=standard-table
!  Property Name || Value
!  Property Name || Value
Line 76: Line 71:
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
|-
|-
| [[Image:Io11.png]] || OnTrigger || coop_man || SetStateAFalse || <none> || 0.00 || No
| [[File:Io11.png]] || OnTrigger || coop_man || SetStateAFalse || <none> || 0.00 || No
|}
|}
3.)
3.) Repeat steps 1-2, but change the following:
Repeat steps 1-2 but change the following:
::{| class=standard-table
::{| class=standard-table
!  Property Name || Value
!  Property Name || Value
Line 89: Line 83:
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
|-
|-
| [[Image:Io11.png]] || OnTrigger || coop_man || SetStateBTrue || <none> || 0.00 || No
| [[File:Io11.png]] || OnTrigger || coop_man || SetStateBTrue || <none> || 0.00 || No
|}
|}
Add a [[Logic_relay]] with the following Settings:
Add a <tt>logic_relay</tt> with the following Settings:
::{| class=standard-table
::{| class=standard-table
!  Property Name || Value
!  Property Name || Value
Line 101: Line 95:
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
|-
|-
| [[Image:Io11.png]] || OnTrigger || coop_man || SetStateBFalse || <none> || 0.00 || No
| [[File:Io11.png]] || OnTrigger || coop_man || SetStateBFalse || <none> || 0.00 || No
|}
|}


4.)
4.) Create a block brush with the Trigger texture applied. Tie this brush to a {{ent|trigger_playerteam}} with the following outputs:
Create a block brush with trigger texture applied. Tie this brush to a [[trigger_playerteam]] with 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]] || OnStartTouchBluePlayer || relay_b_in || Trigger || <none> || 0.00 || No
| [[File:Io11.png]] || OnStartTouchBluePlayer || relay_b_in || Trigger || <none> || 0.00 || No
|-
|-
| [[Image:Io11.png]] || OnEndTouchBluePlayer || relay_b_out || Trigger || <none> || 0.00 || No
| [[File:Io11.png]] || OnEndTouchBluePlayer || relay_b_out || Trigger || <none> || 0.00 || No
|-
|-
| [[Image:Io11.png]] || OnStartTouchOrangePlayer || relay_o_in || Trigger || <none> || 0.00 || No
| [[File:Io11.png]] || OnStartTouchOrangePlayer || relay_o_in || Trigger || <none> || 0.00 || No
|-
|-
| [[Image:Io11.png]] || OnEndTouchOrangePlayer || relay_o_out || Trigger || <none> || 0.00 || No
| [[File:Io11.png]] || OnEndTouchOrangePlayer || relay_o_out || Trigger || <none> || 0.00 || No
|}
|}
===Check Boxes===
===Check Boxes===
1.)
1.) Add a {{ent|prop_static}} with the following settings:
Add a Prop_static with the following settings:
::{| class=standard-table
::{| class=standard-table
!  Property Name || Value
!  Property Name || Value
Line 126: Line 118:
|}
|}
2.)
2.)
Create a <code>32Lx4Wx32H</code> [[func_brush]] with the texture: signage/signage_coop_teamdoor_orange
Create a 32L×4W×32H {{ent|func_brush}} with the texture <tt>signage/signage_coop_teamdoor_orange</tt>.
::{| class=standard-table
::{| class=standard-table
!  Property Name || Value
!  Property Name || Value
Line 135: Line 127:
Align it to the left, inside the frame.
Align it to the left, inside the frame.


3.)
3.) Repeat step 2, but use <tt>signage/signage_coop_teamdoor_blue</tt> for the texture instead.
Repeat step 2 but change the following: signage/signage_coop_teamdoor_blue
 


Align it to the right, inside the frame.
Align it to the right, inside the frame.


 
4.) Add two {{ent|env_texturetoggle}}s with the following settings:
4.)
Add two [[env_texturetoggle]] with the following settings:
::{| class=standard-table
::{| class=standard-table
!  Property Name || Value
!  Property Name || Value
Line 159: Line 147:
|}
|}


5.)
5.) Add two {{ent|ambient_generic}}s with the following settings:
Add two [[ambient_generic]] with the following settings:
::{| class=standard-table
::{| class=standard-table
!  Property Name || Value
!  Property Name || Value
Line 168: Line 155:
| Sound Name || portal.button_down
| Sound Name || portal.button_down
|}
|}
::{| class=standard-table
::{| class=standard-table
!  Property Name || Value
!  Property Name || Value
Line 177: Line 163:
|}
|}


 
6.) Add the following outputs to <tt>relay_o_in</tt>:
6.)
Add the following outputs to <code>relay_o_in</code>:
::{| 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]] || OnTrigger || textog_o || SetTextureIndex || 1 || 0.00 || No
| [[File:Io11.png]] || OnTrigger || textog_o || SetTextureIndex || 1 || 0.00 || No
|-
|-
| [[Image:Io11.png]] || OnTrigger || sound_in || PlaySound || <none> || 0.00 || No
| [[File:Io11.png]] || OnTrigger || sound_in || PlaySound || <none> || 0.00 || No
|}
|}


Add the following outputs to <code>relay_o_out</code>:
Add the following outputs to <tt>relay_o_out</tt>:
 
::{| 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]] || OnTrigger || textog_o || SetTextureIndex || 0 || 0.00 || No
| [[File:Io11.png]] || OnTrigger || textog_o || SetTextureIndex || 0 || 0.00 || No
|-
|-
| [[Image:Io11.png]] || OnTrigger || sound_out || PlaySound || <none> || 0.00 || No
| [[File:Io11.png]] || OnTrigger || sound_out || PlaySound || <none> || 0.00 || No
|}
|}


Add the following outputs to <code>relay_b_in</code>:
Add the following outputs to <tt>relay_b_in</tt>:
::{| 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]] || OnTrigger || textog_b || SetTextureIndex || 1 || 0.00 || No
| [[File:Io11.png]] || OnTrigger || textog_b || SetTextureIndex || 1 || 0.00 || No
|-
|-
| [[Image:Io11.png]] || OnTrigger || sound_in || PlaySound || <none> || 0.00 || No
| [[File:Io11.png]] || OnTrigger || sound_in || PlaySound || <none> || 0.00 || No
|}
|}


Add the following outputs to <code>relay_b_out</code>:
Add the following outputs to <tt>relay_b_out</tt>:
 
::{| 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]] || OnTrigger || textog_b || SetTextureIndex || 0 || 0.00 || No
| [[File:Io11.png]] || OnTrigger || textog_b || SetTextureIndex || 0 || 0.00 || No
|-
|-
| [[Image:Io11.png]] || OnTrigger || sound_out || PlaySound || <none> || 0.00 || No
| [[File:Io11.png]] || OnTrigger || sound_out || PlaySound || <none> || 0.00 || No
|}
|}


You have now created a door which will open if both co-op partners are in the [[trigger|triggers]]
You have now created a door that will open only if both co-op partners are in the [[trigger]]s.


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

Latest revision as of 08:28, 8 January 2024

Underlinked - Logo.png
This article needs more Wikipedia icon links to other articles to help Wikipedia icon integrate it into the encyclopedia. Please help improve this article by adding links Wikipedia icon that are relevant to the context within the existing text.
January 2024
English (en)Français (fr)Русский (ru)Translate (Translate)

Portal 2 Co-Op doors consist of two triggers that both bots step on to open the door and for each trigger a person sign lights up.

The co-op door from mp_coop_doors.

Instance

1.) Create a func_instance with the following settings:

Property Name Value
Name coop_exit_door
VMF Filename instances/coop/coop_team_double_exit_door.vmf

2.) Create a block brush with the Trigger texture. Tie this brush to a trigger_playerteam with the following outputs:

My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnStartTouchBluePlayer coop_exit_door instance:relay_blue_in;Trigger <none> 0.00 No
Io11.png OnEndTouchBluePlayer coop_exit_door instance:relay_blue_out;Trigger <none> 0.00 No
Io11.png OnStartTouchOrangePlayer coop_exit_door instance:relay_orange_in;Trigger <none> 0.00 No
Io11.png OnEndTouchOrangePlayer coop_exit_door instance:relay_orange_out;Trigger <none> 0.00 No

Manual Creation

The Door

1.) Add a prop_testchamber_door with the following settings:

Property Name Value
Name door_01

2.) Add a logic_coop_manager with the following settings:

Property Name Value
Name coop_man

and outputs:

My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnChangeToAllTrue door_01 Open <none> 0.00 No

Triggers

1.) Add a logic_relay with the following Settings:

Property Name Value
Name relay_b_in

and outputs:

My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnTrigger coop_man SetStateATrue <none> 0.00 No

2.) Add a logic_relay with the following Settings:

Property Name Value
Name relay_b_out

and outputs:

My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnTrigger coop_man SetStateAFalse <none> 0.00 No

3.) Repeat steps 1-2, but change the following:

Property Name Value
Name relay_o_in

outputs:

My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnTrigger coop_man SetStateBTrue <none> 0.00 No

Add a logic_relay with the following Settings:

Property Name Value
Name relay_o_out

outputs:

My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnTrigger coop_man SetStateBFalse <none> 0.00 No

4.) Create a block brush with the Trigger texture applied. Tie this brush to a trigger_playerteam with the following outputs:

My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnStartTouchBluePlayer relay_b_in Trigger <none> 0.00 No
Io11.png OnEndTouchBluePlayer relay_b_out Trigger <none> 0.00 No
Io11.png OnStartTouchOrangePlayer relay_o_in Trigger <none> 0.00 No
Io11.png OnEndTouchOrangePlayer relay_o_out Trigger <none> 0.00 No

Check Boxes

1.) Add a prop_static with the following settings:

Property Name Value
World Model models/props/sign_frame02/sign_frame02.mdl

2.) Create a 32L×4W×32H func_brush with the texture signage/signage_coop_teamdoor_orange.

Property Name Value
Name checkbox_o

Align it to the left, inside the frame.

3.) Repeat step 2, but use signage/signage_coop_teamdoor_blue for the texture instead.

Align it to the right, inside the frame.

4.) Add two env_texturetoggles with the following settings:

Property Name Value
Name textog_o
Target Brush(es). checkbox_o
Property Name Value
Name textog_b
Target Brush(es). checkbox_b

5.) Add two ambient_generics with the following settings:

Property Name Value
Name sound_out
Sound Name portal.button_down
Property Name Value
Name sound_in
Sound Name portal.button_up

6.) Add the following outputs to relay_o_in:

My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnTrigger textog_o SetTextureIndex 1 0.00 No
Io11.png OnTrigger sound_in PlaySound <none> 0.00 No

Add the following outputs to relay_o_out:

My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnTrigger textog_o SetTextureIndex 0 0.00 No
Io11.png OnTrigger sound_out PlaySound <none> 0.00 No

Add the following outputs to relay_b_in:

My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnTrigger textog_b SetTextureIndex 1 0.00 No
Io11.png OnTrigger sound_in PlaySound <none> 0.00 No

Add the following outputs to relay_b_out:

My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnTrigger textog_b SetTextureIndex 0 0.00 No
Io11.png OnTrigger sound_out PlaySound <none> 0.00 No

You have now created a door that will open only if both co-op partners are in the triggers.