Jogando Left4dead com Wiimotes em Splitscreen

Posted on 14:38 by Neno


Tai, é um processo longo mais irei postar para o pessoal que joga de 2 e tem Wii




Vamos ao Processo

Voce vai precisar de:

Two Wiimotes
A Sensorbar
A bluetooth dongle
Glovepie
PPJoy
JoyID
Left 4 Dead


1º - Instale o Gloviepie http://carl.kenner.googlepages.com/glovepie_download e o PPJoy http://ppjoy.bossstation.dnsalias.org/ . Com eles instalados voce pode conectar seus Wiimotes no pc via Bluetooth dongle e usa-lo como controle virtual. Para mais detalhes entre em : http://www.wiili.org/index.php/GlovePie:Scripting.

2º -Configure o PPJoy mapiando os controles 1 e 2

6 Axes 16 Buttons 1 POV Hat
Axes
1 - X Axis - Analog 0
2 - Y Axis - Analog 1
3 - Z Axis - Analog 2
4 - X Rotation - Analog 3
5 - Slider - Analog 4
6 - Throttle - Analog 5
Buttons
Button 1-16 — Digital 4-19
Directional POV
NEWS - Digital 0-3



3º - Crie um arquivo, Wii2p.cfg, Na sua pasta de Cfg do l4d(/Left 4 Dead/left4dead/cfg). E ponha estes comandos:





