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

Testing Portal 2 Co-Op Maps Alone: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Fixed some minor things (bad looking links, etc.))
(badly moved multipage)
 
(20 intermediate revisions by 17 users not shown)
Line 1: Line 1:
{{LanguageBar}}
{{p2 topicon}}
[[Category:Portal 2 Level Design]]
[[Category:Portal 2 Level Design]]
This is a guide on how you can test co-op maps alone utilizing the [[splitscreen]] capabilities of the Source engine. This also works for any existing coop maps. It does not require any modifications to the map file itself.
This is a guide on how you can test co-op maps alone utilizing the [[splitscreen]] capabilities of the Source engine. This also works for any existing coop maps. It does not require any modifications to the map file itself.


This does not cover the requirements for making a coop level in the first place.
This does not cover the requirements for making a coop level in the first place.
{{Warning|Game can't run with {{code|-tools}} as it limits the splitscreen to 1}}


==Loading the Map==
==Loading the Map==
; <code>[[ss_map]] ''mapname''</code>
; <code>[[ss_map]] ''mapname''</code>
: Load <code>''mapname''</code> in splitscreen 2-player mode. Analogous to [[Map (ConCommand)|map]] in singleplayer. Like map, it is not required to add the trailing .bsp.
: Load <code>''mapname''</code> in splitscreen 2-player mode. Analogous to <code>[[map (console command)|map]]</code> in singleplayer. Like <code>map</code>, it is not required to add the trailing <code>.bsp</code>.
{{Note|If the map name doesn't begin with "mp_coop_", add " *mp" to the end of the command: <code>ss_map ''mapname'' *mp</code> }}
; <code>[[ss_splitmode]] ''mode''</code>
; <code>[[ss_splitmode]] ''mode''</code>
: Changes the splitscreen mode.
: Changes the splitscreen mode.
Line 12: Line 19:
: <code>ss_splitmode 1</code>: Top-and-bottom split
: <code>ss_splitmode 1</code>: Top-and-bottom split
: <code>ss_splitmode 2</code>: Side-by-side split
: <code>ss_splitmode 2</code>: Side-by-side split
If your map is stuck at the loading screen, try to shorten the VMF filename and recompile.


===Dual Monitors===
===Dual Monitors===
If you run dual monitors and want to split to each monitor, follow [http://forums.steampowered.com/forums/showthread.php?t=1857198 this guide]
If you run dual monitors and want to split to each monitor, follow [https://web.archive.org/web/20160726125926/http://forums.steampowered.com/forums/showthread.php?t=1857198 this guide]


==Controlling the second player==
==Controlling the Second Player==
If you could actually play the coop map entirely as one player, it wouldn't be a very cooperative map. These are some ways you can control the second player.
If you could actually play the coop map entirely as one player, it wouldn't be a very cooperative map. These are some ways you can control the second player.


===<code>in_forceuser</code>===
===<code>in_forceuser</code>===
; <code>[[in_forceuser]] ''playerindex''</code>
; <code>[[in_forceuser]] ''playerindex''</code>
: Take over the second player. All movement and other keybindings will be as if the second player used them. Requires cheats to be enabled.
: Take over the second player. All movement and other keybindings will be as if the second player used them. Requires cheats to be enabled.
: <code>[[sv_cheats]] 1</code>: Turn on cheats
: {{ent|sv_cheats|1}}: Turn on cheats
: <code>in_forceuser 0</code>: Control player #1 (Atlas)
: <code>in_forceuser 0</code>: Control player #1 (Atlas)
: <code>in_forceuser 1</code>: Control player #2 (P-Body)
: <code>in_forceuser 1</code>: Control player #2 (P-Body)
Line 30: Line 39:
: Swaps you between first and second player when you push "z".
: Swaps you between first and second player when you push "z".


{{note|If you are moving, crouching, shooting portals or otherwise performing an action when you change players, you will stop during the change but immediately resume the action when you change back. For instance, if you're holding "w" to move forward, you will stop moving forward as soon as you hit "z" (assuming you use the BindToggle above), but immediately resume moving forward when you hit "z" again even if "w" is no longer being held down. To stop this, simply tap "w" again, or use a more robust keybinding: <code>[[Bind]] "z" "-moveleft; -moveright; -use; -forward; -back; -attack; -attack2; toggle in_forceuser"</code>.}}
{{note|If you are moving, crouching, shooting portals or otherwise performing an action when you change players, you will stop during the change but immediately resume the action when you change back. For instance, if you're holding "w" to move forward, you will stop moving forward as soon as you hit "z" (assuming you use the BindToggle above), but immediately resume moving forward when you hit "z" again even if "w" is no longer being held down. To stop this, simply tap "w" again, or use a more robust keybinding: <code>[[Bind]] "z" "-moveleft; -moveright; -use; -forward; -back; -attack; -attack2; toggle in_forceuser"</code>.}}
 
===Use a Controller===
This is actually more complicated than it sounds unless you have two controllers available. Source will map actions of the first detected controller to the first player and there doesn't seem to be any way to override this. The workaround is to either have two actual controllers or use trickery to make your computer think it has two controllers.


===Use a controller===
You can also connect one controller and enter command <code>in_forceuser 1</code>. Then, Atlas will be controled by controller and P-body will be controled by keyboard.
This is actually more complicated than it sounds unless you have two controllers available. Source will map actions of the first detected controller to the first player and there doesn't seem to be away to override this.  The workaround is to either have two actual controllers or use trickery to make your computer think it has two controllers.


More information for this can be found on the [http://forums.steampowered.com/forums/showthread.php?t=1847904 Steam forums].
More information for this can be found on the [http://forums.steampowered.com/forums/showthread.php?t=1847904 Steam forums].


===<code>change_portalgun_linkage</code>===
===<code>change_portalgun_linkage</code>===
This doesn't truly let you play the second character, but it does allow you to create more than one set of linked portals.
This allows you to use the extra sets of linked portals without actually changing characters.
 
; <code>[[change_portalgun_linkage_id]] '''''integer'''''</code>
: Changes portals fired to belong to the specified character or team.


{{todo|It's not yet tested to see if portals that are in the set you aren't currently linked to survive going through a fizzler.}}
:: <code>change_portalgun_linkage_id '''0'''</code>: Single-player
; <code>[[change_portalgun_linkage]] ''team''</code>
:: <code>change_portalgun_linkage_id '''1'''</code>: Blue
: Changes portals fired to belong to the specified team.
:: <code>change_portalgun_linkage_id '''2'''</code>: Orange
: <code>change_portalgun_linkage 0</code>: Chell
:: <code>change_portalgun_linkage_id '''''[3-9]'''''</code>: Extra / Reserved
: <code>change_portalgun_linkage 1</code>: Unknown
{{Note|The color appearance of portals is tied to the person firing them. E.g., when Blue fires Orange's portals (''linkage_id: 2''), they appear blue until Orange fires them again.}}
: <code>change_portalgun_linkage 2</code>: Atlas
: <code>change_portalgun_linkage 3</code>: P-Body
: {{todo|Verify that these values are correct.}}
Note that the color of portals fired will be unchanged -- Atlas will shoot blue and purple portals regardless of the setting of change_portalgun_linkage.


== Other useful console commands ==
== Other Useful Console Commands ==
; <code>[[cmd2]] ''command''</code>
; <code>[[cmd2]] ''command''</code>
: Executes ''command'' as if typed by the second player.
: Executes ''command'' as if typed by the second player.
Line 56: Line 66:
; <code>[[ss_force_primary_fullscreen]] ''enable''</code>
; <code>[[ss_force_primary_fullscreen]] ''enable''</code>
: Makes the first player fullscreen if ''enable'' is 1, hiding the second player's view.
: Makes the first player fullscreen if ''enable'' is 1, hiding the second player's view.
: There doesn't appear to be a way to do this with the second player, nor does holding Tab to show partner view (+remote_view) work.
: <code>ss_pipsplit 3; ss_pipscale 1; ss_pip_bottom_offset 0; ss_pip_right_offset 0</code> can be used to show only the second player's view


== See also ==
* [[Portal 2 Level Creation]]


== External links ==
== Alternative Way ==
* [http://forums.thinkingwithportals.com/maps-and-modding/running-testing-co-op-maps-in-singleplayer-t2299.html Original version of this guide] hosted at ThinkingWithPortals.com
Open Portal 2 and go to the "Community Test Chambers" (PTI) tab and enter the test chamber editor. Set the gamemode to "Coop" then launch the map. After launching the map, you can follow the instructions below, without having to use <code>[[in_forceuser]]</code>. Instead by default, you can press <code>R</code> that triggers <code>[[swap_ss_input]]</code> until restarting Portal 2.
 
{{Note|For some reason this command doesn't work when PTI isn't started and will stop working when closing PTI.}}
 
 
== External Links ==
* [http://forums.thinking.withportals.com/maps-and-modding/running-testing-co-op-maps-in-singleplayer-t2299.html Original version of this guide] hosted at ThinkingWithPortals.com
* [http://forums.steampowered.com/forums/showthread.php?t=1847904 How-to: Split Screen Coop]
* [http://forums.steampowered.com/forums/showthread.php?t=1847904 How-to: Split Screen Coop]
* [http://forums.steampowered.com/forums/showthread.php?t=1857198 How-to: SplitScreen with 2 monitors]
* [http://forums.steampowered.com/forums/showthread.php?t=1857198 How-to: SplitScreen with 2 monitors]
* [http://forums.steampowered.com/forums/showthread.php?p=22141019 How-to: Play Co_Op Alone]
* [http://forums.steampowered.com/forums/showthread.php?p=22141019 How-to: Play Co_Op Alone]
[[Category:Portal 2 Level Design]]
[[Category:Portal 2 Level Design]]
[[Category:Portal 2 Tutorials]]
[[Category:Portal 2 Tutorials]]

Latest revision as of 06:49, 14 July 2024

English (en)Deutsch (de)Polski (pl)Русский (ru)中文 (zh)Translate (Translate)

This is a guide on how you can test co-op maps alone utilizing the splitscreen capabilities of the Source engine. This also works for any existing coop maps. It does not require any modifications to the map file itself.

This does not cover the requirements for making a coop level in the first place.

Warning.pngWarning:Game can't run with -tools as it limits the splitscreen to 1


Loading the Map

ss_map mapname
Load mapname in splitscreen 2-player mode. Analogous to map in singleplayer. Like map, it is not required to add the trailing .bsp.
Note.pngNote:If the map name doesn't begin with "mp_coop_", add " *mp" to the end of the command: ss_map mapname *mp
ss_splitmode mode
Changes the splitscreen mode.
ss_splitmode 0: Use recommended settings based on width
ss_splitmode 1: Top-and-bottom split
ss_splitmode 2: Side-by-side split

If your map is stuck at the loading screen, try to shorten the VMF filename and recompile.

Dual Monitors

If you run dual monitors and want to split to each monitor, follow this guide

Controlling the Second Player

If you could actually play the coop map entirely as one player, it wouldn't be a very cooperative map. These are some ways you can control the second player.

in_forceuser

in_forceuser playerindex
Take over the second player. All movement and other keybindings will be as if the second player used them. Requires cheats to be enabled.
sv_cheats 1: Turn on cheats
in_forceuser 0: Control player #1 (Atlas)
in_forceuser 1: Control player #2 (P-Body)

To make this easy to use, set a keybinding for it:

BindToggle "z" in_forceuser
Swaps you between first and second player when you push "z".
Note.pngNote:If you are moving, crouching, shooting portals or otherwise performing an action when you change players, you will stop during the change but immediately resume the action when you change back. For instance, if you're holding "w" to move forward, you will stop moving forward as soon as you hit "z" (assuming you use the BindToggle above), but immediately resume moving forward when you hit "z" again even if "w" is no longer being held down. To stop this, simply tap "w" again, or use a more robust keybinding: Bind "z" "-moveleft; -moveright; -use; -forward; -back; -attack; -attack2; toggle in_forceuser".

Use a Controller

This is actually more complicated than it sounds unless you have two controllers available. Source will map actions of the first detected controller to the first player and there doesn't seem to be any way to override this. The workaround is to either have two actual controllers or use trickery to make your computer think it has two controllers.

You can also connect one controller and enter command in_forceuser 1. Then, Atlas will be controled by controller and P-body will be controled by keyboard.

More information for this can be found on the Steam forums.

change_portalgun_linkage

This allows you to use the extra sets of linked portals without actually changing characters.

change_portalgun_linkage_id integer
Changes portals fired to belong to the specified character or team.
change_portalgun_linkage_id 0: Single-player
change_portalgun_linkage_id 1: Blue
change_portalgun_linkage_id 2: Orange
change_portalgun_linkage_id [3-9]: Extra / Reserved
Note.pngNote:The color appearance of portals is tied to the person firing them. E.g., when Blue fires Orange's portals (linkage_id: 2), they appear blue until Orange fires them again.

Other Useful Console Commands

cmd2 command
Executes command as if typed by the second player.
cmd2 name Player2: Sets the name of the second player
ss_force_primary_fullscreen enable
Makes the first player fullscreen if enable is 1, hiding the second player's view.
ss_pipsplit 3; ss_pipscale 1; ss_pip_bottom_offset 0; ss_pip_right_offset 0 can be used to show only the second player's view


Alternative Way

Open Portal 2 and go to the "Community Test Chambers" (PTI) tab and enter the test chamber editor. Set the gamemode to "Coop" then launch the map. After launching the map, you can follow the instructions below, without having to use in_forceuser. Instead by default, you can press R that triggers swap_ss_input until restarting Portal 2.

Note.pngNote:For some reason this command doesn't work when PTI isn't started and will stop working when closing PTI.


External Links