| View previous topic :: View next topic |
| Author |
Message |
Fission
Joined: 13 Apr 2007 Posts: 9 Location: Harrison Township
Digg It |
Posted: Fri Apr 13, 2007 2:28 pm Post subject: Working Tiger Woods 07 script |
|
|
Im extremely new to this stuff (about 1-2 hours new in fact) and theres a good chance i could be way off base with all of this which is probably the case but I was thinking of ways to get a golf swing to work on PC games (such as tiger woods 07 ect) with the Wiimote. Sorry if I over explain/ramble this stuff.
A regular mouse script works well with TW07 (using it for example just because I have it for PC) you press your assigned left click button on the wii mote, and it switches modes so you can swing. Then you obviously just swing the club or Wiimote. You do not have to hold down any buttons, just left click once then swing. The other nice thing about TW07 for PC is that your clubspeed is based on how fast you swing the Wiimote. Like I said this works actually quite well with a basic mouse emulation you just swing the controller down then up (backward then forward on a reg mouse). Well obviously tilting the wii mote in any direction will move the mouse left/right (hook/slice or mishit the ball). Now I think its great that the horizontal motion of the mouse(or club) is controlled by rotation of the wiimote because it would better simulate a slice/pull in a real golf swing (obviously other variables too in real golf but opening or closing the clubface is common). So....now FINALLY to my ideas..
This standard mouse script works great, so is there anyway to remap the motions of the Wiimote. for instance instead of having up/down read from the Y axis, could you have it read from maybe the Z axis so that when you swing or move the controller side to side it moves the mouse up and down .
I also thought about calibrating the Wiimote on its side. So say for instance with GlovePIE when you calibrate and it tells you to set it with the buttons facing up, set it with the right/left side in the air. then when asked for the right side facing up place the back/front in the air. Basically so GlovePIE would get a sideways held controller calibration so that you can hold the wiimote sideways and swing it like a club. (I dont believe this would work though as the axis would still be the same just the controller would be orientated to the side.) .
I Also thought maybe using PPjoy to get this working as well?
Anyway Like I said just some basic Ideas to get a golf swing emulation out of these with the PC and again I could be wayyyyyy off on all of this. Any comments/help with getting something like a golf swing working would be great!!! Love the current scripts/development and helpful community so far though!!!! Really awesome everyone!
So I played with freshgeardude's web friendly mouse script a little bit so I dont want to take credit for this script at all got it to work pretty well for me once i got used to it with TW07 not perfect by anymeans but its usable. any questions or comments any feedback would be good, first time playing with it so again, no credit and its def not perfect.
| Code: | //My wii-mote control of mouse
//by freshgeardude
// Show wiimote forces
debug = "X="+Wiimote.RawForceX+' Y='+Wiimote.RawForceY+' Z='+Wiimote.RawForceZ
//Movement Keys. Works for both arrow keys and WASD.
Keyboard.Up = Wiimote.Up
Keyboard.Down = Wiimote.Down
Keyboard.Left = Wiimote.Left
Keyboard.Right = Wiimote.Right
//Key assignments. Feel Free to change
Keyboard.Esc = Wiimote.Home
Keyboard.PageUp = Wiimote.One and Keyboard.pageup = Wiimote.Plus
Keyboard.pagedown = Wiimote.Two and Keyboard.pagedown = Wiimote.Minus
//You might want to switch these depending on your tastes
Mouse.LeftButton = Wiimote.A
Mouse.RightButton = Wiimote.B
//Controls LEDs
if Wiimote.A or Wiimote.B
Wiimote.Led1 = 1
wait 500 ms
Wiimote.Led2 = 1
wait 500 ms
Wiimote.Led3 = 1
wait 500 ms
Wiimote.Led4 = 1
wait 500 ms
endif
if Wiimote.A = 0 and Wiimote.B = 0
Wiimote.Led1 = 0
Wiimote.Led2 = 0
Wiimote.Led3 = 0
Wiimote.Led4 = 0
endif
// set these to the offsets when the wiimote is at rest
// will be different for each wiimote
var.x = Wiimote.RawForceX +6.00 //trim to 0
var.y = Wiimote.RawForceY -45.00 // trim to 0
var.z = Wiimote.RawForceZ +6.00 //trim to 0
//precision
var.sense0 = 50
var.thresh0x = 48
var.thresh0y = 20
var.sense = 100
var.threshx = 100
var.threshy = 100
var.sense2 = 100
var.thresh2x = 100
var.thresh2y = 100
var.sense3 = 50
var.thresh3x = 100
var.thresh3y = 100
//first sensitivity setting
//xaxis
if var.x > var.thresh0x
mouse.x = mouse.x - 1/var.sense0
endif
if var.x < -var.thresh0x
mouse.x = mouse.x + 1/var.sense0
endif
//yaxis
if var.z > var.thresh0y
mouse.y = mouse.y - 1/var.sense0
endif
if var.z < -var.thresh0y
mouse.y = mouse.y + 1/var.sense0
endif
//second sensitivity setting
//xaxis
if var.x > var.threshx
mouse.x = mouse.x - 1/var.sense
endif
if var.x < -var.threshx
mouse.x = mouse.x + 1/var.sense
endif
//yaxis
if var.z > var.threshy
mouse.y = mouse.y - 1/var.sense
endif
if var.z < -var.threshy
mouse.y = mouse.y + 1/var.sense
endif
//third sensitivity setting
//xaxis
if var.x > var.thresh2x
mouse.x = mouse.x - 1/var.sense2
endif
if var.x < -var.thresh2x
mouse.x = mouse.x + 1/var.sense2
endif
//yaxis
if var.z > var.thresh2y
mouse.y = mouse.y - 1/var.sense2
endif
if var.z < -var.thresh2y
mouse.y = mouse.y + 1/var.sense2
endif
//fourth sensitivity setting
//xaxis
if var.x > var.thresh3x
mouse.x = mouse.x - 1/var.sense3
endif
if var.x < -var.thresh3x
mouse.x = mouse.x + 1/var.sense3
endif
//yaxis
if var.z > var.thresh3y
mouse.y = mouse.y - 1/var.sense3
endif
if var.z < -var.thresh3y
mouse.y = mouse.y + 1/var.sense3
endif |
Last edited by Fission on Mon Apr 16, 2007 3:59 pm; edited 3 times in total |
|
| Back to top |
|
 |