unbindall // Prevent mouse/keyboard control when gamepad is in use (to prevent autoaim exploit) joystick 1 joy_advanced “1″ // use advanced joystick options (allows for multiple axes) joy_name “L4D WII Joystick Configuration” joy_advaxisx 3 // ok x-axis controls GAME_AXIS_SIDE (strafing left and right) joy_advaxisy 1 // y-axis controls GAME_AXIS_FORWARD (move forward and back) joy_advaxisz 0 // z-axis is treated like a button joy_advaxisr 2 // r-axis controls GAME_AXIS_PITCH (look up and down) joy_advaxisu 4 // u-axis controls GAME_AXIS_YAW (look left and right) joy_advaxisv 0 // v-axis is unused joy_forwardsensitivity -1.0 // movement sensitivity joy_sidesensitivity 1.0 joy_forwardthreshold 0.1 // movement dead zone settings joy_sidethreshold 0.1 joy_pitchsensitivity 1 // look sensitivity joy_yawsensitivity -3 joy_pitchsensitivity2 1 // look sensitivity joy_yawsensitivity2 -3 sensitivity 3 joy_pitchthreshold 0.0 // look dead zone settings joy_yawthreshold 0.0 joy_inverty2 0 joy_variable_frametime 1 joy_autoaimdampenrange 0.85 joy_autoaimdampen 0.5 joy_lowend 0.65 joy_lowmap 0.15 joy_accelscale 1 joy_accelmax 1 joy_response_move 5 joy_response_look 0 joy_autoaimdampen 0.3 joy_autoaimdampenrange 0.85 joyadvancedupdate // advanced joystick update allows for analog control of move and look // Alternate control 2 cmd2 bind “0″ “slot10″ cmd2 bind “1″ “slot1″ cmd2 bind “2″ “slot2″ cmd2 bind “3″ “slot3″ cmd2 bind “4″ “slot4″ cmd2 bind “5″ “slot5″ cmd2 bind “6″ “slot6″ cmd2 bind “7″ “slot7″ cmd2 bind “8″ “slot8″ cmd2 bind “9″ “slot9″ cmd2 bind “a” “+moveleft” cmd2 bind “c” “+voicerecord” cmd2 bind “d” “+moveright” cmd2 bind “e” “+use” cmd2 bind “f” “impulse 100″ cmd2 bind “h” “motd” cmd2 bind “m” “chooseteam” cmd2 bind “q” “lastinv”` cmd2 bind “r” “+reload” cmd2 bind “s” “+back” cmd2 bind “t” “impulse 201″ cmd2 bind “u” “messagemode2″ cmd2 bind “w” “+forward” cmd2 bind “x” “+mouse_menu QA” cmd2 bind “y” “messagemode” cmd2 bind “z” “+mouse_menu Orders” cmd2 bind “`” “toggleconsole” cmd2 bind “SPACE” “+jump” cmd2 bind “TAB” “+showscores” cmd2 bind “ESCAPE” “cancelselect” cmd2 bind “SHIFT” “+speed” cmd2 bind “CTRL” “+duck” cmd2 bind “F1″ “Vote Yes” cmd2 bind “F2″ “Vote No” cmd2 bind “F5″ “jpeg” cmd2 bind “MOUSE1″ “+attack” cmd2 bind “MOUSE2″ “+attack2″ cmd2 bind “MOUSE3″ “+zoom” cmd2 bind “MWHEELUP” “invprev” cmd2 bind “MWHEELDOWN” “invnext” // controller 1 bindings +jlook // enable joystick look cmd1 bind “JOY1″ “+jump;+menuAccept” // (A) button - Jump -menuAccpt allows us to make selections on hud menus cmd1 bind “JOY10″ “+reload” // (B) button - Reload cmd1 bind “RIGHT” “+use” // (X) Use cmd1 bind “LEFT” “lastinv” // (Y) button - swap pistol/rifle or z_abort -used to respawn as a ghost. cmd1 bind “JOY3″ “+attack” // RT - Main weapon - Primary trigger cmd1 bind “JOY4″ “+attack2″ // LT - Melee cmd1 bind “joy11″ “+lookspin” // RB - Fast 180 spin cmd1 bind “JOY2″ “toggle_duck” // LB - Duck - is also used to give objects to people. cmd1 bind “UP” “vocalize smartlook” // LS - vocalize cmd1 bind “DOWN” “+zoom” // RS click - Rifle Zoom cmd1 bind “” “togglescores” // (back) button - scores cmd1 bind “JOY9″ “pause” // (start) button - pause cmd1 bind “” “+menuUp” // Hud menu Up cmd1 bind “” “+menuDown” // Hud menu Down cmd1 bind “JOY8″ “impulse 100″ // DPad Up - Toggle flashlight cmd1 bind “JOY7″ “slot3″ // DPad Left - grenade cmd1 bind “joy6″ “slot4″ // DPad Right - health cmd1 bind “joy5″ “slot5″ // DPad Down - Pills // controller 2 cmd2 +jlook // enable joystick look cmd2 bind “JOY1″ “+jump;+menuAccept” // (A) button - Jump -menuAccpt allows us to make selections on hud menus cmd2 bind “JOY10″ “+reload” // (B) button - Reload cmd2 bind “RIGHT” “+use” // (X) Use cmd2 bind “LEFT” “lastinv” // (Y) button - swap pistol/rifle or z_abort -used to respawn as a ghost. cmd2 bind “JOY3″ “+attack” // RT - Main weapon - Primary trigger cmd2 bind “JOY4″ “+attack2″ // LT - Melee cmd2 bind “joy11″ “+lookspin” // RB - Fast 180 spin cmd2 bind “JOY2″ “toggle_duck” // LB - Duck - is also used to give objects to people. cmd2 bind “UP” “vocalize smartlook” // LS - vocalize cmd2 bind “DOWN” “+zoom” // RS click - Rifle Zoom cmd2 bind “” “togglescores” // (back) button - scores cmd2 bind “JOY9″ “pause” // (start) button - pause cmd2 bind “” “+menuUp” // Hud menu Up cmd2 bind “” “+menuDown” // Hud menu Down cmd2 bind “JOY8″ “impulse 100″ // DPad Up - Toggle flashlight cmd2 bind “JOY7″ “slot3″ // DPad Left - grenade cmd2 bind “joy6″ “slot4″ // DPad Right - health cmd2 bind “joy5″ “slot5″ // DPad Down - Pills




4 -Use este script no Glovepie :


// Customized by redtani for Left 4 Dead
// button mapping by jeromote
// shake controls from Community FPS script from Wiili.org
// aiming by Carl Kenner, modified by Bakou for Joysticks
// modify the aiming part below based on the resolution of your monitor


