Portal 2

Portal 2

567 ratings
How to play Local Co-op with Controller + Keyboard
By Eetami
Regarding this topic information is scarce. How to play offline co-op? Pressing "X" doesn't do anything? These questions and more are answered in this guide.
In case you didn't know...

High five!

Yes, there is an offline splitscreen co-op mode in the PC version of Portal 2. To play it, all you need is a couple controllers, go Play Co-op game and press X (SQUARE on PS3 controller) on the second controller. Pictures:

Step one: Play cooperative game
Step two: Press X (SQUARE on a PS3 controller) on the controller.
You should know: Playing offline splitscreen disables achievements. The game considers it "cheating".
Pictures: Click on the images to enlarge them. Recommended for people with bad eye-sight.

Now in case you don't have multiple controllers and want to play with a friend using mouse/keyboard and a controller respectively, read on.

First up a couple notes!
- Enable controller from Options! Check that controller control is enabled.

- This guide does not cover how to play custom co-op maps in offline splitscreen mode. For that, check this link.

- This guide does also not cover how to play offline co-op with two keyboards and two mouses.

- If your controller is something other than Xbox 360 controller for Windows or Xbox One controller, and you can't get it to start offline splitscreen, check your button bindings! Some cases might require you to install 3rd party software to emulate Xbox 360 controller, MotioninJoy seems to work for most controllers.

- Some pictures have finnish text in them. Don't worry, I've translated the important stuff for you.

- The depicted method isn't supported in Linux or OS X version of Portal 2.
What to do if I have only one controller?
Upon entering co-op mode you'll notice the text "Offline splitscreen: Press X on controller 2". If you're like me, and have only one controller, pressing X does absolutely nothing. The problem is that your controller is assigned to player 1 by default. That means you can play single-player and online co-op game with both your mouse/keyboard and your controller, perhaps even at the sime time, but not offline splitscreen mode. The game doesn't know you have another player.

In order for the offline co-op mode to work you don't need elaborate config setups or 3rd party executables like JoyID, but you do need to tinker a bit...
Messing with Launch options
The fastest and probably the easiest way to map your controller 1 to player 2 is to type this to launch options:
-joy_remap_player_for_controller1 2
Below a picture:

A picture of the launch options in finnish. It says "for advanced users only", don't let it spook you.

To get to launch options press right mouse button while hovering over Portal 2 library entry, select Properties and press Set launch options. Another picture:

Finnish grammar: "Ominaisuudet" means Properties.
Developer console
You've now succesfully assigned your controller to player 2! But it also presents a problem: your controller is now always mapped to player 2: that means you now can't play single-player or online co-op with your controller (they're always played as player 1!) This is why you have to enable developer console. You can do this in-game like this:

The default key to open developer console is '~', the squiggly button next to '1' key in the US keyboard layout. However the scandinavian layout doesn't have this button, so you'll have to use other means to open it.

One way to do this is to type this to launch options:
Again a picture:

You can actually write any commands here: every subsequent command is introduced with '-'.

Now you you have the developer console visible every time you start the game and you can type in the same command:
joy_remap_player_for_controller1 2 // The number value tells the game which player is taking over the controller. 0 means default, 1 is player 1, 2 is player 2 etc.
A picture of the developer console. This is what you're looking for. Only this time you type commands without '-'.
More on developer console
There are various other ways to bring up developer console that don't require typing any launch options. Below I will depict one of them.

Creating an autoexec.cfg
otherwise known as user configuration

The most preferable way is to create a new file called autoexec.cfg in the cfg folder in your Portal 2 install directory. Here's mine:

My autoexec.cfg highlighted in the top. Take note of the directory: it's fairly similar in every Windows system. In Linux or iOS the default install directories are found in Steam Support.

To create the file you need to create a new text file like this:

Press right mouse button while in the cfg folder, left click on New ("uusi" in finnish) and press Text file (again "tekstitiedosto" in finnish).

Text files automatically have the extension .txt. Rename the file to autoexec.cfg and remove the .txt extension. Make sure your folder settings is set to show file extensions. If you rename it to anything else, it is not automatically executed! Hence the name "autoexec".

None of your text editing programs probably know how to open it, but once you double-click it select "Open with notepad". You should see a blank text file. Copy this to your autoexec.cfg:
// This automatically enables console so you don't have to con_enable 1 // These aliases create an automatic toggle for remapping your controller alias "togglecontroller" "remap1to2" alias "remap1to2" "joy_remap_player_for_controller1 2; alias togglecontroller remap2to1; echo Xbox 360 controller 1 remapped to Player 2" alias "remap2to1" "joy_remap_player_for_controller1 1; alias togglecontroller remap1to2; echo Xbox 360 controller 1 remapped to Player 1" // These aliases create an automatic toggle for remapping your keyboard alias "togglekeyboard" "sv_cheats 1; key_remap_keyboard_for_player1" alias "key_remap_keyboard_for_player1" "in_forceuser 0; alias togglekeyboard key_remap_keyboard_for_player2; echo Keyboard remapped to Player 1" alias "key_remap_keyboard_for_player2" "in_forceuser 1; alias togglekeyboard key_remap_keyboard_for_player1; echo Keyboard remapped to Player 2" // Keybindings to togglecontroller, togglekeyboard and toggleconsole bind "F9" "togglekeyboard" bind "F10" "togglecontroller" bind "F11" "toggleconsole" // The most important part host_writeconfig

It should look something like this. "Muistio" means notepad.

You're open to edit any part you deem necessary. If you don't want to bind anything to toggleconsole you can remove it, or if you don't want to bind F-keys, just type in any key you wish to bind inside the quotation marks. (The main reason for binding toggleconsole command is because the scandinavian keyboard layout doesn't have the key that is defaulted to it.)

