 |
WiiLi.org a new revolution
|
| View previous topic :: View next topic |
| Author |
Message |
GizmoTheGreen
Joined: 14 Nov 2006 Posts: 121
Digg It |
Posted: Wed Dec 27, 2006 10:14 pm Post subject: |
|
|
I've made a new script!
I always thought it was a hassle knowing which Wiimote was number one or two, so i made this quick script:
| Code: | var.count = Wiimote.Count
Debug = "You have " + var.count + " Wiimotes connected to your computer."
if var.count = 1
Wiimote1.Led1 = True
endif
if var.count = 2
Wiimote1.Led1 = True
Wiimote2.Led2 = True
endif
if var.count = 3
Wiimote1.Led1 = True
Wiimote2.Led2 = True
Wiimote3.Led3 = True
endif
if var.count = 4
Wiimote1.Led1 = True
Wiimote2.Led2 = True
Wiimote3.Led3 = True
Wiimote4.Led4 = True
endif |
hope anyone finds it useful  |
|
| Back to top |
|
 |
KCBlack
Joined: 25 Dec 2006 Posts: 35
Digg It |
Posted: Wed Dec 27, 2006 11:23 pm Post subject: |
|
|
| GizmoTheGreen wrote: | I've made a new script!
I always thought it was a hassle knowing which Wiimote was number one or two, so i made this quick script:
| Code: | var.count = Wiimote.Count
Debug = "You have " + var.count + " Wiimotes connected to your computer."
if var.count = 1
Wiimote1.Led1 = True
endif
if var.count = 2
Wiimote1.Led1 = True
Wiimote2.Led2 = True
endif
if var.count = 3
Wiimote1.Led1 = True
Wiimote2.Led2 = True
Wiimote3.Led3 = True
endif
if var.count = 4
Wiimote1.Led1 = True
Wiimote2.Led2 = True
Wiimote3.Led3 = True
Wiimote4.Led4 = True
endif |
hope anyone finds it useful  |
Cool. The only thing I would suggest about this is instead of having the Wiimote's LED equal it's number (i.e. the second LED having 2 LEDs lit up), I would light up one LED that corresponds to the wiimotes number (i.e. the second Wiimote having only the second LED lit up). I worded that pretty bad but hopefully you can understand it lol |
|
| Back to top |
|
 |
crono141
Joined: 27 Dec 2006 Posts: 33
Digg It |
Posted: Thu Dec 28, 2006 2:45 am Post subject: Can't get it to point |
|
|
I know it seems like I"m spamming this, but I can't seem to figure out whats going on.
There are alot of good scripts. Arianol's COD3 pointing script works great, but I can't get any of my FPS games working with any scripts. All the buttons work, and even nunchuk acceleration works. My IR pointer doesn't work anywhere except in the desktop.
Am I the only one having this problem? |
|
| Back to top |
|
 |
Arianol
Joined: 26 Dec 2006 Posts: 49
Digg It |
Posted: Thu Dec 28, 2006 5:37 am Post subject: |
|
|
Firstly, do your games respond to button presses on the wiimote (i.e. shooting)? Also, are they going really laggy?
If the answer to both of those is no, post your system specs and your bluetooth adapter/stack so we can look over them. |
|
| Back to top |
|
 |
ferno
Joined: 15 Dec 2006 Posts: 10 Location: Columbus, OH
Digg It |
Posted: Thu Dec 28, 2006 7:08 am Post subject: |
|
|
for the call of duty script, for some reason my mouse won't move at all when i move my wiimote, im using one "dot" from a homemade sensor bar but its not doing anything
the regular IR mouse control works fine with my sensor bar, but this doesn't at all, anyone know why?
p.s. i debugged wiimote.dot1vis and it comes up as true |
|
| Back to top |
|
 |