// Nunchuk
// Movement
ppjoy1.Analog0 = Wiimote1.Nunchuk.JoyX
ppjoy1.Analog1 = Wiimote1.Nunchuk.JoyY
ppjoy2.analog0 = wiimote2.Nunchuk.JoyX
ppjoy2.analog1 = wiimote2.Nunchuk.JoyY
// Jump
ppjoy1.Digital5 = Wiimote1.Nunchuk.ZButton
ppjoy2.Digital5 = Wiimote2.Nunchuk.ZButton


// Duck
ppjoy1.Digital6 = Wiimote1.Nunchuk.CButton
ppjoy2.Digital6 = Wiimote2.Nunchuk.CButton


// Wiimote
// Keyboard and Wiimote = up/down/left/right
ppjoy1.Digital0 = Wiimote1.Up
ppjoy1.Digital3 = Wiimote1.Down
ppjoy1.Digital2 = Wiimote1.Left
ppjoy1.Digital1 = Wiimote1.Right
ppjoy2.Digital0 = Wiimote2.Up
ppjoy2.Digital3 = Wiimote2.Down
ppjoy2.Digital2 = Wiimote2.Left
ppjoy2.Digital1 = Wiimote2.Right


// Fire
ppjoy1.Digital7 = Wiimote1.B
ppjoy2.Digital7 = Wiimote2.B
// Melee
ppjoy1.Digital8 = Wiimote1.A
ppjoy2.Digital8 = Wiimote2.A


ppjoy1.digital9 = Wiimote1.Minus
ppjoy2.digital9 = Wiimote2.Minus
// Keyboard = divide / Wiimote = home
ppjoy1.Digital10 = Wiimote1.Home
ppjoy2.Digital10 = Wiimote2.Home


// Keyboard and Wiimote = plus
ppjoy1.Digital11 = Wiimote1.Plus
ppjoy2.Digital11 = Wiimote2.Plus


// Keyboard = enter / Wiimote = one
ppjoy1.Digital12 = Wiimote1.One
ppjoy2.Digital12 = Wiimote2.One


// Keyboard = escape / Wiimote = two
ppjoy1.Digital13 = Wiimote1.Two
ppjoy2.Digital13 = Wiimote2.Two


// Shake Controls
if (Wiimote1.RelAccX > 35 or < -35) or (Wiimote1.RelAccY > 35 or < -35) or (Wiimote1.RelAccZ > 35 or < -35)
ppjoy1.Digital14 = true
else
ppjoy1.Digital14 = false
var.swing = 0
endif
if (Wiimote2.RelAccX > 35 or < -35) or (Wiimote2.RelAccY > 35 or < -35) or (Wiimote2.RelAccZ > 35 or < -35)
ppjoy2.Digital14 = true
else
ppjoy2.Digital14 = false
var.swing = 0
endif
//For a Nunchuk swing, do the same thing here:
if (Wiimote1.Nunchuk.RawAccX > 25 or < -25) or (Wiimote1.Nunchuk.RawAccY > 25 or < -25) or (Wiimote1.Nunchuk.RawAcc > 25 or < -25)
ppjoy1.Digital15 = true
else
ppjoy1.Digital15 = false
endif
if (Wiimote2.Nunchuk.RawAccX > 25 or < -25) or (Wiimote2.Nunchuk.RawAccY > 25 or < -25) or (Wiimote2.Nunchuk.RawAcc > 25 or < -25)
ppjoy2.Digital15 = true
else
ppjoy2.Digital15 = false
endif


Wiimote1.Led1 = True
Wiimote2.Led2 = TRue


// Change these values for wiimote1:
var.SensorBarSeparation = 6.0 inches // distance between middles of two sensor bar dots
var.NoYawAllowed = true // Calculates X if no yaw is allowed, otherwise calculates Yaw but not X
var.IRMulX = 1.0
var.IRMulY = 1.0
var.IROffsetX = 0 // add to mouse.x
var.IROffsetY = 0 // add to mouse.y


