Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: wiimote motion sensor script glovepie with ppjoy  (Read 5232 times)

0 Members and 1 Guest are viewing this topic.

estrika

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 7
  • Last login:October 24, 2016, 09:54:15 am
wiimote motion sensor script glovepie with ppjoy
« on: May 01, 2012, 01:17:34 am »
hi again now i share my script to driving games, this script does the same that when playing driving games in wii.
you need ppjoy for this to work, like if you use it to play lightgun games in mame with wiimote then its good to go.

code:

// this script works with ppjoy default config and do the same work that mario kart in wii motion sensor
var.AlinhaVoltante = 3 // used to level wiimote
var.AjustaForca = -6.5 // used to align forceZ
// look for debug line and config this 2 lines to stay close of FORCE 0.00 and PPJOY closest to 0 too
//in my cab i have 0.00 and 0.13
//
var.AjustaAnalogico = 60 // 20 or 30 seems more precise but i prefer 60
//
PPJoy.Analog0 = ((wiimote.RawForceZ - var.AlinhaVoltante) / var.AjustaAnalogico)
//
VAR.FORCA = wiimote.RawForceZ -var.AjustaForca


DEBUG = "FORCE " + VAR.FORCA + " PPJOY " + PPJoy.Analog0
//
//directional buttons or gears
key.Q = wiimote.Up
key.A = wiimote.Right
key.W =wiimote.Down
key.S = wiimote.Left

if key.a || key.z then
var.RumbleLevel = 6
wait 500ms
wiimote.Rumble = true
wait 200ms
wiimote.Rumble = false
wait 60ms
endIf

// accelarator
Key.Up = Wiimote.One
//
// brakes
Key.Down = Wiimote.Two
//  credits and start p1
Key.5 = Wiimote.Plus
Key.1 = Wiimote.Minus
// handbrake
Key.Space = Wiimote.A

anyway this script was not done by me is from a brazilian guy i only have removed stuff like leds blinking when turning and the rumble that was almost all the time on.
but it works great with supermodel 3, model 2 and if well configured should work with mame, etc.