Arianol
Joined: 26 Dec 2006 Posts: 49
Digg It |
Posted: Thu Dec 28, 2006 7:37 am Post subject: |
|
|
Okay, so now it works with either one or two IR points. My next goal is to have it so that tilting the remote when aiming does not cause the control to get all wacky. Anyway, here is the updated script:
| Code: | /* Code for playing Call of Duty PC with the Wii-Remote and Nunchuk
Control Arrangement done by Arianol */
/* This PIE requires that you have either one or two IR points to aim the
Wiimote at. A lit teacandle sitting in a small glass works nicely as a
single point and reduces fire hazard. The Wii Sensor Bar is best for the
two-point setting. At any time you can point the Wiimote away from the dot(s)
and Press 1 to revert back to natural mouse movement. Please set the value
of the following variable to your number of infrared points (1 or 2). */
var.irAmount = 2 // 1 OR 2
/* When configuring xNunchuk please hold the nunchuk flat in your hand and do
not move it. You want to look at the debug output at the top of this
window, and modify the value of xNunchuk until the debug value equals zero.
The debug value will be very jumpy so just get as close as you can. */
var.xNunchuk = 0
/* Aim the Wiimote directly at your IR point (or right in the middle if you
have two) and watch the debug. SpeedX and SpeedY should both equal zero
(or close to it). If not, adjust xOffset and yOffset until they do. */
var.xOffset = 0
var.yOffset = 0
var.smooth = 80 // Master Sensitivity (Default 80) - Change Not Recommended
var.speed = 1 // Look Speed (Default 1)
var.zoom = 1/2 // Speed When Aiming Down Sight (Default 1/2)
var.deadzone = 40 // Less Sensitive Area Around Cursor (Default 40)
// Remote Controls
alt = Wiimote.Up // Change Rate-Of Fire
shift = Wiimote.Down // Melee
mouse.WheelUp = Wiimote.Left // Last Weapon
mouse.WheelDown = Wiimote.Right // Next Weapon
mouse.LeftButton = Wiimote.B // Primary Fire
mouse.RightButton = Wiimote.A /* Secondary Fire -> Change RightMouseButton
to Aim Down Sight instead of Toggle For
a more CoD3-like experience */
f = Wiimote.Minus // Use
r = Wiimote.Minus // Reload
Tab = Wiimote.Home // View Score
Escape = Wiimote.Plus // Menu
Windows + M = Wiimote.Two // Windows Key + M - Minimize
If Pressed(Shift) Then // Rumbles wiimote when shift is pressed
Wiimote.Rumble = True
wait 100 ms
Wiimote.Rumble = False
EndIf
// Nunchuck Controls
C = Wiimote.Nunchuk.ZButton // Crouch
If C = True Then
wait 400 ms
If C = True Then
Press Control //Prone
Release Control
EndIf
EndIf
Space = Wiimote.Nunchuk.CButton // Jump
q = Wiimote.Nunchuk.RawForceX + var.xNunchuk > 40 // Lean Left
e = Wiimote.Nunchuk.RawForceX + var.xNunchuk < -35 // Lean Right
// Control Stick Movement
w = Wiimote.Nunchuk.JoyY < -0.4
a = Wiimote.Nunchuk.JoyX < -0.4
s = Wiimote.Nunchuk.JoyY > 0.4
d = Wiimote.Nunchuk.JoyX > 0.4
// LED Lights
Wiimote.Led4 = four
Wiimote.Led3 = three
Wiimote.Led2 = two
Wiimote.Led1 = one
/* Code for Pointing Mechanism
---------------------------
Do Not Modify */
// If two dots are visible, find midpoint
If var.irAmount = 2 Then
var.xPos = (Wiimote.dot1x + Wiimote.dot2x) / 2
var.yPos = (Wiimote.dot1y + Wiimote.dot2y) / 2
Else
var.xPos = Wiimote.dot1x
var.yPos = Wiimote.dot1y
EndIf
If Wiimote.dot1vis Then // If at least one IR point is visible
// Locate Inrared Point Coordinates
var.actualX = (1-(round(var.xPos) / 1024)) * Screen.Width
var.actualY = ((round(var.yPos) / 768)) * Screen.Height
// Determine Look Speed
var.speedX = (((var.actualX / (Screen.Width / 2)) - 1) * var.smooth) + var.xOffset
var.speedY = (((var.actualY / (Screen.Height / 2)) - 1) * var.smooth) + var.yOffset
// Calculate Point-Range Multipliers
If abs(var.speedX / var.deadzone) > 1 Then var.multX = 1 Else var.multX = abs(var.speedX / var.deadzone)
If abs(var.speedY / var.deadzone) > 1 Then var.multY = 1 Else var.multY = abs(var.speedY / var.deadzone)
// Scoped And Normal Multipliers
If Wiimote.A = True Then
var.speedX = var.speedX * var.zoom
var.speedY = var.speedY * var.zoom
Else
var.speedX = var.speedX * var.speed
var.speedY = var.speedY * var.speed
EndIf
// Move Cursor
If abs(var.speedX) > 0 Then Mouse.CursorPosX = Mouse.CursorPosX + (var.speedX * var.multX)
If abs(var.speedY) > 0 Then Mouse.CursorPosY = Mouse.CursorPosY + (var.speedY * var.multY)
// Backup Last Motions
var.lastX = var.speedX
var.lasty = var.speedY
// Reload (If Minus Fails)
r = Wiimote.One
Else // If dot is not visible use last known value
If abs(var.lastX) > 1 Then Mouse.CursorPosX = Mouse.CursorPosX + var.lastX
If abs(var.lastY) > 1 Then Mouse.CursorPosY = Mouse.CursorPosY + var.lastY
// Revert back to natural mouse movement - Safeguard
If Pressed(Wiimote.One) Then
var.lastX = 0
var.lasty = 0
EndIf
EndIf
// Debug
debug = 'Debug: xNunchuk: ' + (Wiimote.Nunchuk.RawForceX + var.xNunchuk) + ' SpeedY: ' + var.speedY + ' SpeedX: ' + var.speedX |
And ferno, perhaps your sensor bar isn't adequate. Try it out on the Relative IR pie that came packaged with GlovePie. That uses the same basis of movement as mine does. Also, try the code above and use your regular wii sensor bar. |
|
| Back to top |
|
 |
ferno
Joined: 15 Dec 2006 Posts: 10 Location: Columbus, OH
Digg It |
Posted: Thu Dec 28, 2006 9:19 am Post subject: |
|
|
with the new script it is starting to work however not as smooth as i would like, i think it has alot to do with my sensor bar because i really have to point at it for it to work and i move the wiimote only a tad bit away from the LEDs it doesnt work unlike the wii
a suggestion, wut if i made a 'sensor bar' with 4 LEDs at each corner of the monitor pointing slightly inward so u could actually point the wiimote at the monitor for IR movement, and the script could only use 2 dots it sees for triangulation (or w/e lol) and disregaurd any other dot it sees for more "movibility" ???
sorry if this may not make complete sense, it's 4 in the morning lol |
|
| 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
|