// change these values for wiimote2
var.SecondSensorBarSeparation = 6.0 inches // distance between middles of two sensor bar dots
var.SecondNoYawAllowed = true // Calculates X if no yaw is allowed, otherwise calculates Yaw but not X
var.SecondIRMulX = 1.2
var.SecondIRMulY = 1.2
var.SecondIROffsetX = 0 // add to mouse.x
var.SecondIROffsetY = 0 // add to mouse.y


// Code for wiimote 1 ————————————————————————————


// Compensate for roll
var.c = cos(Smooth(wiimote1.roll, 10))
var.s = sin(Smooth(wiimote1.roll, 10))
if wiimote1.dot1vis then
var.dot1x = var.c*(511.5-wiimote1.dot1x)/511.5 - var.s*(wiimote1.dot1y-383.5)/511.5
var.dot1y = var.s*(511.5-wiimote1.dot1x)/511.5 + var.c*(wiimote1.dot1y-383.5)/511.5
end if
if wiimote1.dot2vis then
var.dot2x = var.c*(511.5-wiimote1.dot2x)/511.5 - var.s*(wiimote1.dot2y-383.5)/511.5
var.dot2y = var.s*(511.5-wiimote1.dot2x)/511.5 + var.c*(wiimote1.dot2y-383.5)/511.5
end if


// if both dots are visible check which is which and how far apart
if wiimote1.dot1vis and wiimote1.dot2vis then
if var.dot1x <= var.dot2x then
var.leftdot = 1
var.dotdeltay = var.dot2y - var.dot1y
else
var.leftdot = 2
var.dotdeltay = var.dot1y - var.dot2y
end if
var.dotdeltax = abs(var.dot1x-var.dot2x)
var.DotSep = hypot(var.dotdeltax, var.dotdeltay) * 511.5
var.IRDistance = var.SensorBarSeparation * 1320 / var.DotSep
end if


// sort out the position of the left and right dots
if var.leftdot = 1 then
if wiimote1.dot1vis and wiimote1.dot2vis then
var.LeftDotX = var.dot1x
var.LeftDotY = var.dot1y
var.LeftDotVis = true
var.RightDotX = var.dot2x
var.RightDotY = var.dot2y
var.RightDotVis = true
else if wiimote1.dot1vis then
if hypot(var.leftdotx-var.dot1x,var.leftdoty-var.dot1y) <= hypot(var.rightdotx-var.dot1x,var.rightdoty-var.dot1y) then
// is the real dot 1
var.LeftDotX = var.dot1x
var.LeftDotY = var.dot1y
var.RightDotX = var.dot1x + var.dotdeltax
var.RightDotY = var.dot1y + var.dotdeltay
var.LeftDotVis = true
var.RightDotVis = false
else
// was originally dot 2, but now called dot 1.
var.leftdot = 2 // this dot (1) is actually the right dot
var.LeftDotX = var.dot1x - var.dotdeltax
var.LeftDotY = var.dot1y - var.dotdeltay
var.RightDotX = var.dot1x
var.RightDotY = var.dot1y
var.RightDotVis = true
var.LeftDotVis = false
end if
else if wiimote1.dot2vis then
var.LeftDotX = var.dot2x - var.dotdeltax
var.LeftDotY = var.dot2y - var.dotdeltay
var.RightDotX = var.dot2x
var.RightDotY = var.dot2y
var.RightDotVis = true
var.LeftDotVis = false
end if
else if var.leftdot = 2 then
if wiimote1.dot1vis and wiimote1.dot2vis then
var.LeftDotX = var.dot2x
var.LeftDotY = var.dot2y
var.LeftDotVis = true
var.RightDotX = var.dot1x
var.RightDotY = var.dot1y
var.RightDotVis = true
else if wiimote1.dot1vis then
if hypot(var.leftdotx-var.dot1x,var.leftdoty-var.dot1y) <= hypot(var.rightdotx-var.dot1x,var.rightdoty-var.dot1y) then
var.leftdot = 1 // dot 1 is now the left dot
var.LeftDotX = var.dot1x
var.LeftDotY = var.dot1y
var.RightDotX = var.dot1x + var.dotdeltax
var.RightDotY = var.dot1y + var.dotdeltay
var.LeftDotVis = true
var.RightDotVis = false
else
// the real dot 1 (on the right)
var.LeftDotX = var.dot1x - var.dotdeltax
var.LeftDotY = var.dot1y - var.dotdeltay
var.RightDotX = var.dot1x
var.RightDotY = var.dot1y
var.RightDotVis = true
var.LeftDotVis = false
end if
else if wiimote1.dot2vis then
var.RightDotX = var.dot2x + var.dotdeltax
var.RightDotY = var.dot2y + var.dotdeltay
var.LeftDotX = var.dot2x
var.LeftDotY = var.dot2y
var.LeftDotVis = true
var.RightDotVis = false
end if
else
var.LeftDotX = var.dot1x
var.LeftDotY = var.dot1y
var.RightDotX = var.LeftDotX
var.RightDotY = var.LeftDotY
var.LeftDotVis = true
var.RightDotVis = true
end if


