Creating a Portal 2 Coop Map: Difference between revisions
Jump to navigation
Jump to search
Note:You must hide the
Note:The
Warning:
Note:Don't forget the delays and the "Only Once."
m (Added info apout places to spawn players) |
Kestrelguy (talk | contribs) m (added language bar.) |
||
Line 1: | Line 1: | ||
{{ | {{lang|title=Creating a ''Portal 2'' Coop Map|Creating a Portal 2 Coop Map}}{{p2 topicon}}[[Category:Portal 2 Level Design]][[Category:Portal 2 tutorials]] | ||
title=Creating a Portal 2 Coop Map| | ==Basic Steps== | ||
==Basic | |||
Here are the basic steps needed to create a coop map: | Here are the basic steps needed to create a coop map: | ||
* Create a {{ent|func_instance}}. Set its VMF file to one of the coop spawn rooms, such as <<code>instances/coop/coop_spawn_room.vmf</code>. These VMF files already contain an {{ent|info_player_start}}, so don't create another one. | |||
* Create another <code>func_instance</code>, this one set to one of the level end rooms, such as <code>instances/coop/coop_endlevel_room.vmf</code>. | |||
* 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 <code>mp_coop_</code>. | |||
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 <code>.bsp</code> file. Get into the hub normally, then the host should changelevel to the map.) | |||
=Co-op Level Without Spawn Instances= | |||
=Co-op Level | |||
To create a co-op level, you need to use: | To create a co-op level, you need to use: | ||
* a | * a {{ent|logic_auto}} | ||
* '''TWO''' | * '''TWO''' {{ent|logic_relay}}s | ||
*a | *a {{ent|logic_coop_manager}} | ||
* '''TWO''' | * '''TWO''' {{ent|logic_script}}s | ||
* '''TWO''' | * '''TWO''' {{ent|prop_indicator_panel}}s | ||
* a | * a {{ent|prop_button}} | ||
* '''TWO''' | * '''TWO''' {{ent|info_coop_spawn}}s (place them where you want the players to start) | ||
{{Note|You must ''hide'' the <code>prop_indicator_panel</code> and the <code>prop_button</code> so the players won't see it in the level.}} | |||
== Step 2== | == Step 2== | ||
* Name your first | * Name your first <code>logic_relay</code> "relay_return_hub" | ||
* Name your second | * Name your second <code>logic_relay</code> "@relay_has_new_taunt" | ||
* Name your | * Name your <code>logic_coop_manager</code> "coopmanage_return_hub" | ||
* Name your first | * Name your first <code>logic_script</code> "script_return_hub" | ||
* Name your second | * Name your second <code>logic_script</code> "@script_mp_coop_lobby" | ||
* Name your first | * Name your first <code>prop_indicator_panel</code> "panel_level_return_orange" | ||
* Name your first | * Name your first <code>prop_indicator_panel</code> "panel_level_return_blue" | ||
* Name your | * Name your <code>info_coop_spawn</code>s "spawns_1" | ||
{{Note| The | {{Note|The <code>prop_button</code> doesn't need a name.}} | ||
==Step 3: Properties== | ==Step 3: Properties== | ||
1. Go to | 1. Go to <code>script_return_hub</code>'s properties and do the following: | ||
::{| class=standard-table | ::{| class=standard-table | ||
! Property Name || Value | ! Property Name || Value | ||
Line 52: | Line 41: | ||
2. Now go to the | 2. Now go to the <code>@script_mp_coop_lobby</code>'s properties and do this: | ||
::{| class=standard-table | ::{| class=standard-table | ||
! Property Name || Value | ! Property Name || Value | ||
Line 62: | Line 50: | ||
|} | |} | ||
3. Continue to the | 3. Continue to the <code>panel_level_return_orange</code> properties: | ||
::{| class=standard-table | ::{| class=standard-table | ||
! Property Name || Value | ! Property Name || Value | ||
Line 74: | Line 62: | ||
| Indicator lights || tex_level_return_orange | | Indicator lights || tex_level_return_orange | ||
|} | |} | ||
{{Warning|<code>panel_return_blue</code> has the ''same'' properties except for the "Indicator lights," which is <code>tex_level_return_blue</code>.}} | |||
4. Continue to the | 4. Continue to the <code>spawns_1</code>s' properties: | ||
::{| class=standard-table | ::{| class=standard-table | ||
! Property Name || Value | ! Property Name || Value | ||
Line 84: | Line 73: | ||
|} | |} | ||
5. Give the <code>prop_button</code> the following properties: | |||
::{| class=standard-table | ::{| class=standard-table | ||
! Property Name || Value | ! Property Name || Value | ||
Line 96: | Line 81: | ||
==Step 4: Outputs/Inputs== | ==Step 4: Outputs/Inputs== | ||
Now we need to connect all these entities together. | Now we need to connect all these entities together. | ||
;{{ent|logic_auto}} 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 | ||
Line 111: | Line 95: | ||
| | [[Image:Io11.png]] || OnMapSpawn || spawns_1 || SetAsActiveSpawn || <none> || 0.00 || No | | | [[Image:Io11.png]] || OnMapSpawn || spawns_1 || SetAsActiveSpawn || <none> || 0.00 || No | ||
|} | |} | ||
{{Note| Don't forget the | {{Note|Don't forget the delays and the "Only Once."}} | ||
;{{ent|logic_coop_manager}} 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 | ||
Line 126: | Line 109: | ||
|} | |} | ||
* | *<code>relay_return_hub</code> 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 | ||
Line 135: | Line 117: | ||
* | *<code>@relay_has_new_taunt</code> 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 | ||
Line 144: | Line 125: | ||
* | *{{ent|prop_button}} 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 | ||
Line 157: | Line 137: | ||
| [[Image:Io11.png]] || OnPressed || coopmanage_return_hub || SetStateBTrue || <none> || 0.00 || No | | [[Image:Io11.png]] || OnPressed || coopmanage_return_hub || SetStateBTrue || <none> || 0.00 || No | ||
|} | |} | ||
That's it! You now can create co-op maps with working co-op scripting! | That's it! You now can create co-op maps with working co-op scripting! | ||
Revision as of 17:00, 10 May 2022
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 asinstances/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:
- a logic_auto
- TWO logic_relays
- a logic_coop_manager
- TWO logic_scripts
- TWO prop_indicator_panels
- a prop_button
- TWO info_coop_spawns (place them where you want the players to start)

prop_indicator_panel
and the prop_button
so the players won't see it in the level.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" - Name your
info_coop_spawn
s "spawns_1"

prop_button
doesn't need a name.Step 3: Properties
1. Go to script_return_hub
's properties and do the following:
Property Name Value Name script_return_hub Entity Scripts debug_scripts/mp_coop_transition_list.nut
2. Now go to the @script_mp_coop_lobby
's properties and do this:
Property Name Value Name @script_mp_coop_lobby Entity Scripts debug_scripts/mp_coop_lobby.nut
3. 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

panel_return_blue
has the same properties except for the "Indicator lights," which is tex_level_return_blue
.4. Continue to the spawns_1
s' properties:
Property Name Value Name spawns_1 Team <red or blue, depending on wich player>
5. Give the prop_button
the following properties:
Property Name Value Delay Before Reset 3
Step 4: Outputs/Inputs
Now we need to connect all these entities together.
- logic_auto Outputs

- logic_coop_manager Outputs
relay_return_hub
Outputs
@relay_has_new_taunt
Outputs
- prop_button Outputs
That's it! You now can create co-op maps with working co-op scripting!