tic
Joined: 18 Feb 2007 Posts: 121
Digg It |
Posted: Sun Apr 15, 2007 10:28 am Post subject: |
|
|
| Dont use Rawforce, use gx,gy,gz as these dont require calibration, and currently I've not seen any successful way to swing one way and not have it also detect a swing in the other diection, but maybe this would be fine for your script, as you dont need it to detect anything in the other direction. Look at zoidberg's swing script, but I think there are better ways to do it as it still isnt very successful. Ill try later to make a script that will swing in only 1 direction if you want it later |
|
| Back to top |
|
 |
Fission
Joined: 13 Apr 2007 Posts: 9 Location: Harrison Township
Digg It |
Posted: Sun Apr 15, 2007 1:23 pm Post subject: |
|
|
| Great thanks!! I appreciate the help and feedback, yeah this script doesnt work very well as the swing is still measured by the y axis so you still have to flip the controller down then up to swing. I didn't know what to do with it what values/variables do what ect. but I will play with the g values and take a look at the swing script as well as the one you make if you have time/want to for ideas! Thanks again!! |
|
| Back to top |
|
 |
Fission
Joined: 13 Apr 2007 Posts: 9 Location: Harrison Township
Digg It |
Posted: Mon Apr 16, 2007 3:58 pm Post subject: |
|
|
Okay, I've been playing around with a script with some ideas taken from sebsplane and his WiiGolf script for his game. Excellent stuff. I modified freshgeardude's mouse script some more and got it working with Tiger Woods 07 quite well for me. So since there are no other scripts working good with this game yet, and I have seen some script requests for it I thought I would post this incase anyone wants to try and use it. Again I only modified a script!! So no credit to me on this one! Just wanted to try and make this game playable to some degree. It still could use some work I think but my natural swing is hitting the ball pretty well. Anyway I would appreciate any feedback on this!! Hope it works for you!!
| Code: | //Golf Script Edit of:
//My wii-mote control of mouse
//by freshgeardude
//Edit by fission
// Show wiimote forces
debug = "X="+Wiimote.RawForceX+' Y='+Wiimote.RawForceY+' Z='+Wiimote.RawForceZ
//Movement Keys. Works for both arrow keys and WASD.
Keyboard.Up = Wiimote.Up
Keyboard.Down = Wiimote.Down
Keyboard.Left = Wiimote.Left
Keyboard.Right = Wiimote.Right
//Key assignments. Feel Free to change
Keyboard.Esc = Wiimote.Home
Keyboard.PageUp = Wiimote.One and Keyboard.pageup = Wiimote.Plus
Keyboard.pagedown = Wiimote.Two and Keyboard.pagedown = Wiimote.Minus
//You might want to switch these depending on your tastes
Mouse.LeftButton = Wiimote.A
Mouse.RightButton = Wiimote.B
//Controls LEDs
if Wiimote.A or Wiimote.B
Wiimote.Led1 = 1
wait 500 ms
Wiimote.Led2 = 1
wait 500 ms
Wiimote.Led3 = 1
wait 500 ms
Wiimote.Led4 = 1
wait 500 ms
endif
if Wiimote.A = 0 and Wiimote.B = 0
Wiimote.Led1 = 0
Wiimote.Led2 = 0
Wiimote.Led3 = 0
Wiimote.Led4 = 0
endif
// set these to the offsets when the wiimote is at rest
// will be different for each wiimote
var.x = Wiimote.RawForceX -2.00 //trim to 0
var.y = Wiimote.RawForceY -45.00 // trim to 0
var.z = Wiimote.RawForceZ -21.00 //trim to 0
//precision
var.sense0 = 50
var.thresh0x = 1000
var.thresh0y = 20
var.sense = 100
var.threshx = 100
var.threshy = 100
var.sense2 = 100
var.thresh2x = 100
var.thresh2y = 100
var.sense3 = 50
var.thresh3x = 100
var.thresh3y = 100
//first sensitivity setting
//xaxis
if var.x > var.thresh0x
mouse.x = mouse.x - 1/var.sense0
endif
if var.x < -var.thresh0x
mouse.x = mouse.x + 1/var.sense0
endif
//yaxis
if Wiimote.RawForceZ <=-30
mouse.y = mouse.y - 1/var.sense0
endif
if Wiimote.RawForceZ >=10
mouse.y = mouse.y + 1/var.sense0
endif
//second sensitivity setting
//xaxis
if var.x > var.threshx
mouse.x = mouse.x - 1/var.sense
endif
if var.x < -var.threshx
mouse.x = mouse.x + 1/var.sense
endif
//yaxis
if var.z > var.threshy
mouse.y = mouse.y - 1/var.sense
endif
if var.z < -var.threshy
mouse.y = mouse.y + 1/var.sense
endif
//third sensitivity setting
//xaxis
if var.x > var.thresh2x
mouse.x = mouse.x - 1/var.sense2
endif
if var.x < -var.thresh2x
mouse.x = mouse.x + 1/var.sense2
endif
//yaxis
if var.z > var.thresh2y
mouse.y = mouse.y - 1/var.sense2
endif
if var.z < -var.thresh2y
mouse.y = mouse.y + 1/var.sense2
endif
//fourth sensitivity setting
//xaxis
if var.x > var.thresh3x
mouse.x = mouse.x - 1/var.sense3
endif
if var.x < -var.thresh3x
mouse.x = mouse.x + 1/var.sense3
endif
//yaxis
if var.z > var.thresh3y
mouse.y = mouse.y - 1/var.sense3
endif
if var.z < -var.thresh3y
mouse.y = mouse.y + 1/var.sense3
endif |
|
|
| Back to top |
|
 |
