/*------------------------------------------------------------------------------ Ori and the Blind Forest - Wiimote Script By: Bighead - http://bhemuhelp.co.nf/ - bighead.0@gmail.com Supports: Wiimote + Nunchuk, Classic Controller, Sensor Bar Maps To: Keyboard + Mouse -------------------------------------------------------------------------------- NOTE: DO NOT PLUG or UNPLUG EXTENSIONS WHILE THE SCRIPT IS RUNNING or KEYBOARD ARROW KEY INPUTS WILL GET STUCK. THIS WILL MAKE IT HARDER TO STOP THE SCRIPT. -------------------------------------------------------------------------------- Wiimote + Nunchuk Controls: +------------------+--------------------+-------------------------+ | Action | Button | Mapped From | +------------------+--------------------+-------------------------+ | Movement | Analog | Keyboard W/A/S/D | | Charge Jump | Analog Up | Keyboard W | | Stomp | Analog Down | Keyboard S | | Jump | B | Keyboard Space | | Soul Link | Home | Keyboard E | | Spirit Flame | A | Mouse Left Button | | Bash | C | Mouse Right Button | | Grab / Glide | Z | Keyboard Shift | | Main Menu | + | Keyboard Esc. | | Map | - | Keyboard Tab | | Map Zoom In | Z/D-Pad Up | Keyboard Shift | | Map Zoom Out | C/D-Pad Down | Keyboard Cntrl | | Map Legend | 1 | Keyboard L | | Toggle Objective | 2 | Keyboard F | +------------------+--------------------+-------------------------+ Classic Controller Controls: +------------------+--------------------+-------------------------+ | Action | Button | Mapped From | +------------------+--------------------+-------------------------+ | Movement | D-Pad/L Analog | Keyboard W/A/S/D | | Charge Jump | L Analog Up | Keyboard W | | Stomp | L Analog Down | Keyboard S | | Jump | b | Keyboard Space | | Soul Link | a | Keyboard E | | Spirit Flame | y | Mouse Left | | Bash | x | Mouse Right | | Grab / Glide | ZR | Keyboard Shift | | Main Menu | + | Keyboard Esc. | | Map | - | Keyboard Tab | | Map Zoom In | ZR/R Analog Up | Keyboard Shift | | Map Zoom Out | ZL/R Analog Down | Keyboard Cntrl | | Map Legend | L | Keyboard L | | Toggle Objective | R | Keyboard F | +------------------+--------------------+-------------------------+ ------------------------------------------------------------------------------*/ // Initial stuff. if (Starting) then var.smoothmouse = true var.clickfreeze = 0ms PIE.FrameRate = 120Hz Keyboard.RepeatFakeKeys = false endif //------------------------------------------------------------------------------ // Mouse Pointer/Sensor var.pressA = (KeepDown(Pressed(Wiimote.A), var.clickfreeze)) var.pressB = (KeepDown(Pressed(Wiimote.B), var.clickfreeze)) var.checkPress = (var.pressA) or (var.pressB) // Update the mouse pointer with WiiMote values. var.wiiX = MapRange(Wiimote.PointerX, 0, 1, -0.05, 1.05) var.wiiY = MapRange(Wiimote.PointerY, 0, 1, -0.1, 1.1) if (Wiimote.PointerVisible) and (var.checkPress == false) then if (var.smoothmouse) then Mouse.X = Smooth(var.wiiX, 10, 0.00025) Mouse.Y = Smooth(var.wiiY, 10, 0.00025) else Mouse.X = var.wiiX Mouse.Y = var.wiiY endif endif //------------------------------------------------------------------------------ // Classic Controller Controls if (Wiimote.Classic.Exists) then // Controls / Stomp / Charge Jump Keyboard.W + Keyboard.Up = (-2 < Wiimote.Classic.Joy1Y < -0.4) or Wiimote.Classic.Up Keyboard.A + Keyboard.Left = (-2 < Wiimote.Classic.Joy1X < -0.4) or Wiimote.Classic.Left Keyboard.S + Keyboard.Down = (2 > Wiimote.Classic.Joy1Y > 0.4) or Wiimote.Classic.Down Keyboard.D + Keyboard.Right = (2 > Wiimote.Classic.Joy1X > 0.4) or Wiimote.Classic.Right // Jump Keyboard.Space = Wiimote.Classic.b // Soul Link Keyboard.E = Wiimote.Classic.a // Spirit Flame Mouse.LeftButton = Wiimote.Classic.y or Wiimote.A // Bash Mouse.RightButton = Wiimote.Classic.x or Wiimote.B // Grab / Glide / Map Zoom In Keyboard.RightShift = Wiimote.Classic.ZR or (-2 < Wiimote.Classic.Joy2Y < -0.4) // Map Zoom Out Keyboard.LeftControl = Wiimote.Classic.ZL or (2 > Wiimote.Classic.Joy2Y > 0.4) // Map Keyboard.Tab = Wiimote.Classic.Minus // Main Menu Keyboard.Escape = Wiimote.Classic.Plus // Map Legend Keyboard.L = Wiimote.Classic.L // Toggle Objective Keyboard.F = Wiimote.Classic.R //------------------------------------------------------------------------------ // Wiimote + Nunchuk Controls elseif (Wiimote.Nunchuk.Exists) then // Controls / Stomp / Charge Jump Keyboard.W + Keyboard.Up = (-2 < Wiimote.Nunchuk.JoyY < -0.4) Keyboard.A + Keyboard.Left = (-2 < Wiimote.Nunchuk.JoyX < -0.4) Keyboard.S + Keyboard.Down = (2 > Wiimote.Nunchuk.JoyY > 0.4) Keyboard.D + Keyboard.Right = (2 > Wiimote.Nunchuk.JoyX > 0.4) // Jump Keyboard.Space = Wiimote.B // Soul Link Keyboard.E = Wiimote.Home // Spirit Flame Mouse.LeftButton = Wiimote.A // Bash / Map Zoom Out Mouse.RightButton + Keyboard.LeftControl = Wiimote.Nunchuk.C or Wiimote.Down // Grab / Glide / Map Zoom In Keyboard.RightShift = Wiimote.Nunchuk.Z or Wiimote.Up // Map Keyboard.Tab = Wiimote.Minus // Main Menu Keyboard.Escape = Wiimote.Plus // Map Legend Keyboard.L = Wiimote.One // Toggle Objective Keyboard.F = Wiimote.Two endif