Difference between revisions of "Creating a Portal 2 Coop Map"

From Valve Developer Community
Jump to: navigation, search
Line 5: Line 5:
 
}}
 
}}
 
{{stub}}
 
{{stub}}
 +
==Basic steps==
 
Here are the basic steps needed to create a coop map:
 
Here are the basic steps needed to create a coop map:
  
Line 17: Line 18:
 
That's it!  See [[Testing Portal 2 Co-Op Maps Alone]] for how to test the map without a partner.  (To test it ''with'' a partner, both must have the bsp file.  Get into the hub normally, then the host should changelevel to the map.)
 
That's it!  See [[Testing Portal 2 Co-Op Maps Alone]] for how to test the map without a partner.  (To test it ''with'' a partner, both must have the bsp file.  Get into the hub normally, then the host should changelevel to the map.)
  
 +
=Co-op Level without spawn Instances=
 +
To create a co-op level, you need to use:
 +
* a [[logic_auto]]
 +
* '''TWO''' [[logic_relay]]s
 +
*a [[logic_coop_manager]]
 +
* '''TWO''' [[logic_script]]s
 +
* '''TWO''' [[prop_indicator_panel]]s
 +
 +
== Step 2==
 +
* Name your first [[logic_relay]] '''relay_return_hub'''
 +
* Name your second [[logic_relay]] '''@relay_has_new_taunt'''
 +
* Name your [[logic_coop_manager]] '''coopmanage_return_hub'''
 +
* Name your first [[logic_script]] '''script_return_hub'''
 +
* Name your second [[logic_script]] '''@script_mp_coop_lobby'''
 +
* Name your first [[prop_indicator_panel]] '''panel_level_return_orange'''
 +
* Name your first [[prop_indicator_panel]] '''panel_level_return_blue'''
 +
 +
==Step 3: Properties==
 +
#Go to '''script_return_hub''' properties and do the following:
 +
 +
::{| class=standard-table
 +
!  Property Name || Value
 +
|-
 +
| Name || script_return_hub
 +
|-
 +
| Entity Scripts || debug_scripts/mp_coop_transition_list.nut
 +
|}
 +
 +
 +
#Now go to the '''@script_mp_coop_lobby''' properties and do this:
 +
 +
::{| class=standard-table
 +
!  Property Name || Value
 +
|-
 +
| Name || @script_mp_coop_lobby
 +
|-
 +
| Entity Scripts || debug_scripts/mp_coop_lobby.nut
 +
|}
 +
 +
#Continue to the '''panel_level_return_orange''' properties:
 +
::{| class=standard-table
 +
!  Property Name || Value
 +
|-
 +
| Name || panel_level_return_orange
 +
|-
 +
| Time Duration || 3
 +
|-
 +
| Is a timer? || Yes
 +
|-
 +
| Indicator lights || tex_level_return_orange
 +
|}
 +
 +
 +
{{Warning|The '''panel_return_blue''' has the '''SAME''' properties except of the "Indicator lights" which is "tex_level_return_blue"}}
 +
==Srep 4: Outputs/Inputs==
 +
Now we need to connect all these entities together. Follow these instructions:
 +
 +
'''logic_auto Outputs'''
 +
 +
::{| class=standard-table
 +
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
 +
|-
 +
| [[Image:Io11.png]] || OnMapSpawn  || @script_mp_coop_lobby || RunScriptCode || CheckForNewTaunts() || 2.00 || No
 +
|-
 +
| [[Image:Io11.png]] || OnMapSpawn  || script_return_hub || RunScriptCode || MapPostLoaded() || 2.00 || Yes
 +
|}
 +
{{Note| Don't forget the '''"Delays"''' and the '''"Only Once"'''}}
 
[[Category:Portal 2 Level Design]]
 
[[Category:Portal 2 Level Design]]

Revision as of 12:27, 20 July 2012

Deutsch Русский

Basic steps

Here are the basic steps needed to create a coop map:

  • Create a func_instance. Set its VMF file to one of the coop spawn rooms, such as instances/coop/coop_spawn_room.vmf. These VMF files already contain an info_player_start, so don't create another one.
  • Create another func_instance, this one set to one of the level end rooms, such as instances/coop/coop_endlevel_room.vmf.
  • Build your map in between these rooms. (You can move them, of course.) The embedded VMF files have an obvious exit which should lead into your map. You may need to enclose the rooms in order to prevent leaks.
  • Make sure you save the map with the prefix mp_coop_.

That's it! See Testing Portal 2 Co-Op Maps Alone for how to test the map without a partner. (To test it with a partner, both must have the bsp file. Get into the hub normally, then the host should changelevel to the map.)

Co-op Level without spawn Instances

To create a co-op level, you need to use:

Step 2

Step 3: Properties

  1. Go to script_return_hub properties and do the following:
Property Name Value
Name script_return_hub
Entity Scripts debug_scripts/mp_coop_transition_list.nut


  1. Now go to the @script_mp_coop_lobby properties and do this:
Property Name Value
Name @script_mp_coop_lobby
Entity Scripts debug_scripts/mp_coop_lobby.nut
  1. Continue to the panel_level_return_orange properties:
Property Name Value
Name panel_level_return_orange
Time Duration 3
Is a timer? Yes
Indicator lights tex_level_return_orange


Warning: The panel_return_blue has the SAME properties except of the "Indicator lights" which is "tex_level_return_blue"

Srep 4: Outputs/Inputs

Now we need to connect all these entities together. Follow these instructions:

logic_auto Outputs

My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnMapSpawn @script_mp_coop_lobby RunScriptCode CheckForNewTaunts() 2.00 No
Io11.png OnMapSpawn script_return_hub RunScriptCode MapPostLoaded() 2.00 Yes
Note: Don't forget the "Delays" and the "Only Once"