| View previous topic :: View next topic |
| Author |
Message |
steve51184
Joined: 20 Apr 2008 Posts: 5
Digg It |
Posted: Sun Apr 20, 2008 2:37 am Post subject: help setting up GlovePie + PPJoy to play resident evil 4 |
|
|
hi all i've been trying to setup my wii remote to work with resident evil 4 but i can't get the aiming right so i just wanted to know if anyone here has done the same successfully?
atm i'm using GlovePIE 0.30 and the below script but again i can't get the aiming right (will make a vid soon)
i think i need to use ppjoy as well but i have no info on how to set this up nor anywhere where i can go to ask
any help will be really appreciated
| Code: | /*'Resident Evil 4'
by Tiger ()
Thanks to Carl Kenner for 'IR to keys' code.
*******************************************************************************
This script is designed to map the controls of the PC version of 'Resident Evil
4' (a.k.a. 'Biohazard 4') to match the controls of the recently announced
'Resident Evil 4: Wii Edition' This script can be run without the use of any
mouse mods.
A video demonstration of this script can be seen here:
*******************************************************************************
To use the pointing/aiming functionality, this script requires two IR sources
such as in the Wii Sensor Bar, 3rd party Sensor Bars, or two candles. To use
an unmodified Wii Sensor Bar on the PC, simply sync your Remote to your PC,
then turn on the Wii.
Controls:
D-pad = Move camera
B button = Ready weapon / Aim
C button = Ready knife
A button = Action, attack, confirm
'Minus' button = Status screen
'Plus' button = Call Ashley
'1' button = Map
'Home' button = Options, skip movies
Z button = Run (while moving forward), 180 turn (while moving backward)
B button + move Remote = Aim weapon
B button + shake Remote = Reload
C button + shake Remote = Knife attack
*/
Left = Wiimote.Left //Camera left
Right = Wiimote.Right //Camera right
Up = Wiimote.Up //Camera up
Down = Wiimote.Down //Camera down
LeftShift = Nunchuk.CButton //Ready knife
RightShift = Wiimote.B //Ready weapon
Enter = Wiimote.A //Action, attack, confirm
F = Wiimote.Plus //Call Ashley
I = Wiimote.Minus //Status screen
M = Wiimote.One //Map
Esc = Wiimote.Home //Options, skip movies
RightCtrl = Nunchuk.ZButton //Run, 180 turn
var.IRCount = 2
//Wiimote knife
If Nunchuk.CButton
Enter = (Wiimote.RawAccX > 15) or (Wiimote.RawAccX < -15)
var.Cam = "Aim"
EndIf
//Wiimote reload
If Wiimote.B
RightCtrl = (Wiimote.RawAccX > 15) or (Wiimote.RawAccX < -15)
EndIf
// Camera/Aim
var.Cam = "Move"
If Wiimote.B
var.Cam = "Aim"
ElseIf released(Wiimote.B)
W = False
A = False
S = False
D = False
Else
var.Cam = "Move"
EndIf
If var.Cam = "Aim"
If var.IRCount = 1
If Wiimote.dot1vis
var.IRx = (1023-Wiimote.dot1x)
var.IRy = Wiimote.dot1y
var.IRvis = True
Else
var.IRvis = False
EndIf
Else
If Wiimote.dot1vis and Wiimote.dot2vis
var.IRx = 1023-(Wiimote.dot1x+Wiimote.dot2x)/2
var.IRy = (Wiimote.dot1y+Wiimote.dot2y)/2
var.IRvis = True
Else
var.IRvis = False
EndIf
EndIf
// Change in pointer position is mapped to "IR Joystick"
// You may need a minus sign in front of one of these
var.IRJoyX = MapRange(Smooth(Delta(var.IRx),2), -20,20, -1,1)
var.IRJoyY = MapRange(Smooth(Delta(var.IRy),2), -20,20, -1,1)
// Keep holding "IR Joystick" when aiming with pointer off the screen
If var.IRvis
var.Above = var.IRy < 80
var.Below = var.IRy > 690
var.ToLeft = var.IRx < 80
var.ToRight = var.IRx > 940
Else
If var.Above
var.IRJoyY = -1 // offscreen speed
ElseIf var.Below
var.IRJoyY = 1 // offscreen speed
EndIf
If var.ToLeft
var.IRJoyX = -1 // offscreen speed
ElseIf var.ToRight
var.IRJoyX = 1 // offscreen speed
EndIf
EndIf
If var.Cam = "Aim"
var.jx = var.OtherJoyX + var.IRJoyX + var.LeftOverX
var.jjx = var.OtherJoyX + var.IRJoyX + var.jLeftOverX
var.jy = var.OtherJoyX + var.IRJoyY + var.LeftOverY
var.jjy = var.OtherJoyX + var.IRJoyY + var.jLeftOverY
Else
var.jx = var.OtherJoyX + var.LeftOverX
var.jjx = Var.OtherJoyX + var.jLeftOverX
var.jy = Var.OtherJoyX + var.LeftOverY
var.jjy = Var.OtherJoyX + var.jLeftOverY
EndIf
If var.jx > 1
var.LeftOverX = var.jx - 1
var.jLeftOverX = Var.jjx - 1
var.LeftKey = False
var.RightKey = True
ElseIf var.jx < -1
var.LeftOverX = var.jx + 1
var.jLeftOverX = Var.jjx + 1
var.RightKey = False
var.LeftKey = True
Else
var.LeftOverX = var.jx
var.jLeftOverX = 0
var.LeftKey = False
var.RightKey = False
EndIf
If var.jy > 1
var.LeftOverY = var.jy - 1
var.jLeftOverY = Var.jjy - 1
var.UpKey = False
var.DownKey = True
ElseIf var.jy < -1
var.LeftOverY = var.jy + 1
var.jLeftOverY = Var.jjy + 1
var.DownKey = False
var.UpKey = True
Else
var.LeftOverY = var.jy
var.jLeftOverY = 0
var.UpKey = False
var.DownKey = False
EndIf
Key.W = var.UpKey
Key.S = var.DownKey
Key.A = var.LeftKey
Key.D = var.RightKey
PPJoy.Analog0 = var.PPJoyX
PPJoy.Analog1 = var.PPJoyY
var.PPJoyX = EnsureRange(var.jjx, -1, 1)
var.PPJoyY = EnsureRange(var.jjy, -1, 1)
ElseIf var.Cam = "Move"
//Joystick movement
If Nunchuk.JoyY > 0.55
S = True
Wait 10ms
S = False
EndIf
If Nunchuk.JoyY > 0.35 and < 0.55
S = True
Wait 25ms
S = False
EndIf
If Nunchuk.JoyY > 0.15 and < 0.35
S = True
Wait 35ms
S = False
EndIf
If Nunchuk.JoyY < -0.55
W = True
Wait 10ms
W = False
EndIf
If Nunchuk.JoyY < -0.35 and > -0.55
W = True
Wait 25ms
W = False
EndIf
If Nunchuk.JoyY < -0.15 and > -0.35
W = True
Wait 35ms
W = False
EndIf
If Nunchuk.JoyX < -0.55
A = True
Wait 10ms
A = False
EndIf
If Nunchuk.JoyX < -0.35 and > -0.55
A = True
Wait 25ms
A = False
EndIf
If Nunchuk.JoyX < -0.15 and > -0.35
A = True
Wait 35ms
A = False
EndIf
If Nunchuk.JoyX > 0.55
D = True
Wait 10ms
D = False
EndIf
If Nunchuk.JoyX > 0.35 and < 0.55
D = True
Wait 25ms
D = False
EndIf
If Nunchuk.JoyX > 0.15 and < 0.35
D = True
Wait 35ms
D = False
EndIf
EndIf
var.dummy = Wiimote.RawForceX
var.dummy = Wiimote.RawForceZ |
|
|
| Back to top |
|
 |