tic
Joined: 18 Feb 2007 Posts: 121
Digg It |
Posted: Mon Apr 16, 2007 4:58 pm Post subject: |
|
|
| Quote: | var.x = Wiimote.RawForceX -2.00 //trim to 0
var.y = Wiimote.RawForceY -45.00 // trim to 0
var.z = Wiimote.RawForceZ -21.00 //trim to 0 |
Tut tut. You're still using rawforce. Change these to gx, gy, gz and change the numbers accordingly or else they wont work for anyone but you unless they modify the script |
|
| Back to top |
|
 |
Fission
Joined: 13 Apr 2007 Posts: 9 Location: Harrison Township
Digg It |
Posted: Mon Apr 16, 2007 9:25 pm Post subject: |
|
|
ya i tried gettin the g values to work, but couldnt get it runnin that way, but I will try again.
Can't quite get it working as the value for the backswing and forward swing have to be the same with the g values. if going back it would go - and going forward it would go + i could get it working. but as you go back it goes + then as you come down it will be - and as you go back up it goes + again. any tips on how I could get the g values to work?
heres a vid of it working with the script posted above. (yes myspace because i cant login to youtube. )
http://vids.myspace.com/index.cfm?fuseaction=vids.individual&videoid=2023012107 |
|
| Back to top |
|
 |
Goldy
Joined: 01 May 2007 Posts: 11
Digg It |
Posted: Sat May 05, 2007 4:38 pm Post subject: |
|
|
Fission, is that a binary clock on your desk?
also, I have played Tiger Woods on the wii and its pretty awesome, I'm not a golf person, but with the mote  |
|
| Back to top |
|
 |
|