// Find the imaginary middle dot
var.MiddleDotX = (var.leftdotx + var.rightdotx)/2
var.MiddleDotY = (var.leftdoty + var.rightdoty)/2
var.MiddleDotVis = wiimote1.dot1vis or wiimote1.dot2vis


if var.MiddleDotVis then
var.TotalPitch = atan2(511.5*var.MiddleDotY,1320) + Wiimote.Pitch
var.DotYaw = atan2(-511.5*var.MiddleDotX,1320) // assume yaw is 0
var.WiimoteYawNoX = atan2(511.5*var.MiddleDotX,1320)
var.WiimoteXNoYaw = -sin(var.dotyaw)*var.IRDistance
var.WiimoteY = -sin(var.totalpitch)*var.IRDistance
var.WiimoteZ = (-sqrt(sqr(var.IRDistance) - sqr(var.WiimoteY)))*var.IRDistance/RemoveUnits(var.IRDistance)
end if


// scale it to the screen range 0 to 1
var.IRx = var.IRMulX*var.middledotx/2 + 0.5
var.IRy = var.IRMulY*var.middledoty*1359/767/2 + 0.5
var.IRvis = wiimote1.dot1vis or wiimote1.dot2vis
var.IROnScreen = 0 <= var.IRx <= 1 and 0 <= var.IRy <= 1


// is it off the screen?
var.IRTooFarLeft = var.IRx < 0 or (var.IRx < 0.1 and (not var.IRvis))
var.IRTooFarRight = var.IRx > 1 or (var.IRx > 1-0.1 and (not var.IRvis))
var.IRTooFarUp = var.IRy < 0 or (var.IRy < 0.1 and (not var.IRvis))
var.IRTooFarDown = var.IRy > 1 or (var.IRy > 1-0.1 and (not var.IRvis))


// Heavily smooth small movements, but do zero lag for quick movements
var.MoveAmount = 1360*hypot(delta(var.IRx), delta(var.IRy))
if smooth(var.MoveAmount) > 12 then
var.SmoothX = var.IRx
var.SmoothY = var.IRy
var.LastSureFrame = PIE.Frame
else if (PIE.frame-var.LastSureFrame) > 18 then
var.SmoothX = Smooth(var.IRx, 18, 4/1360)
var.SmoothY = Smooth(var.IRy, 18, 4/1360)
else if (PIE.frame-var.LastSureFrame) > 14 then
var.SmoothX = Smooth(var.IRx, 14, 4/1360)
var.SmoothY = Smooth(var.IRy, 14, 4/1360)
else if (PIE.frame-var.LastSureFrame) > 10 then
var.SmoothX = Smooth(var.IRx, 10, 4/1360)
var.SmoothY = Smooth(var.IRy, 10, 4/1360)
else if (PIE.frame-var.LastSureFrame) > 6 then
var.SmoothX = Smooth(var.IRx, 6, 4/1360)
var.SmoothY = Smooth(var.IRy, 6, 4/1360)
else if (PIE.frame-var.LastSureFrame) > 2 then
var.SmoothX = Smooth(var.IRx, 2, 4/1360)
var.SmoothY = Smooth(var.IRy, 2, 4/1360)
end if