steve51184
Joined: 20 Apr 2008 Posts: 5
Digg It |
Posted: Sun Apr 20, 2008 3:11 am Post subject: |
|
|
seems i've got PPJoy to work with my wiimote with the below script and i can now use it as a pc pad (kinda cool but untested on games as of yet) but i fail to see how this helps me with the RE4 script :\
| Code: | //EMULATION DE 4 JOYSTICKS / 4 WIIMOTES + NUNCHUKS
//Emulation PPJoy virtual joystick/Wiimote + Nunchuk = 13 boutons / 8 axes
//Axes XY = Joystick Nunchuk (XY)
//Axes de rotations XY = pointeur Wiimote (SensorBar)
//Axe Z = Roll Wiimote (Motion sensor Wiimote Gauche/Droite)
//Axe de rotation Z = Pitch Wiimote (Motion sensor Wiimote Haut/Bas)
//Le cadran = Roll Nunchuk (Motion sensor Nunchuk Gauche/Droite)
//La molette = Pitch Nunchuk (Motion sensor Nunchuk Haut/Bas)
//Joystick 1 = Wiimote 1
PPJoy.Analog0 = Wiimote1.Nunchuk.JoyX
PPJoy.Analog1 = Wiimote1.Nunchuk.JoyY
PPJoy.Analog6 = (Wiimote1.pointerY - 1/2)*2
PPJoy.Analog5 = (Wiimote1.pointerX - 1/2)*2
PPJoy.Analog2 = (Wiimote1.Roll - 6)/50
PPJoy.Analog3 = -(Wiimote1.Pitch + 6)/35
PPJoy.Analog4 = -(Wiimote1.Nunchuk.Pitch - 10 )/60
PPJoy.Analog7 = (Wiimote1.Nunchuk.Roll)/60
PPJoy.Digital0 = Wiimote1.B
PPJoy.Digital1 = Wiimote1.A
PPJoy.Digital2 = Wiimote1.minus
PPJoy.Digital3 = Wiimote1.PLUS
PPJoy.Digital4 = Wiimote1.Nunchuk.ZButton
PPJoy.Digital5 = Wiimote1.Nunchuk.CButton
PPJoy.Digital6 = Wiimote1.Home
PPJoy.Digital7 = wiimote1.one
PPJoy.Digital8 = Wiimote1.two
PPJoy.Digital9 = Wiimote1.Up
PPJoy.Digital10 = Wiimote1.Down
PPJoy.Digital11 = Wiimote1.Left
PPJoy.Digital12 = Wiimote1.Right
//Joystick 2 = Wiimote 2
PPJoy1.Analog0 = Wiimote2.Nunchuk.JoyX
PPJoy1.Analog1 = Wiimote2.Nunchuk.JoyY
PPJoy1.Analog6 = (Wiimote2.pointerY - 1/2)*2
PPJoy1.Analog5 = (Wiimote2.pointerX - 1/2)*2
PPJoy1.Analog2 = (Wiimote2.Roll - 6)/50
PPJoy1.Analog3 = -(Wiimote2.Pitch + 6)/35
PPJoy1.Analog4 = -(Wiimote2.Nunchuk.Pitch - 10 )/60
PPJoy1.Analog7 = (Wiimote2.Nunchuk.Roll)/60
PPJoy1.Digital0 = Wiimote2.B
PPJoy1.Digital1 = Wiimote2.A
PPJoy1.Digital2 = Wiimote2.minus
PPJoy1.Digital3 = Wiimote2.PLUS
PPJoy1.Digital4 = Wiimote2.Nunchuk.ZButton
PPJoy1.Digital5 = Wiimote2.Nunchuk.CButton
PPJoy1.Digital6 = Wiimote2.Home
PPJoy1.Digital7 = wiimote2.one
PPJoy1.Digital8 = Wiimote2.two
PPJoy1.Digital9 = Wiimote2.Up
PPJoy1.Digital10 = Wiimote2.Down
PPJoy1.Digital11 = Wiimote2.Left
PPJoy1.Digital12 = Wiimote2.Right
//Joystick 3 = Wiimote 3
PPJoy2.Analog0 = Wiimote3.Nunchuk.JoyX
PPJoy2.Analog1 = Wiimote3.Nunchuk.JoyY
PPJoy2.Analog6 = (Wiimote3.pointerY - 1/2)*2
PPJoy2.Analog5 = (Wiimote3.pointerX - 1/2)*2
PPJoy2.Analog2 = (Wiimote3.Roll - 6)/50
PPJoy2.Analog3 = -(Wiimote3.Pitch + 6)/35
PPJoy2.Analog4 = -(Wiimote3.Nunchuk.Pitch - 10 )/60
PPJoy2.Analog7 = (Wiimote3.Nunchuk.Roll)/60
PPJoy2.Digital0 = Wiimote3.B
PPJoy2.Digital1 = Wiimote3.A
PPJoy2.Digital2 = Wiimote3.minus
PPJoy2.Digital3 = Wiimote3.PLUS
PPJoy2.Digital4 = Wiimote3.Nunchuk.ZButton
PPJoy2.Digital5 = Wiimote3.Nunchuk.CButton
PPJoy2.Digital6 = Wiimote3.Home
PPJoy2.Digital7 = wiimote3.one
PPJoy2.Digital8 = Wiimote3.two
PPJoy2.Digital9 = Wiimote3.Up
PPJoy2.Digital10 = Wiimote3.Down
PPJoy2.Digital11 = Wiimote3.Left
PPJoy2.Digital12 = Wiimote3.Right
//Joystick 4 = Wiimote 4
PPJoy3.Analog0 = Wiimote4.Nunchuk.JoyX
PPJoy3.Analog1 = Wiimote4.Nunchuk.JoyY
PPJoy3.Analog6 = (Wiimote4.pointerY - 1/2)*2
PPJoy3.Analog5 = (Wiimote4.pointerX - 1/2)*2
PPJoy3.Analog2 = (Wiimote4.Roll - 6)/50
PPJoy3.Analog3 = -(Wiimote4.Pitch + 6)/35
PPJoy3.Analog4 = -(Wiimote4.Nunchuk.Pitch - 10 )/60
PPJoy3.Analog7 = (Wiimote4.Nunchuk.Roll)/60
PPJoy3.Digital0 = Wiimote4.B
PPJoy3.Digital1 = Wiimote4.A
PPJoy3.Digital2 = Wiimote4.minus
PPJoy3.Digital3 = Wiimote4.PLUS
PPJoy3.Digital4 = Wiimote4.Nunchuk.ZButton
PPJoy3.Digital5 = Wiimote4.Nunchuk.CButton
PPJoy3.Digital6 = Wiimote4.Home
PPJoy3.Digital7 = wiimote4.one
PPJoy3.Digital8 = Wiimote4.two
PPJoy3.Digital9 = Wiimote4.Up
PPJoy3.Digital10 = Wiimote4.Down
PPJoy3.Digital11 = Wiimote4.Left
PPJoy3.Digital12 = Wiimote4.Right |
|
|
| Back to top |
|
 |
