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: Star Wars Script for GlovePie (wiimotes)  (Read 6048 times)

0 Members and 1 Guest are viewing this topic.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:July 03, 2025, 06:36:13 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Star Wars Script for GlovePie (wiimotes)
« on: January 25, 2007, 09:02:46 am »
I've been playing around with using my wiimotes on those odd-ball games on my mame cab, so I thought I would share.  You'll need to download glovepie (and obviously have a wiimote and bluetooth dongle) to get this to work. 

Take the text below, copy it, and save it to "YokeMame.pie" and run it.

To play hold the wiimote like you would in a racing game.  Your primary triggers are the B trigger and the 1 button.  Your secondary triggers (for other yoke games) are the d pad and the 2 button. 

It's a real simple script, but I'm just now learning the langauge so it's more of a test script than anything else.  Comments would be appreciated.

Code: [Select]
 
   //Yoke Style Script for MAME
   //Hold your wiimote in the "racing position"
   //Defaults are as follows:
   //Joystick 1 x axis = wiimote Left/Right Tilt
   //Joystick 1 y axis = wiimote Forward/Back Tilt
   //Insert Coin = - key
   //Start = + key
   //Exit Mame = Home
   //Button 1 = B Button or Button 1
   //Button 2 =Left D pad or Button 2
   //Pause = A Button


   //Note:  For this script to work, you must install ppjoy from:

   //http://www.geocities.com/deonvdw/Docs/PPJoyMain.htm

   //You must also add a Virtual joystick to ppjoy by selecting
   //"Virtual" as the port type and going through the add wizard
   //Joystick must also be enabled in mame, or set as the default
   //Type for the ad_stick contol type.


   one = Wiimote1.Plus
   five = Wiimote1.Minus
   escape = wiimote1.home
   p=wiimote1.a
   ppjoy.Digital0=wiimote1.b
   ppjoy.Digital1=wiimote1.up
   ppjoy.digital0=wiimote1.two
   ppjoy.digital1=wiimote1.one
 
   
   
   ppjoy.Analog0=wiimote1.gz
   ppjoy.Analog1=wiimote1.gx
   

    //We wait for a few mill or else glovepie takes all our cycles.
    wait 30ms


Lilwolf

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4945
  • Last login:July 31, 2022, 10:26:34 pm
Re: Star Wars Script for GlovePie (wiimotes)
« Reply #1 on: January 26, 2007, 08:22:48 am »
pretty cool.  Hows it play?

Also, how hard is it to move a single remote between a WII and yoru machine?  do you have to do anything to switch it back / forth?

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:July 03, 2025, 06:36:13 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Star Wars Script for GlovePie (wiimotes)
« Reply #2 on: January 26, 2007, 01:57:59 pm »
It plays suprisingly well.  It actually feels very similar to a star wars yoke due to the way you twist the remote forward and back to move up and down.  I got the idea while playing excite truck.  The calibration is slightly off, but it's very slight and it could be fixed in the script, I'm just too lazy. 

The connection of the wiimote is the hitch.  The author of glovepie has tried to make it as painless as possbile by having built in detection into his program (you press 1 and 2 to connect a wiimote, and hold power to disconnect it).  The problem is he only supports the bluesoleil bluetooth drivers, which don't work on most bluetooth dongles as they are kinda crappy (but open source). 

Most of your bluetooth dongles (including mine) use widcomm, which currently is a pain in the butt to deal with.  To connect a wiimote you first press and hold 1 and 2 and select "scan for devices" in window's bluetooth page.  The nintendo controller will show up and then you have to select it and "connect" to this device by holding down 1 and 2 again.  You'll go through a very short wizard to set it up, but if you run out of time with the pairing sequence (when you hold 1 and 2) you have to release and press again until it shows up with a HID service.  Now it'll connect and stay connected until you disable the connection or restart your computer.  Unfortunately, because the wiimote doesn't have a pairing code, you have to repeat those steps every time you wish to connect a wiimote. 

However....  connecting a device to bluetooth isn't terribly difficult programatically.  See the biggest part of the step is where the windows bluetooth window is searching for the device name and the interfae protocols it supports.  We already know those two things, so a forced connection could be called and all the user would have to do is hold 1 and 2 to put the wiimote in discover mode and left the app do the rest.  If someone can find me some widcomm api examples I should be able to whip us up a more cabinet friendly connector that works similarly to how the author of glove pie has set it up.  Then I'll pass the info onto him and hopefully he'll add support. 

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:July 03, 2025, 06:36:13 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Star Wars Script for GlovePie (wiimotes)
« Reply #3 on: January 26, 2007, 02:00:43 pm »
p.s. one annoyance is that bluetooth has a very long range.  I can literally use my wiimote on both my pc and my wii from anywhere in the house.  Once it's connected to one it won't talk to the other, but if you forget which one it's connected to and try to use it on the other you might accidentally turn on your wii or muck about in your pc while trying to use it on the opposite device. 

Lilwolf

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4945
  • Last login:July 31, 2022, 10:26:34 pm
Re: Star Wars Script for GlovePie (wiimotes)
« Reply #4 on: January 28, 2007, 10:26:35 am »
The connection back to the wii will be my problem.  If I leave it connected to the computer, and leave to work... my kids / wife will be pissed.

I also have a very cheap bluetooth doggle at the moment.  So I'm guessing I will have problems there too.

I was hoping that when I had the wii mote in the computer room, it would just detect it.

I think I'm playing with fire until we make it through Zelda, and possibly others :)




Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:July 03, 2025, 06:36:13 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Star Wars Script for GlovePie (wiimotes)
« Reply #5 on: January 28, 2007, 12:12:58 pm »
You won't have a bit of trouble with cheap bluetooth adaptors.  Got mine for 2 bucks from china, it works fine. 

Connecting is still a pain in the butt, but I've found a really easy way to disconnect.  Remove your dongle and then re-insert it.  Upon re-insertion it kills any links and thus your wiimote is back in "wii mode". 

BazookaJo

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 68
  • Last login:December 20, 2022, 03:53:30 pm
  • I want to build my own arcade controls!
    • BazookaJo Paper models
Re: Star Wars Script for GlovePie (wiimotes)
« Reply #6 on: May 02, 2007, 01:33:57 pm »
You won't have a bit of trouble with cheap bluetooth adaptors.  Got mine for 2 bucks from china, it works fine. 

Connecting is still a pain in the butt, but I've found a really easy way to disconnect.  Remove your dongle and then re-insert it.  Upon re-insertion it kills any links and thus your wiimote is back in "wii mode". 

Any star wars fans tried this yet......?
http://www.bazookajo.me.uk/ - home of the Marvin the Martian paper model :)