Main > Lightguns

Wingun, lightgun, guncon 2 troubles aplenty

<< < (3/11) > >>

Howard_Casto:
Andy Warren... he owns Ultimarc.... everybody knows that.  ;)

felix pontifex:
Well, I registered and posted on the GlovePIE forums, hopefully I can get the answers I am looking for from them when it comes to getting a Wii remote to pretend to be a light gun. I also think I found the thread on what guns can be used for the ultimarc kit. Guncons are part of it.

It's too bad I don't know Andy.
==========

*Runs back into the thread*

Hey, I'm back, and I have some potentially good news! I found a script for GlovePIE that allows for screen calibration to use a wii remote like a light gun!

Good Lord it was hard tracking it down though. After hours and hours of searching, sending emails to people who I had no idea whether they would ever respond, and crawling on my knees along the obscure strands on the corners of the web, I finally found the site I was looking for. it was called wiili.org. The only problem was, it had been shut down 3 years ago! Considering that the GlovePIE forums as well as the wiki lacked the information I needed, I knew that the only possible place to get my answer was to get to this site, considering it was a repository of many many scripts for the program, and much like the Library of Alexandria, it was a treasure that did not stand the test of time, and has left us a less enriched humanity on the whole. I was very dismayed at first, as there was no way, conventionally or with portals that I could get there. So, I gave up. I walked away from my computer, and spent a bit of time just enjoying the real world. Then, as I was hanging up a clock on the bathroom wall I fell and hit my head on the toilet seat, and when I came to, I had a revelation... If I hook up a Nintendo 64 while playing a gold cartridge version of Ocarina of Time in the Fire Temple, where the original music was different from later versions, to a full sized phone booth, and then pull part of the corner of the cartridge out, I could travel back in time! And I did! So I found the script I was looking for, now all I need to do is wait until my bluetooth USB dongle comes in the mail, then I can test the script out with my wii remote. If it works then I will try to see if the Penguin United Crossfire Pistol works with GlovePIE. If it doesn't, then screaming and hair-pulling will ensue, followed by reverse engineering and seeing if I can switch the guts or chips or something to make it work. In the mean time while we wait, I will leave the script with you.




