Author Topic: Another n00b needs help.  (Read 7351 times)

Offline orangedragon

  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
on: July 01, 2011, 05:19:35 PM
I've been trying to control Deer Hunter 2005 with a wii zapper. I've gotten everything connected, but when I use the joystick on the nunchuk to move, my hunter won't stop moving when I stop pushing the joystick. Also, the hunter moves in the opposite direction than what I pushed, I push forward and move backward for example. I probably have the x and y things backwards...but I figured I'd post that problem in case it's being caused by something else.

Here is the Glove Pie script I'm using.

                             Keyboard.LeftArrow = Nunchuk.JoyX-1
                             Keyboard.RightArrow = Nunchuk.JoyX+1
                             Keyboard.UpArrow = Nunchuk.JoyY-1
                             Keyboard.DownArrow = Nunchuk.JoyY+1

                             //Crouching and standing up
                             Keyboard.X = Wiimote.Down
                             Keyboard.C = Wiimote.Up

                             //Walking and running
                             Keyboard.LeftShift = Wiimote.Left
                             Keyboard.RightShift = Wiimote.Right

                             //Raising and lowering scope,
                             Mouse.LeftButton = Wiimote.B
                             Mouse.RightButton = Wiimote.A

                             //Zooming scope out and in
                             Keyboard.M = Wiimote.Plus
                             Keyboard.N = Wiimote.Minus

                             Keyboard.R = Nunchuk.Z

                             //Accessing inventory
                             Keyboard.Space = Nunchuk.C

                             Keyboard.Escape = Wiimote.Two

                             //Entering and exiting vehicle, actions
                             Keyboard.Enter = Wiimote.One

                             //Shooting, using item
                             Keyboard.LeftCtrl = Wiimote.B

                             //Mouse cursor
                             if wiimote.PointerVisible but not var.PointerBump then
                             mouse.x = wiimote.PointerX
                             mouse.y = wiimote.PointerY
                             end if

So...what did I do wrong? Your site has been very helpful btw. Google brought me here when I was researching how to use wiimotes on computer games, and I learned everything I needed to know from this site.

Offline bg4m3r

  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Reply #1 on: July 30, 2011, 07:53:29 PM
the problem is that your nunchuk joystick doesn't center to exactly 0...this is normal, and may gradually get worse as the nunchuk wears out. You just need to define a deadzone, like this
Code: [Select] = 0.2

Keyboard.LeftArrow = Nunchuk.JoyX < -(
Keyboard.RightArrow = Nunchuk.JoyX > (
Keyboard.UpArrow = Nunchuk.JoyY > (
Keyboard.DownArrow = Nunchuk.JoyY < -(
To make the deadzone bigger/smaller, just change that variable ( value and it will be applied to all 4 directions.
As for the inverted movement, I don't know why it's like this, but just swap the key assignments. My classic controller does the same thing...the axis output is backwards, it's not your fault. :)