TigerGD
Joined: 16 Apr 2007 Posts: 72 Location: SoCal
Digg It |
Posted: Sat Apr 26, 2008 3:02 pm Post subject: |
|
|
| The script should work with or without PPJoy. With PPJoy enabled, it will automatically revert to joystick emulation. I haven't tested it in GlovePIE .30, so you may want to run it in .29. |
|
| Back to top |
|
 |
steve51184
Joined: 20 Apr 2008 Posts: 5
Digg It |
Posted: Sat Apr 26, 2008 3:22 pm Post subject: |
|
|
| but how do i set ppjoy up? or do i just install/start it? |
|
| Back to top |
|
 |
TigerGD
Joined: 16 Apr 2007 Posts: 72 Location: SoCal
Digg It |
Posted: Sat Apr 26, 2008 11:19 pm Post subject: |
|
|
| steve51184 wrote: | | but how do i set ppjoy up? or do i just install/start it? | I don't remember. It's been a while since I've used that or played RE4 with that script. I'm not sure if it works in Vista, in case that's what you're running on. |
|
| Back to top |
|
 |
steve51184
Joined: 20 Apr 2008 Posts: 5
Digg It |
Posted: Sun Apr 27, 2008 9:05 am Post subject: |
|
|
na i have xp
i don't suppose you have a wiimote and a bit of spare time do you?  |
|
| Back to top |
|
 |
TigerGD
Joined: 16 Apr 2007 Posts: 72 Location: SoCal
Digg It |
Posted: Sun Apr 27, 2008 3:20 pm Post subject: |
|
|
| steve51184 wrote: | na i have xp
i don't suppose you have a wiimote and a bit of spare time do you?  | I've got my Wiimote here, but I'm on a Vista computer. Maybe next weekend. I've got XP and RE4 installed on my home computer and can give it a shot when I go there. |
|
| Back to top |
|
 |
|