/*Wii Light Gun
 Version 0.1
 Written April 27th, 2008

 Scripted by Tre Lantana
 AKA WearingTheHatofShame
 AKA Anonymous J
 AKA BisKit
 AKA Biz Kit

  ________________
 |                |
 |     NOTES:     |
 |________________|
 This script will only work on games and applications that
   do not require direct input to be used.
 For example, this can be used with:
   most emulators,
   House of the Dead 2
   House of the Dead 3
   Most PC Light gun games
   Etcetera

  ________________
 |                |
 |  Instructions  |
 |________________|

   Start the script
   Aim at the top edge of the screen and press B
   Aim at the bottom edge of the screen and press B
   Aim at the left edge of the screen and press B
   Aim at the right edge of the screen and press B
   Enjoy

  ________________
 |                |
 |   Controls:    |
 |________________|

   Point at the screen to move the mouse

   Wiimote Btn  - Keyboard/Mouse Button
   B Button     - Left Click (mouse)
   A Button     - Right Click (mouse)
   1 Button     - Middle Click (mouse)
   2 Button     - Enter (keyboard)
   Dpad Up      - W (keyboard)
   Dpad Left    - A (keyboard)
   Dpad Down    - S (keyboard)
   Dpad Right   - D (keyboard)
   Plus Button  - Numpad Plus (keyboard)
   Minus Button - Numpad Minus (keyboard)
   Home Button  - Home key (keyboard)
   Shake        - Right Click (mouse)
   Aim off screen to the right - Right Click (mouse)

 */




 if(!var.inited) {
   var.inited = 0;
   var.aim_right_click = false; //Sets whether the mouse's right button is set when you aim off screen to the right
   var.shake_right_click = false; //Sets whether the mouse's right button is set when you shake the wiimote.
 }
 if(var.inited == 0) {
   var.topofscreen = 0;
   debug = wiimote.pointery;
   debug = "Hold the wiimote level, aim at the top edge of the screen, and press B.  ("+wiimote.pointery+")";
   if(wiimote.B) {
     var.topofscreen = wiimote.pointery;
     var.inited = 1;
   }
 }
 if(var.inited == 1) {
   debug = "Release the B button";
   if(!wiimote.B) {
     var.inited = 2;
   }
 }
 if(var.inited == 2) {
   var.bottomofscreen = 0;
   debug = wiimote.pointery;
   debug = "Hold the wiimote level, aim at the bottom edge of the screen, and press B.  ("+wiimote.pointery+")";
   if(wiimote.B) {
     var.bottomofscreen = wiimote.pointery;
     var.inited = 3;
   }
 }
 if(var.inited == 3) {
   debug = "Release the B button";
   if(!wiimote.B) {
     var.inited = 4;
   }
 }
 if(var.inited == 4) {
   //var.leftofscreen = 0;
   debug = wiimote.pointerx;
   debug = "Hold the wiimote level, aim at the left edge of the screen, and press B.  ("+wiimote.pointerx+")";
   if(wiimote.B) {
     var.leftofscreen = wiimote.pointerx;
     var.inited = 5;
   }
 }
 if(var.inited == 5) {
   debug = "Release the B button";
   if(!wiimote.B) {
     var.inited = 6;
   }
 }
 if(var.inited == 6) {
   //var.rightofscreen = 0;
   debug = wiimote.pointerx;
   debug = "Hold the wiimote level, aim at the right edge of the screen, and press B.  ("+wiimote.pointerx+")";
   if(wiimote.B) {
     var.rightofscreen = wiimote.pointerx;
     var.inited = 7;
   }
 }
 if(var.inited == 7) {
   debug = "Release the B button";
   if(!wiimote.B) {
     var.inited = 8;
   }
 }

 if(var.inited == 8) {

   var.xamount = 1/(var.rightofscreen-var.leftofscreen);
   var.yamount = 1/(var.bottomofscreen-var.topofscreen);

   var.inited = 9;

 }

 if(var.inited == 9) {
   
   var.mx = wiimote.pointerx;
   if(var.mx >= var.leftofscreen and var.mx <= var.rightofscreen) {
     var.aimedx = (var.mx-var.leftofscreen)*var.xamount;
   }
   if(var.mx < var.leftofscreen) var.aimedx = 0;
   if(var.mx > var.rightofscreen) var.aimedx = 1;

   
   var.my = wiimote.pointery;
   if(var.my >= var.topofscreen and var.mx <= var.bottomofscreen) {
     var.aimedy = (var.my-var.topofscreen)*var.yamount;
   }
   if(var.my < var.topofscreen) var.aimedy = 0;
   if(var.my > var.bottomofscreen) var.aimedy = 1;

   mouse.x = var.aimedx;
   mouse.y = var.aimedy;
   debug = "1 / "+var.rightofscreen+"-"+var.leftofscreen+" = "+var.xamount;
   //debug = var.mx-var.leftofscreen + " " + (var.mx-var.leftofscreen)*var.xamount;

   mouse.leftbutton = wiimote.B;
   mouse.rightbutton = wiimote.A or (var.mx > var.rightofscreen and var.aim_right_click) or (wiimote.rawforce > 80 and var.shake_right_click);
   key.enter = wiimote.Two;
   key.w = wiimote.Up;
   key.s = wiimote.Down;
   key.a = wiimote.Left;
   key.d = wiimote.Right;
   key.numpadplus = wiimote.Plus;
   key.numpadminus = wiimote.Minus;
   key.home = wiimote.Home;
   mouse.middlebutton = wiimote.One;
 }
 if(var.inited != 9) {
   mouse.x = wiimote.pointerx;
   mouse.y = wiimote.pointery;
 }

Howard_Casto:

--- Quote --- This script will only work on games and applications that
   do not require direct input to be used.
 For example, this can be used with:
   most emulators,
   House of the Dead 2
   House of the Dead 3
   Most PC Light gun games
   Etcetera

--- End quote ---

Sorry man, but that won't work with MAME.  For mame scripts, the wiimotes have to be setup as joysticks.  You also can't use multiple wiimotes.  Also I've used that script before, the calibration isn't what you think it is.



I can program in glovepie though, so I'll try to whip something up when I get the time.

drventure:
Are you having any difficulties getting the wiimote to pair consistently with your PC?

That was always my biggest issue with using Wiimotes.

I'd love to hear more about that if you've found a combination what works consistently.

Howard_Casto:
Yeah it's still an issue....  I think this guy is jumping the gun a bit (no pun intended) but it doesn't hurt to buy a bluetooth adaptor and try it out.

Some of the bluetooth stacks allow you to create a shortcut to your device like you would an application..... that really helps.  Also the later versions of glovepie are pretty good about pairing up if you press 1+2.  I've yet to get it to sync 100% of the time correctly, but because glovepie supports disconnect upon pressing the power button and reconnect when pressing 1+2 it's easy enough to try again when things go wrong.


You can actually get them to pair the proper way, like they do on a wii (any button syncs) but very few bluetooth stacks support it.  A wiimote's pairing code is just it's bluetooth address backwards.  Send that and/or use that pairing code and the device now works like it would on the wii.  The catch?  This is traditionally done by sending a null-terminated string to the bluetooth stack.....and wiimotes addresses often have null characters in the middle of their address.  Toshiba stacks are known to accept addresses with nulls in them, but most aren't.  The author of glovepie discovered this and is going to add it to the next release of glovepie.... but he announced that in Janurary.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version