This first script is for simple two-handed Wiimote button control of SkyRim. Note: this is only button control so don't expect to be swinging your Wiimotes to emulate sword-play just yet
Code: Select all
MOUSE_SPEED = 3;
-- Right Wiimote
-- mouse cursor/ aiming
if (wiimote[0]:getRight()) then
mouse.DeltaX = MOUSE_SPEED;
elseif (wiimote[0]:Left()) then
mouse.DeltaX = -MOUSE_SPEED;
end
if (wiimote[0]:getUp()) then
mouse.DeltaY = -MOUSE_SPEED;
elseif (wiimote[0]:getDown()) then
mouse.DeltaY = MOUSE_SPEED;
end
-- right attack
mouse.LeftButton = wiimote[0]:getB();
-- jump
keyboard:setKey(Key.Space, wiimote[0]:getA());
-- crouch/sneak toggle
keyboard:setKey(Key.LeftControl, wiimote[0]:getMinus());
-- run toggle
keyboard:setKey(Key.CapsLock, wiimote[0]:getPlus());
-- inventory
keyboard:setKey(Key.Tab, wiimote[0]:getHome());
-- Enter
keyboard:setKey(Key.Return, wiimote[0]:getOne());
-- Esc
keyboard:setKey(Key.Escape, wiimote[0]:getTwo());
-- Left Wiimote
-- character motion
keyboard:setKey(Key.W, wiimote[1]:getUp());
keyboard:setKey(Key.A, wiimote[1]:getLeft());
keyboard:setKey(Key.S, wiimote[1]:getDown());
keyboard:setKey(Key.D, wiimote[1]:getRight());
-- left attack
mouse.RightButton = wiimote[1]:getB();
-- use
keyboard:setKey(Key.E, wiimote[1]:getA());
-- put away weapon
keyboard:setKey(Key.R, wiimote[1]:getMinus());
-- shout
keyboard:setKey(Key.Z, wiimote[1]:getPlus());