Now click save and you're done! Once you start Portal 2 you can try out opening console with the key you just binded as well as toggling your controller remaps.

Or alternatively you can download my autoexec.cfg from this link[www.dropbox.com] and paste it to the aforementioned directory. It is identical to the one above. Disclaimer: this is a secure link to dropbox so feel not afraid.
Two players, one ... keyboard?
Appearantly it is very possible to play through co-op mode with just one keyboard. Below a direct quote from comments:
Originally posted by quaternary:
For 2 players with 1 keyboard and mouse - pop open the console, and type sv_cheats 1, press enter, BindToggle "z" in_forceuser, press enter, and then ss_map mp_coop_start. Press Z and hand off the keyboard and mouse to the other person to switch players (tedious, but the only way really). You can also use this to play co-op by yourself (FOREVER ALONE MODE!!) Sometimes this breaks the pause menu so you can't keep it open for more than 1 frame - I don't know why.

Every map is possible - but very difficult at times when two players need to do something in tandem - to complete like this. One map is way too hard, though - I think it's one of the speed gel maps. You can use noclip to complete it if you want. Open the console again, type in noclip, fly around the level, and type noclip again to fall. It helps to type bind "u" noclip so you have easy access to it. Reminder that it only works if sv_cheats is set to 1, and that will disable achievements and stats (like in the coop lobby) until you restart the game!

Note that the autoexec.cfg that you can download from my DropBox already has this functionality and keybinding...

... but thanks quoternary!
I'm running on Linux/OSX and this doesn't work?
The command "joy_remap_player_for_controller1" doesn't work on Linux or OSX. I don't know why that is, you'll have to ask people at Valve.

Though there is a way to move the keyboard + mouse to player 2:
in_forceuser 1 forces the keyboard and mouse to be played as player 2.
in_forceuser 0 resets the keyboard and mouse back to player 1.
This requires running sv_cheats 1 command first.

I can't use the emote/taunt wheel!
Currently the emote wheel does not work on Xbox controllers (360 and One) or keyboard. Furthermore, the camera can't be controlled with an Xbox controller (i.e. you cannot turn). Everything seems to work properly with the Steam Controller though.

Does this work with the Steam Controller?
After preliminary testing, I couldn't transfer the SC control over to player 2 with the method glossed in this guide.. I'll try investigating further.
I made this guide because there wasn't one already and the information across internet was hugely disappointing. If you found this guide useful or otherwise entertaining, thumbs up and high five.

If you have any questions regarding developer console or other related/unrelated, post them in the comments and I'll update the guide accordingly.

Special thanks to Suomis for further translations and tips!

< >
Eetami  [author] Aug 25 @ 9:42am 
If you're playing on Linux or Mac, it doesn't exist. If you're own Windows, it might have been removed at some point. This guide is quite old already, and might not be up-to-date.
Szupryt Aug 22 @ 3:18am 
Console says command does not exist
joy_remap_player_for_controller1 2
Eetami  [author] Jun 16 @ 10:34am 
Sounds messed up.
Dana Zane Jun 13 @ 7:36pm 
Hello I'm trying to play this game with a friend but th esecond controller (P-Body) can't look up or down. even with a mouse it just rubber bands back to looking head level.
Eetami  [author] May 30 @ 12:18pm 
Daddy's Lips: Sorry, no suggestions from me. I don't know what Portal Reloaded is so can't help you there.
Daddy's Lips May 28 @ 3:55am 
Trying to play Portal Reloaded w local coop. I would've assumed the steps would be the same or similar, I'm having a problem where both KB and controller are controlling the 2nd player, no matter what binds I use I can't get anything to control the 1st player, any suggestions? :(
🌹𝑹𝒐𝒔𝒂.♡ Apr 4 @ 2:23pm 
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀:demonlady: :ilstars::radiantheart: R&F :radiantheart::ilstars: :norairis:
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀:om_isabella: :ilstars::radiantheart: 𝑴𝒚 𝑵𝒆𝒘 𝑮𝒖𝒊𝒅𝒆 :radiantheart::ilstars: :chiasasmile:
:redishrose::radiantheart: 𝑴𝒖𝒄𝒉 𝒍𝒐𝒗𝒆 𝒇𝒓𝒐𝒎 𝑹𝒐𝒔𝒂, 𝒘𝒊𝒔𝒉𝒊𝒏𝒈 𝒚𝒐𝒖 𝒂 𝒃𝒍𝒐𝒐𝒅𝒚 𝒔𝒆𝒙𝒚 𝒏𝒊𝒈𝒉𝒕 :radiantheart::redishrose:
:ph_rose: https://steamcommunity.com/sharedfiles/filedetails/?id=2957379634 :ph_rose:
{TNT}Plutotom Jan 16 @ 2:24pm 
OP Thank you, Man!!
blufairybran Oct 15, 2022 @ 4:57pm 
░░░▌░▄▄▄▐▌▀▀▀░░ THIS IS BOB
▄░▐░░░▄▄░█░▀▀ ░░
▀█▌░░░▄░▀█▀░▀ ░░ COPY AND PASTE HIM
░░░░░░░▄▄▐▌▄▄░░░ SO HE CAN TAKE
░░░░░░░▀███▀█░▄░░ OVER STEAM
░░░░░░▐▌▀▄▀▄▀▐▄░░ AND THAT WILL TELL VALVE
░░░░░░▐▀░░░░░░▐▌░░ TO GIVE US PORTAL 3