EcXForce
Joined: 06 Feb 2007 Posts: 5
Digg It |
Posted: Thu Mar 08, 2007 10:07 pm Post subject: Anyone who is looking for a HyperBowl Script.. |
|
|
Since I didn't see anyone post a script for HyperBowl Plus!/Arcade I decided to code one up.
I hope ya'll like it.
| Code: | // INFO: Calibrate using the x/y/z trim vars below before playing :P
//
// Specifically created for HyperBowling Arcade/Plus (Script v0.002)
// by EcX-Force
//
// Wiimote Key Config:
// Up = Adds to Turning Speed of Bowling Ball by 0.2
// Down = Subtracts Turning Speed of Bowling Ball by 0.2
// Left = Subtracts Rolling Speed of Bowling Ball by 0.4
// Right = Adds to Rolling Speed of Bowling Ball by 0.4
// One = Adds to Turn Locking Range by 1.0
// Two = Subtracts Turn Locking Range by 1.0
// A = Enable/Disable Wiimote Control ingame
// B = Mapped to Keyboard Escape
// Home = Mapped to Keyboard Enter
// Minus = Mapped to Keyboard Left
// Plus = Mapped to Keyboard Right
// Setup Framerate (How many cpu cycles to give to the script)...
Pie.FrameRate = 65 Hz
// Turn off leds, don't wanna waste batts
Wiimote.Leds = false
// To calibrate, run this program and put the Wiimote on a flat surface face-up.
// Then read the values in the debug line, change these values until
// the debug line reads approx. all zeros.
var.xtrim = 8
var.ytrim = -34
var.ztrim = 7
// Setup variables once...
if (var.once = 0) then
var.r_speed = 2.1
var.t_speed = 1.6
var.t_lock = 14
var.once = 1
endif
// Press Left/Right [-/+] to change Roll Speed, & Up/Down [+/-] for Turn Speed...
if (Pressed(Wiimote.Left)) then
var.r_speed = var.r_speed - 0.4
endif
if (Pressed(Wiimote.Right)) then
var.r_speed = var.r_speed + 0.4
endif
// Make sure it doesn't go below or equal to 0...
if (var.r_speed <= 0) then
var.r_speed = var.r_speed + 1.0
endif
if (Pressed(Wiimote.Up)) then
var.t_speed = var.t_speed + 0.2
endif
if (Pressed(Wiimote.Down)) then
var.t_speed = var.t_speed - 0.2
endif
// Make sure it doesn't go below or equal to 0 or greater then 4...
if (var.t_speed <= 0) then
var.t_speed = 1.4
endif
if (var.t_speed > 4) then
var.t_speed = var.t_speed - 1.4
endif
// Setup for buttons 1 & 2 [+/-], for locking the range it tilt/turn (Bowling Ball)...
if (Pressed(Wiimote.One)) then
var.t_lock = var.t_lock + 1
endif
if (Pressed(Wiimote.Two)) then
var.t_lock = var.t_lock - 1
endif
// Make sure tilt/turn locking doesn't go below 0 or above 25...
if (var.t_lock < 0) then
var.t_lock = 14 // Set to default...
endif
if (var.t_lock > 25) then
var.t_lock = var.t_lock - 20 // Subtract 20 to make sure we're not above 25...
endif
if (Pressed(Wiimote.A)) then
var.input = !var.input
var.once = 0 // Reset variables, so we can change em on enable/disabling of the wiimote...
endif
Keyboard.Escape = Pressed(Wiimote.B)
Keyboard.Enter = Pressed(Wiimote.Home)
Keyboard.Left = Pressed(Wiimote.Minus)
Keyboard.Right = Pressed(Wiimote.Plus)
var.m_x = Wiimote.RawForceX + var.xtrim
var.m_y = Wiimote.RawForceY + var.ytrim
var.m_z = Wiimote.RawForceZ + var.ztrim
var.m_roll = Wiimote.Roll
var.m_pitch = Wiimote.Pitch
if (var.input == 1) then
if (var.m_y < -15) and (var.m_z > 10) then
Mouse.DirectInputY = Mouse.DirectInputY - var.m_y * -var.r_speed
endif
if (var.m_y >= 0) then // Resets mouse so bowling ball doesn't go out of control
Mouse.DirectInputY = Mouse.DirectInputY + 4
endif
if (var.m_x <= -var.t_lock) then
Mouse.DirectInputX = Mouse.DirectInputX - var.m_x * var.t_speed
endif
if (var.m_x >= var.t_lock) then
Mouse.DirectInputX = Mouse.DirectInputX + -var.m_x * var.t_speed
endif
endif
if (var.input == 0) then
debug = "x: " + var.m_x + " y: " + var.m_y + " z: " + var.m_z + " roll: " + var.m_roll + " pitch: " + var.m_pitch
else
debug = "r_speed: " + var.r_speed + " t_speed: " + var.t_speed + " t_lock: " + var.t_lock
endif |
|
|