Main > Lightguns

Wingun, lightgun, guncon 2 troubles aplenty

<< < (6/11) > >>

BadMouth:

--- Quote from: Howard_Casto on August 15, 2012, 04:23:13 pm ---I did some more experimenting today.  I haven't worked on calibration yet (that'll be the last thing I do) but I wanted to get the cursor output as smooth and steady as I could.  I managed to get it stable enough to hit the little clay targets in duckhunt at their smallest point.  That's the smallest target you'll ever hit in a gun game, so I would say mission accomplished on that bit.
--- End quote ---

Is this with a standard wii remote or wii motion plus?

Howard_Casto:
Either.  I'm not using wiimotion plus stuff if at all possible because those nifty little guns linked earlier don't have it.

Did some more research.  You can turn off a wiimote from within glovepie (or out of glovepie for that matter) by holding the power button.  So turn them off is a synch.  The catch?  Turning them on.....  Glovepie only does auto-syncing for the first few seconds of the start of a script or if you click on the glovepie window.  That's going to be a bit of a hurdle because afaik you can't easily close glovepie from the command line. 

One workaround would be to write the script to exit whenever the Esc key is pressed (or whatever you have your exit key mapped to).  Of course then you have to reload the script each time to launch a game and re-sync the wiimotes, which can take a while. 

My script does perfectly fine running in the background... it could be running the whole time you have your cab up and not interfere with your system mouse or anything.  If you leave your wiimotes on all the time though, it's going to run the batteries down. 

I found tons of tools over at the dolphin forums.  There's one program that claims to permenantly sync your wiimotes to your pc, so like on the wii you can just press any button while the pc is on and it'll sync.  This would be ideal but I haven't tried it yet.  There's also a suite of command line tools for bluetooth, so you can connect and disconnect bluetooth devices via command line.  We shouldn't rely on these, but it would be good for when the wiimotes get locked up or ect.. (bind them to a hotkey or something). 

So we're getting there... it's just a matter of making things easy to do from within a cab.  Ideally you should be able to turn on your cab and not worry about anything.  If you want to play a gun game, you just press the button(s) to sync the remote and you are done.  When you are done playing, you should be able to just press the power button to turn the gun off. 

felix pontifex:
I am having some new issues with glovepie =/ . This stuff just does not want to work out for me...

I was having trouble connecting via the windows bluetooth stack so I decided to install the Toshiba one. The Toshiba one works, but now Glovepie will not work. When I use the old lightgun script the lights on the wii remote change like the script tells them to (first and fourth lights on solid, middle 2 off), but the mouse just sticks into the top left corner of my monitor, and none of the buttons work on the wii remote so I cannot calibrate. Some assistance would be nice, as this whole thing has just worn out my will to try and solve it right now...

Howard_Casto:
It says right in the glovepie ver 45 docs that only the BlueSoli and Microsoft stacks are officially supported for auto-connect.  Even though he found that exploit for the toshiba stack it isn't implemented yet.  All those utilites I mentioned from the dolphin forums also work best with the microsoft or bluesoli stack.  Also keep in mind that Glovepie doesn't like it when you use other methods to connect/disconnect your wiimote...at least not while a script is running. 

If you have glovepie and your stack setup correctly when you are running a script, within the first few seconds you should be able to press 1+2 and the wiimote will auto-pair.  You'll hear the connection tone in windows.  Sometimes glovepie rejects it and upairs it... so you press 1+2 again and it'll work.  Sometimes it takes a long time to pair a wiimote, so you have to keep pressing 1+2 to keep the wiimote flashing.  This is the nature of the beast unfortunately. 

You've got to keep in mind that certain stacks don't play nice with certain bluetooth dongles.  For my own personal dongle and system, I've found that the default microsoft one is the most reliable.  Your mileage will vary though. 

Also don't use that script you linked to... with all due respect to the original author it's dated and coded in a bad way. (Probably due to it's age... gloepie wasn't exactly feature rich back then.) He is manipulating the real mouse... which means if your wiimote fouls up everything locks up.  My new script is using the virtual cursor, which is much better because the real mouse cursor is left unmolested and you are able to move it with your system mouse. 

It isn't ready for primetime yet, but if anyone wants to mess with it:

'-----------------------------
'Combined Wiimote Gun Script For Mame, PC Games and Other Emulators
'By HowardC
'--------------------------------------------------------------
'Note:  to Use this script, First Download and Install PPJOY
'from
'After Installation, Add two Virtual Joysticks with the default
'mappings.

'MAME WILL NOT SEE THE WIIMOTES WITHOUT PPJOY!!!!!!
'--------------------------------------------------------------

'Store Needed Data in Variables so they don't
'change as the script runs