// Freeze the mouse cursor while they start pressing the button
// otherwise it will make the cursor jump
var.Freeze = (var.IRLeftButton or var.IRRightButton) and KeepDown(pressed(var.IRLeftButton) or pressed(var.IRRightButton), var.FreezeTime)


// Only change the mouse position if pointing at the screen
// otherwise they can still use a real mouse
if var.IRvis and (not var.Freeze) then
// convert to joystick coordinates
ppjoy1.Analog4 = (var.SmoothX - 0.5 ) * 2.0
ppjoy1.Analog5 = (var.SmoothY - 0.5 ) * 2.0
end if


// Code for wiimote #2 ————————————————————————————


// Compensate for roll
var.Secondc = cos(Smooth(wiimote2.roll, 10))
var.Seconds = sin(Smooth(wiimote2.roll, 10))
if wiimote2.dot1vis then
var.Seconddot1x = var.Secondc*(511.5-wiimote2.dot1x)/511.5 - var.Seconds*(wiimote2.dot1y-383.5)/511.5
var.Seconddot1y = var.Seconds*(511.5-wiimote2.dot1x)/511.5 + var.Secondc*(wiimote2.dot1y-383.5)/511.5
end if
if wiimote2.dot2vis then
var.Seconddot2x = var.Secondc*(511.5-wiimote2.dot2x)/511.5 - var.Seconds*(wiimote2.dot2y-383.5)/511.5
var.Seconddot2y = var.Seconds*(511.5-wiimote2.dot2x)/511.5 + var.Secondc*(wiimote2.dot2y-383.5)/511.5
end if


// if both dots are visible check which is which and how far apart
if wiimote2.dot1vis and wiimote2.dot2vis then
if var.Seconddot1x <= var.Seconddot2x then
var.Secondleftdot = 1
var.Seconddotdeltay = var.Seconddot2y - var.Seconddot1y
else
var.Secondleftdot = 2
var.Seconddotdeltay = var.Seconddot1y - var.Seconddot2y
end if
var.Seconddotdeltax = abs(var.Seconddot1x-var.Seconddot2x)
var.SecondDotSep = hypot(var.Seconddotdeltax, var.Seconddotdeltay) * 511.5
var.SecondIRDistance = var.SecondSensorBarSeparation * 1320 / var.SecondDotSep
end if


