i personaly saw this and thought it could work very well
https://forums.oculus.com/viewtopic.php?t=6853
https://www.youtube.com/watch?v=jI266__ ... e=youtu.be
but its glovepie and doesnt work with my TR wiimotes
anyways im noy asking for code or anything im just asking for suggestions for a newbie thx guys
---UPDATE--
using that video and some scripts i found with a little guess work i was able to make this script
you put the first set of wiimotes in your pockets and use the joystick on the second set to pick a direction, you wont move to actually run in place though
could use a little work but i ran around whiterun in skyrim for about 30 mins with this and it seemed actually not too bad
next up, fine tuning and button mapping.
lemme know what ya guys think
Code: Select all
def map_wiimote_to_key(wiimote_index, wiimote_button, key):
# Check the global wiimote object's button state and set the global
# keyboard object's corresponding key.
if wiimote[wiimote_index].buttons.button_down(wiimote_button):
keyboard.setKeyDown(key)
else:
keyboard.setKeyUp(key)
def log_acceleration():
diagnostics.watch(wiimote[0].acceleration.x)
diagnostics.watch(wiimote[0].acceleration.y)
diagnostics.watch(wiimote[0].acceleration.z)
diagnostics.watch(wiimote[1].acceleration.x)
diagnostics.watch(wiimote[1].acceleration.y)
diagnostics.watch(wiimote[1].acceleration.z)
if wiimote[0].acceleration.y > 20:
if wiimote[1].nunchuck.stick.y > 20:
keyboard.setKeyDown(Key.W)
else keyboard.setKeyUp(Key.W):
if wiimote[1].nunchuck.stick.y < -20:
keyboard.setKeyDown(Key.S)
else keyboard.setKeyUp(Key.):
if wiimote[1].nunchuck.stick.x > 20:
keyboard.setKeyDown(Key.D)
if wiimote[1].nunchuck.stick.x < -20:
keyboard.setKeyDown(Key.A)
def log_motionplus():
diagnostics.watch(wiimote[0].ahrs.yaw)
diagnostics.watch(wiimote[0].ahrs.pitch)
diagnostics.watch(wiimote[0].ahrs.roll)
def log_nunchuck():
diagnostics.watch(wiimote[0].nunchuck.acceleration.x)
diagnostics.watch(wiimote[0].nunchuck.stick.y)
diagnostics.watch(wiimote[0].nunchuck.acceleration.y)
diagnostics.watch(wiimote[0].nunchuck.acceleration.z)
diagnostics.watch(wiimote[0].nunchuck.buttons.button_down(NunchuckButtons.Z))
if wiimote[0].nunchuck.acceleration.y > 20:
if wiimote[1].nunchuck.stick.y > 20:
keyboard.setPressed(Key.W)
if wiimote[1].nunchuck.stick.y < -20:
keyboard.setPressed(Key.S)
if wiimote[1].nunchuck.stick.x > 20:
keyboard.setPressed(Key.D)
if wiimote[1].nunchuck.stick.x < -20:
keyboard.setPressed(Key.A)
def update():
# Sideways controls (DPad). Map each of our desired keys.
map_wiimote_to_key(0, WiimoteButtons.DPadRight, Key.UpArrow)
map_wiimote_to_key(0, WiimoteButtons.DPadLeft, Key.DownArrow)
map_wiimote_to_key(0, WiimoteButtons.DPadUp, Key.LeftArrow)
map_wiimote_to_key(0, WiimoteButtons.DPadDown, Key.RightArrow)
# 1 button --> Z key
map_wiimote_to_key(0, WiimoteButtons.One, Key.Z)
# 2 button --> X key
map_wiimote_to_key(0, WiimoteButtons.Two, Key.X)
# - button --> Right shift key
map_wiimote_to_key(0, WiimoteButtons.Minus, Key.RightShift)
# + button --> Enter key
map_wiimote_to_key(0, WiimoteButtons.Plus, Key.Return)
# If we're starting up, then hook up our update function.
if starting:
# wiimote[0].enable(WiimoteCapabilities.MotionPlus | WiimoteCapabilities.Extension)
# wiimote[1].enable(WiimoteCapabilities.MotionPlus | WiimoteCapabilities.Extension)
wiimote[0].buttons.update += update
wiimote[0].nunchuck.update += log_nunchuck
wiimote[0].motionplus.update += log_motionplus
wiimote[0].acceleration.update += log_acceleration
wiimote[1].buttons.update += update
wiimote[1].nunchuck.update += log_nunchuck
wiimote[1].motionplus.update += log_motionplus
wiimote[1].acceleration.update += log_acceleration