View Single Post
Old 05-28-2011, 02:35 PM   #482
Posts: n/a
One mouse, one keyboard

In case anyone's really masochistic, or, like me, has a small daughter who won't take 'no' for an answer. I have no Xbox controllers. I have Wii controllers, but no bluetooth, it seems. (I do have some spare mice and keyboards but I didn't get that far -- in any case we are sitting in front of one screen so there's not a lot of room.)

Outline procedure:

* Get PPJoy. Create TWO virtual joysticks. This is the crucial step -- otherwise any joystick control commands you create will just control player one.

* Get GlovePIE. Set up a script like this:

PPJoy2.Digital0 = Keyboard.NumPadEnter
PPJoy2.Digital1 = Keyboard.NumpadPlus
PPJoy2.Digital3 = Keyboard.NumpadMinus
PPJoy2.Digital5 = Keyboard.NumPad0
PPJoy2.Digital6 = Keyboard.NumPad1
PPJoy2.Digital2 = Keyboard.NumPad9
//PPJoy2.Digital8 = Keyboard.NumPad7

if HeldDown(Keyboard.NumPad8,0) then
   PPJoy2.Analog1 = -1
else if HeldDown(Keyboard.NumPad2,0) then
     PPJoy2.Analog1 = 1
else if HeldDown(Keyboard.NumPad4,0) then
     PPJoy2.Analog0 = -1
else if HeldDown(Keyboard.NumPad6,0) then
     PPJoy2.Analog0 = 1
    PPJoy2.Analog0 = 0
    PPJoy2.Analog1 = 0

if HeldDown(Keyboard.Down,0) then
   PPJoy2.Analog3 = 1
else if HeldDown(Keyboard.Up,0) then
    PPJoy2.Analog3 = -1
else if HeldDown(Keyboard.Left,0) then
     PPJoy2.Analog4 = -1
else if HeldDown(Keyboard.Right,0) then
     PPJoy2.Analog4 = 1
    PPJoy2.Analog3 = 0
    PPJoy2.Analog4 = 0
and run it.

* Make a modified version of the standard joy_coop_360 script, say like this:

cmd2 joy_name "Xbox360 controller"

cmd2 joy_advanced 1
cmd2 joy_advaxisx 3
cmd2 joy_advaxisy 1
cmd2 joy_advaxisz 0
cmd2 joy_advaxisr 2
cmd2 joy_advaxisu 4
cmd2 joy_advaxisv 0

cmd2 joy_forwardsensitivity -1
cmd2 joy_sidesensitivity 1
cmd2 joy_pitchsensitivity 0.75
cmd2 joy_pitchsensitivity_default 0.75
cmd2 joy_yawsensitivity -1.5
cmd2 joy_yawsensitivity_default -1.5
cmd2 joy_autoaimdampenrange 0.85
cmd2 joy_autoaimdampen 0.5
cmd2 joy_lowend 0.75
cmd2 joy_lowmap 0.25
cmd2 joy_no_accel_scale 1
cmd2 joy_accelscale 2.0
cmd2 joy_accelmax 1.0
cmd2 joy_response_move 5
cmd2 joy_response_look 1
cmd2 joyadvancedupdate
cmd2 crosshair 1
cmd2 hud_draw_fixed_reticle 1

cmd2 bind "JOY1" "+jump"			// (A) Button
cmd2 bind "JOY2" "+duck"			// (B) Button
cmd2 bind "JOY3" "+use"				// (X) Button
cmd2 bind "JOY4" "+remote_view"			// (Y) Button
cmd2 bind "JOY5" "+quick_ping"			// Left Bumper
cmd2 bind "JOY6" "+attack"			// Right Bumper
cmd2 bind "JOY7" "+attack2"	// Back ("select") Button
cmd2 bind "JOY8" "+mouse_menu_taunt"		// Start Button
cmd2 bind "JOY9" "+mouse_menu"		// Left Stick In
cmd2 unbind "JOY10" //"+zoom"			// Right Stick In
cmd2 unbind "JOY11"
cmd2 unbind "JOY12"

cmd2 bind "Z AXIS POS" "+attack2"		// Left Trigger
cmd2 bind "Z AXIS NEG" "+attack"		// Right Trigger

cmd2 bind "POV_UP" "+mouse_menu_taunt"		// D-Pad
cmd2 bind "POV_LEFT" "+mouse_menu"		// D-Pad
cmd2 unbind "POV_RIGHT" //"+mouse_menu"		// D-Pad
cmd2 unbind "POV_DOWN" //"+mouse_menu_taunt"	// D-Pad

cmd2 joystick 1
cmd2 sk_autoaim_mode 2
cmd2 +jlook
(This is changed mainly to put stuff on buttons because those are marginally easy to deal with on GlovePIE.)

* Same procedure as before. Start game, enter co-op mode, in dev console do ss_map mp_coop_lobby2, exec joy_coop_360.

* If you are brave enough to do this you probably understand the GlovePIE commands -- second player has movement and basic controls via the numeric keypad, view direction changes with the arrow keys. These bindings work for us to share a keyboard. They are a bit clunky but usable.

* Probably having figured out the fact that a second controller is needed to make the cmd2 commands work I could have used keybindings for some of this.

* GlovePIE can distinguish between mice, so if anyone can tell me how to use a second mouse to control player 2's view direction, I would love to hear from them.
  Reply With Quote