 |
WiiLi.org a new revolution
|
| View previous topic :: View next topic |
| Author |
Message |
ddddddddd
Joined: 11 Jul 2007 Posts: 13
Digg It |
Posted: Thu Aug 02, 2007 9:12 am Post subject: new tiger woods script |
|
|
New edited version of tiger woods script i made for wiimote, this only uses 1 wiimote as a club, give it a go and see what you think, i have improved it so give it a go and let me know if any suggestions on how to improve.
thanks
| Code: |
//tiger woods golf by ddd
//and some help by Pipo's, MGuitarHero, J.Coulston, Carl Kenner, fortunzfavor.
//Setup, one wiimote use as club, .
//wiimote moves up and down for swing,
//hold wiimote B and direction pad moves cursor,
//normal direction pad changes clubs and stance,
//wiimote Plus and Minus move left and right,
//wiimote A is take shot (left mouse button),
//wiimote home is view shot,
//wiimote one is move camera,
//wiimote two is escape,
//key set up
Mouse.LeftButton = Wiimote1.A
Mouse.RightButton = Wiimote1.one
Key.Left = Wiimote1.Minus
Key.Right = Wiimote1.Plus
Key.Escape = Wiimote1.two
Key.E = Wiimote1.Home
//release B for mormal direction
if wiimote1.b {
var.dmouse = true
else
var.dmouse = false
}
if var.dmouse = false {
Key.Comma = Wiimote1.Left
Key.Dot = Wiimote1.Right
Key.LeftBracket = Wiimote1.Down
Key.RightBracket = Wiimote1.Up
end if
//hold B for cursor
if wiimote1.b {
var.dmouse = true
else
var.dmouse = false
}
if var.dmouse = true {
// Wiimote D-Pad Mouse
// MGuitarHero
if wiimote1.Left = true then //Mouse Left
Mouse.CursorPosX = Mouse.CursorPosX - 8
end if
if wiimote1.Right = true then //Mouse Right
Mouse.CursorPosX = Mouse.CursorPosX + 8
end if
if wiimote1.Up = true then //Mouse Up
Mouse.CursorPosY = Mouse.CursorPosY - 8
end if
if wiimote1.Down = true then //Mouse Down
Mouse.CursorPosY = Mouse.CursorPosY + 8
end if
else
//movement up and down
var.xoffsetm2 = 30 //Center X Axis Windows Mouse
var.sensem2 = 1.85 //sensitivity windows mouse
var.xmin = -1.0// Place remote on left side. Enter number from GX
var.xmax = 4 // Place remote on right side. Enter number from GX
var.x = smooth(Wiimote.gZ)
//offsets normalmouse
var.xoffsetm2 = -var.xoffsetm2/10
//assign offsets
var.xm2 = var.x + var.xoffsetm2
//assign sensibility normal mouse
var.xminm2 = -var.xmin*var.sensem2
var.xmaxm2 = -var.xmax*var.sensem2
//assign maprange normal mouse
mouse.y = MapRange(var.xm2, var.xminm2, var.xmaxm2, 1.2, -0.5)
end if
//Force Rumble
if Wiimote1.RelAccx >= 15 then
Press(S)
Wiimote1.Rumble = True
Wait 200 ms
Release(S)
Wiimote1.Rumble = False
end if
//Wiimote Battery Display
//by J.Coulston
// Modified by Carl Kenner for GlovePIE 0.25
//A full battery gives 0xC0 (192)
var.Batt = wiimote.Battery / 48
//Display the battery level of your wiimote using the four LEDs on the bottom.
//Battery level is displayed in four levels increasing to the right, like a cell
//phone battery gauge. As the battery gets close to the next level down, the LED
//for the current level will blink.
//Blink rate
var.Blink = 500ms
debug = "Battery level: " + 100*48*var.Batt/192 + "%"
if 0<=var.Batt<=0.25 then
Wiimote.Leds = 1
wait var.Blink
Wiimote.Leds = 0
wait var.Blink
elseif 0.25 < var.Batt<=1 then
Wiimote.Leds = 1
elseif 1 < var.Batt<=1.25 then
Wiimote.Leds = 3
wait var.Blink
Wiimote.Leds = 1
wait var.Blink
elseif 1.25 < var.Batt<=2 then
Wiimote.Leds = 3
elseif 2 < var.Batt<=2.25 then
Wiimote.Leds = 7
wait var.Blink
Wiimote.Leds = 3
wait var.Blink
elseif 2.25 < var.Batt<=3 then
Wiimote.Leds = 7
elseif 3 < var.Batt<=3.25 then
Wiimote.Leds = 15
wait var.Blink
Wiimote.Leds = 7
wait var.Blink
elseif 3.25 < var.Batt<=4 then
Wiimote.Leds = 15
else
Wiimote.Leds = 0
endif
//End
|
Last edited by ddddddddd on Sat Aug 11, 2007 11:41 am; edited 1 time in total |
|
| Back to top |
|
 |
cococrispy
Joined: 31 Jul 2007 Posts: 14
Digg It |
|
| Back to top |
|
 |
jhoff80
Joined: 22 Apr 2008 Posts: 1
Digg It |
Posted: Tue Apr 22, 2008 7:25 am Post subject: |
|
|
| This works to an extent, however, every shot is perfectly straight. Is there any way to get the rotation of the controller to affect the shot like in the Wii game? |
|
| Back to top |
|
 |
Innovativeuser
Joined: 28 May 2008 Posts: 1
Digg It |
Posted: Wed May 28, 2008 5:40 pm Post subject: |
|
|
Hi everyone! I also tried to improve the scripts for tiger woods. I took some fragments from the tw07 and also from yours. I hope, thats ok? Now you can put without swinging like with the driver! Just hold B and hold the Wiimote like a real putter.
To improve is a hook and slice function like jhoff80 already mentioned. It is gettin boring, when every swing is hitting the ball the same!
IŽll try to build such a feature and also a build in Mouse-function (with sensor-bar) for the menu...
Here is the scipt:
| Code: | //Golf Script Edit of:
//My wii-mote control of mouse
//by freshgeardude
//Edit by fission
//Updated by innovativeuser
//now it is possible to putt without full-swing, just hold B and putt like in real!
// 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
// set these to the offsets when the wiimote is at rest
// will be different for each wiimote
var.x = Wiimote.gX
var.y = Wiimote.gY
var.z = Wiimote.gZ
//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
//the Putting-function
If Wiimote1.B = True Then
var.xoffsetm2 = 5 //Center X Axis Windows Mouse
If Wiimote.RawForceZ <=-30
var.sensem2 = 0.5 //sensitivity windows mouse
Endif
If Wiimote.RawForceZ >=10
var.sensem2 = 1 //sensitivity windows mouse
Endif
var.xmin = -25.0// Place remote on left side. Enter number from GX
var.xmax = 24.25 // Place remote on right side. Enter number from GX
var.x = smooth(Wiimote.gZ)
//offsets normalmouse
var.xoffsetm2 = -var.xoffsetm2/10
//assign offsets
var.xm2 = var.x + var.xoffsetm2
//assign sensibility normal mouse
var.xminm2 = -var.xmin*var.sensem2
var.xmaxm2 = -var.xmax*var.sensem2
//assign maprange normal mouse
mouse.y = MapRange(var.xm2, var.xminm2, var.xmaxm2, 1.2, -0.5)
Else
//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
Endif |
|
|
| Back to top |
|
 |
Gae41
Joined: 18 Jul 2008 Posts: 3
Digg It |
Posted: Fri Jul 18, 2008 1:43 pm Post subject: |
|
|
I cant get the "swing" to work in Tiger Woods PGA Tour 08 for PC. Every other element with the wiimote works fine.....view, mouse movement, club change etc. Is this script specific for the "07" version only?
I dont want to have to buy another version only to find it doesnt work....
Gae41 |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|