// sort out the position of the left and right dots
if var.Secondleftdot = 1 then
if wiimote2.dot1vis and wiimote2.dot2vis then
var.SecondLeftDotX = var.Seconddot1x
var.SecondLeftDotY = var.Seconddot1y
var.SecondLeftDotVis = true
var.SecondRightDotX = var.Seconddot2x
var.SecondRightDotY = var.Seconddot2y
var.SecondRightDotVis = true
else if wiimote2.dot1vis then
if hypot(var.Secondleftdotx-var.Seconddot1x,var.Secondleftdoty-var.Seconddot1y) <= hypot(var.Secondrightdotx-var.Seconddot1x,var.Secondrightdoty-var.Seconddot1y) then
// is the real dot 1
var.SecondLeftDotX = var.Seconddot1x
var.SecondLeftDotY = var.Seconddot1y
var.SecondRightDotX = var.Seconddot1x + var.Seconddotdeltax
var.SecondRightDotY = var.Seconddot1y + var.Seconddotdeltay
var.SecondLeftDotVis = true
var.SecondRightDotVis = false
else
// was originally dot 2, but now called dot 1.
var.Secondleftdot = 2 // this dot (1) is actually the right dot
var.SecondLeftDotX = var.Seconddot1x - var.Seconddotdeltax
var.SecondLeftDotY = var.Seconddot1y - var.Seconddotdeltay
var.SecondRightDotX = var.Seconddot1x
var.SecondRightDotY = var.Seconddot1y
var.SecondRightDotVis = true
var.SecondLeftDotVis = false
end if
else if wiimote2.dot2vis then
var.SecondLeftDotX = var.Seconddot2x - var.Seconddotdeltax
var.SecondLeftDotY = var.Seconddot2y - var.Seconddotdeltay
var.SecondRightDotX = var.Seconddot2x
var.SecondRightDotY = var.Seconddot2y
var.SecondRightDotVis = true
var.SecondLeftDotVis = false
end if
else if var.Secondleftdot = 2 then
if wiimote2.dot1vis and wiimote2.dot2vis then
var.SecondLeftDotX = var.Seconddot2x
var.SecondLeftDotY = var.Seconddot2y
var.SecondLeftDotVis = true
var.SecondRightDotX = var.Seconddot1x
var.SecondRightDotY = var.Seconddot1y
var.SecondRightDotVis = true
else if wiimote2.dot1vis then
if hypot(var.Secondleftdotx-var.Seconddot1x,var.Secondleftdoty-var.Seconddot1y) <= hypot(var.Secondrightdotx-var.Seconddot1x,var.Secondrightdoty-var.Seconddot1y) then
var.Secondleftdot = 1 // dot 1 is now the left dot
var.SecondLeftDotX = var.Seconddot1x
var.SecondLeftDotY = var.Seconddot1y
var.SecondRightDotX = var.Seconddot1x + var.Seconddotdeltax
var.SecondRightDotY = var.Seconddot1y + var.Seconddotdeltay
var.SecondLeftDotVis = true
var.SecondRightDotVis = false
else
// the real dot 1 (on the right)
var.SecondLeftDotX = var.Seconddot1x - var.Seconddotdeltax
var.SecondLeftDotY = var.Seconddot1y - var.Seconddotdeltay
var.SecondRightDotX = var.Seconddot1x
var.SecondRightDotY = var.Seconddot1y
var.SecondRightDotVis = true
var.SecondLeftDotVis = false
end if
else if wiimote2.dot2vis then
var.SecondRightDotX = var.Seconddot2x + var.Seconddotdeltax
var.SecondRightDotY = var.Seconddot2y + var.Seconddotdeltay
var.SecondLeftDotX = var.Seconddot2x
var.SecondLeftDotY = var.Seconddot2y
var.SecondLeftDotVis = true
var.SecondRightDotVis = false
end if
else
var.SecondLeftDotX = var.Seconddot1x
var.SecondLeftDotY = var.Seconddot1y
var.SecondRightDotX = var.SecondLeftDotX
var.SecondRightDotY = var.SecondLeftDotY
var.SecondLeftDotVis = true
var.SecondRightDotVis = true
end if


// Find the imaginary middle dot
var.SecondMiddleDotX = (var.Secondleftdotx + var.Secondrightdotx)/2
var.SecondMiddleDotY = (var.Secondleftdoty + var.Secondrightdoty)/2
var.SecondMiddleDotVis = wiimote2.dot1vis or wiimote2.dot2vis


if var.SecondMiddleDotVis then
var.SecondTotalPitch = atan2(511.5*var.SecondMiddleDotY,1320) + Wiimote.Pitch
var.SecondDotYaw = atan2(-511.5*var.SecondMiddleDotX,1320) // assume yaw is 0
var.SecondWiimoteYawNoX = atan2(511.5*var.SecondMiddleDotX,1320)
var.SecondWiimoteXNoYaw = -sin(var.Seconddotyaw)*var.SecondIRDistance
var.SecondWiimoteY = -sin(var.Secondtotalpitch)*var.SecondIRDistance
var.SecondWiimoteZ = (-sqrt(sqr(var.SecondIRDistance) - sqr(var.SecondWiimoteY)))*var.SecondIRDistance/RemoveUnits(var.SecondIRDistance)
end if


// scale it to the screen range 0 to 1
var.SecondIRx = var.SecondIRMulX*var.Secondmiddledotx/2 + 0.5
var.SecondIRy = var.SecondIRMulY*var.Secondmiddledoty*1359/767/2 + 0.5
var.SecondIRvis = wiimote2.dot1vis or wiimote2.dot2vis
var.SecondIROnScreen = 0 <= var.SecondIRx <= 1 and 0 <= var.SecondIRy <= 1