'Wiimote1  Variables
var.cursorx=wiimote1.PointerX
var.cursory=wiimote1.pointerY
var.Abtn=wiimote1.a
var.Bbtn=wiimote1.b
var.One=wiimote1.One
var.Two=wiimote1.Two
var.Minus=wiimote1.Minus
var.Plus=wiimote1.Plus
Var.Home=Wiimote1.Home
var.up=wiimote1.Up
var.down=wiimote1.Down
var.left=wiimote1.Left
var.right=wiimote1.right
'Shake to Reload - Comment Out if it Bothers you
var.shake=wiimote1.SwingDown


'Wiimote2 Variables
var.cursorx2=wiimote2.PointerX
var.cursory2=wiimote2.pointerY
var.Abtn2=wiimote2.a
var.Bbtn2=wiimote2.b
var.One2=wiimote2.One
var.Two2=wiimote2.Two
var.Minus2=wiimote2.Minus
var.Plus2=wiimote2.Plus
Var.Home2=Wiimote2.Home
var.up2=wiimote2.Up
var.down2=wiimote2.Down
var.left2=wiimote2.Left
var.right2=wiimote2.right
'Shake to Reload - Comment Out if it Bothers you
var.shake2=wiimote2.swingdown





'Make our False Cursor Red For Player One
fakecursor1.caption =""
fakecursor1.colour=[1,0,0]

'Make our False Cursor Blue For Player Two
fakecursor2.caption =""
fakecursor2.colour=[0,0,1]


'Wiimote1 Keys Binded to Fake Mouse 1
fakecursor1.x =var.cursorx
fakecursor1.y =var.cursory
fakecursor1.LeftButton=var.bbtn
fakecursor1.rightbutton=var.abtn
fakecursor1.MiddleButton=var.home
fakecursor1.XButton1=var.One
fakecursor1.XButton2=Var.Two
Fakecursor1.Button6=Var.Minus
Fakecursor1.Button7=Var.Plus
FakeCursor1.rightbutton=var.shake

'Wiimote1 Keys Binded to Fake Joystick 1
ppjoy1.Analog0=ensuremaprange(var.cursorx,0,1,-1,1)
ppjoy1.analog1=ensuremaprange(var.cursory,0,1,-1,1)
ppjoy1.Digital0=var.bbtn
ppjoy1.digital1=var.abtn
ppjoy1.Digital2=var.One
ppjoy1.Digital3=var.Two
ppjoy1.Digital4=var.Home
ppjoy1.Digital5=Var.Minus
ppjoy1.Digital6=Var.Plus
'Note:  By default PPJOY maps the POV HAT to 16-19
ppjoy1.digital16=var.up
ppjoy1.digital17=var.down
ppjoy1.digital18=var.left
ppjoy1.digital19=var.right
ppjoy1.digital1=var.shake

'Wiimote1 Keys Binded to Fake Keyboard (Won't work for MAME!)
Up=var.up
Down=var.down
Left=var.left
Right=var.right




'Wiimote2 Keys Binded to Fake Mouse 2
fakecursor2.x =var.cursorx2
fakecursor2.y =var.cursory2
fakecursor2.LeftButton=var.bbtn2
fakecursor2.rightbutton=var.abtn2
fakecursor2.MiddleButton=var.home2
fakecursor2.XButton1=var.One2
fakecursor2.XButton2=Var.Two2
Fakecursor2.Button6=Var.Minus2
Fakecursor2.Button7=Var.Plus2
fakecursor2.rightbutton=var.shake2

'Wiimote1 Keys Binded to Fake Joystick 2
ppjoy2.Analog0=ensuremaprange(var.cursorx2,0,1,-1,1)
ppjoy2.analog1=ensuremaprange(var.cursory2,0,1,-1,1)
ppjoy2.Digital0=var.bbtn2
ppjoy2.digital1=var.abtn2
ppjoy2.Digital2=var.One2
ppjoy2.Digital3=var.Two2
ppjoy2.Digital4=var.Home2
ppjoy2.Digital5=Var.Minus2
ppjoy2.Digital6=Var.Plus2
'Note:  By default PPJOY maps the POV HAT to 16-19
ppjoy2.digital16=var.up2
ppjoy2.digital17=var.down2
ppjoy2.digital18=var.left2
ppjoy2.digital19=var.right2
ppjoy2.digital1=var.shake2

'Wiimote2 Keys Binded to Fake Keyboard (Won't work for MAME!)
R=var.up
F=var.down
D=var.left
G=var.right

'---------------------------------

Howard_Casto:
My homemade sensor bar has finally bit the big one... only took it 5 years.... so development is halted for now.

I'll probably be going out on wednesday of next week and I'll pick up a wireless bar then.  I did create a little code to center the pointer when you press the down button on the d-pad, and it was working pretty well... until the sensor bar crapped out. 

The code still needs direct-x implementation for the pc games and other emulators.  It's gonna be a pain in the butt because dx is in mickeys (relative) and wiimote cursor position is a fraction of the screen (absolute). 

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version