// is it off the screen?
var.SecondIRTooFarLeft = var.SecondIRx < 0 or (var.SecondIRx < 0.1 and (not var.SecondIRvis))
var.SecondIRTooFarRight = var.SecondIRx > 1 or (var.SecondIRx > 1-0.1 and (not var.SecondIRvis))
var.SecondIRTooFarUp = var.SecondIRy < 0 or (var.SecondIRy < 0.1 and (not var.SecondIRvis))
var.SecondIRTooFarDown = var.SecondIRy > 1 or (var.SecondIRy > 1-0.1 and (not var.SecondIRvis))


// Heavily smooth small movements, but do zero lag for quick movements
var.SecondMoveAmount = 1360*hypot(delta(var.SecondIRx), delta(var.SecondIRy))
if smooth(var.SecondMoveAmount) > 12 then
var.SecondSmoothX = var.SecondIRx
var.SecondSmoothY = var.SecondIRy
var.SecondLastSureFrame = PIE.Frame
else if (PIE.frame-var.SecondLastSureFrame) > 18 then
var.SecondSmoothX = Smooth(var.SecondIRx, 18, 4/1360)
var.SecondSmoothY = Smooth(var.SecondIRy, 18, 4/1360)
else if (PIE.frame-var.SecondLastSureFrame) > 14 then
var.SecondSmoothX = Smooth(var.SecondIRx, 14, 4/1360)
var.SecondSmoothY = Smooth(var.SecondIRy, 14, 4/1360)
else if (PIE.frame-var.SecondLastSureFrame) > 10 then
var.SecondSmoothX = Smooth(var.SecondIRx, 10, 4/1360)
var.SecondSmoothY = Smooth(var.SecondIRy, 10, 4/1360)
else if (PIE.frame-var.SecondLastSureFrame) > 6 then
var.SecondSmoothX = Smooth(var.SecondIRx, 6, 4/1360)
var.SecondSmoothY = Smooth(var.SecondIRy, 6, 4/1360)
else if (PIE.frame-var.SecondLastSureFrame) > 2 then
var.SecondSmoothX = Smooth(var.SecondIRx, 2, 4/1360)
var.SecondSmoothY = Smooth(var.SecondIRy, 2, 4/1360)
end if


// Freeze the mouse cursor while they start pressing the button
// otherwise it will make the cursor jump
var.SecondFreeze = (var.SecondIRLeftButton or var.SecondIRRightButton) and KeepDown(pressed(var.SecondIRLeftButton) or pressed(var.SecondIRRightButton), var.SecondFreezeTime)


// Only change the mouse position if pointing at the screen
// otherwise they can still use a real mouse
if var.SecondIRvis and (not var.SecondFreeze) then
// convert to joystick coordinates
ppjoy2.Analog4 = (var.SecondSmoothX - 0.5 ) * 2.0
ppjoy2.Analog5 = (var.SecondSmoothY - 0.5 ) * 2.0
end if


5 -Tenha certeza que seus Wiimotes estao com ids 1 e 2. Como é a primeira instalaçao provavelmente eles estaram 1 e 3. Para corrigir baixe o JoyiD: http://www.wingmanteam.com/latest_software/gadgets.htm#JoyIDs_Utility

6 -Conecte seus Wiimotes no PC e rode o GlovePie Script. Os leds do wiimote iram dizer qual eh player 1 e qual eh o player 2.

7 -Ligue seu Wii. Apenas para os sensores de IR ligarem e estarem funcionando para voce jogar.

8 -Entre no L4d e no console digite isso ou c preferir por no Autoexec :


exec Wii2p.cfg
ss_enable 1
ss_splitmode 2 [if your monitor is widescreen. otherwise the default value is ok, and you don't need to type this]


E começe um jogo Single Player

9 - Unplugue e Plugue os "nunchakos".

10 - Configure no GlovePie os scripts e no Wii2p.cfg. Para calibrar a mira, ajuste esses comandos no Wii2p.cfg.


joy_pitchsensitivity 1 //vertical sensitivity
joy_yawsensitivity -3 //horizontal sensitivity
joy_pitchsensitivity2 1 // vertical sensitivity for Player 2
joy_yawsensitivity2 -3 // horizontal sensitivity for Player 2


11 - Proceed to Mercy Hospital for evacuation.

No Response to "Jogando Left4dead com Wiimotes em Splitscreen"

Leave A Reply