| View previous topic :: View next topic |
| Author |
Message |
Elo
Joined: 19 Dec 2006 Posts: 19
Digg It |
Posted: Tue Dec 19, 2006 10:46 pm Post subject: |
|
|
well,ive been using the nunchuk stick perfectly with projekt64 and any of those things via ppjoy etc.. used lukeage script as base and then just made ppjoy etc.. worked like a charm
then i made this script as a updated wiidrums with nunchuk support although as u will see in header i ran into some problems..
the wiimote taps where only very sluggishly received with perfect nc receival though..
any hints on what could be prob ?
to much info sent at once maybe ?
| Code: |
// Remake of :
// Carl's version of Bob's Wii Drums! No other program required.
// w w w. bobsomers. c o m
// This is with the nunchuk incorperated..although some problems seem to arrise.
// The tapping with the nunchuk works perfekt, although if you try and play
// with the wiimote at same time the signal of the wiimote tapping is often lost
// any ideas with how to fix this or is it just me ?
// :Elo elomiem @i ronpookhawolves. com
var.xOffset = 8
var.yOffset = -37
var.zOffset = 12
var.xOffset2 = 8
var.yOffset2 = -37
var.zOffset2 = 12
var.xRot = Wiimote.RawForceX + var.xOffset
var.yRot = Wiimote.RawForceY + var.yOffset
var.zRot = Wiimote.RawForceZ + var.zOffset
var.xRotN = Wiimote.Nunchuk.RawForceX + var.xOffset2
var.yRotN = Wiimote.Nunchuk.RawForceY + var.yOffset2
var.zRotN = Wiimote.Nunchuk.RawForceZ + var.zOffset2
// Debug
debug = "X=" + var.xRot + " Y=" + var.yRot + " Z=" + var.zRot
debug = "X=" + var.xRotN + " Y=" + var.yRotN + " Z=" + var.zRotN
// Downward drum beat triggered
if var.yRot > 10 then
var.A = Wiimote.B and not (Wiimote.A or Wiimote.Minus or Wiimote.Home or Wiimote.Plus)
var.B = Wiimote.A and not (Wiimote.B or Wiimote.Minus or Wiimote.Home or Wiimote.Plus)
var.C = Wiimote.A and Wiimote.B and not (Wiimote.Minus or Wiimote.Home or Wiimote.Plus)
var.D = Wiimote.Minus and not (Wiimote.A or Wiimote.B or Wiimote.Home or Wiimote.Plus)
var.E = Wiimote.Home and not (Wiimote.A or Wiimote.B or Wiimote.Minus or Wiimote.Plus)
var.F = Wiimote.Plus and not (Wiimote.A or Wiimote.B or Wiimote.Minus or Wiimote.Home)
var.G = not(Wiimote.A or Wiimote.B or Wiimote.Minus or Wiimote.Home or Wiimote.Plus)
else
var.A = false
var.B = false
var.C = false
var.D = false
var.E = false
var.F = false
var.G = false
endif
if var.yRotN > 30 then
var.H = Wiimote.Nunchuk.ZButton and not ( Wiimote.Nunchuk.CButton )
var.I = Wiimote.Nunchuk.CButton and not ( Wiimote.Nunchuk.ZButton )
var.J = Wiimote.Nunchuk.ZButton and Wiimote.Nunchuk.CButton
var.K = not (Wiimote.Nunchuk.ZButton or Wiimote.Nunchuk.CButton )
else
var.H = false
var.I = false
var.J = false
var.K = false
endif
Midi.volume = 100%
Midi.AcousticSnare = var.K
Midi.ClosedHiHat = var.G
// note, unfortunately you can't set those Midi values inside the IF
// because IF statements in GlovePIE cause it to send the midi message
// again even if it hasn't changed, whereas outside IF statements it
// only sends a MIDI message if it has changed.
|
|
|
| Back to top |
|
 |
kunalkunal2
Joined: 13 Dec 2006 Posts: 279
Digg It |
Posted: Tue Dec 19, 2006 10:48 pm Post subject: |
|
|
great update Carl and great job
the nunchuck works very well tested it in project 64,
well here is my script for legend of zelda ocarina of time with nunchuck support hope u like it(it requires ppjoy like the other scirpts) i will keep on updating it on my topic over in the wiiscripts section...........
//Controls for Zelda: Ocarina of Time with nunchuck
//Written by Kunal Khiyani(based on vkapadia script)
//
//
//Set your emulator to these values:
//Analog Stick = Up, Down, Left, and Right Arrow Keys
//Start = S
//Z-Button = z
//R-Button = d
//A-Button = x
//B-Button = c
//L-Button = a
//C-Up = I
//C-Down = k
//C-Left = j
//C-Right = l
//Controls are as follows:
//D-Pad = Analog Stick
//A-Button = A-Button
//Minus = Left
//Plus = Right
//Home = C-Up
//One = C-Left
//Two = C-Right
//Shake Wiimote = B-Button
//A and B = Start
//B= Z button
Right = 1 > Wiimote1.Nunchuk.JoyX > 0.5
Left = -1 < Wiimote1.Nunchuk.JoyX < -0.5
down = 1 > Wiimote1.Nunchuk.JoyY > 0.5
up = -1 < Wiimote1.Nunchuk.JoyY < -0.5
S = wiimote.A and wiimote.B
Z = wiimote.B
D = wiimote.Plus
A = wiimote.minus
A = wiimote.A
i = Wiimote.Up
j = Wiimote.Left
l = Wiimote.Right
k = Wiimote.Down
x = Wiimote.A
B and wiimote.Rumble = (wiimote.RawForceX >= 15)
Last edited by kunalkunal2 on Tue Dec 19, 2006 11:00 pm; edited 2 times in total |
|
| Back to top |
|
 |
Elo
Joined: 19 Dec 2006 Posts: 19
Digg It |
Posted: Tue Dec 19, 2006 10:54 pm Post subject: |
|
|
well,i changed it about abit..changed some values and then it suddenly worked like a charm
ive just mapped the closed hihat and snare to just tapping the mote and chuk so if u want more u'll have to map em ureself but feel free to use em..
thx to lukeage for the basic chuk test scrip,Carl for glovepie ofc and Bob for the first drum script
should work fine now
p.s.. just copied the code part this time..
will update the header asap
| Code: |
var.xOffset = 8
var.yOffset = -37
var.zOffset = 12
var.xOffset2 = 8
var.yOffset2 = -37
var.zOffset2 = 12
var.xRot = Wiimote.RawForceX + var.xOffset
var.yRot = Wiimote.RawForceY + var.xOffset
var.zRot = Wiimote.RawForceZ + var.zOffset
var.xRotN = Wiimote.Nunchuk.RawForceX + var.xOffset2
var.yRotN = Wiimote.Nunchuk.RawForceY + var.yOffset2
var.zRotN = Wiimote.Nunchuk.RawForceZ + var.zOffset2
// Debug
debug = "X=" + var.xRot + " Y=" + var.yRot + " Z=" + var.zRot
debug = "X=" + var.xRotN + " Y=" + var.yRotN + " Z=" + var.zRotN
// Downward drum beat triggered
if var.yRot > 30 then
var.A = Wiimote.B and not (Wiimote.A or Wiimote.Minus or Wiimote.Home or Wiimote.Plus)
var.B = Wiimote.A and not (Wiimote.B or Wiimote.Minus or Wiimote.Home or Wiimote.Plus)
var.C = Wiimote.A and Wiimote.B and not (Wiimote.Minus or Wiimote.Home or Wiimote.Plus)
var.D = Wiimote.Minus and not (Wiimote.A or Wiimote.B or Wiimote.Home or Wiimote.Plus)
var.E = Wiimote.Home and not (Wiimote.A or Wiimote.B or Wiimote.Minus or Wiimote.Plus)
var.F = Wiimote.Plus and not (Wiimote.A or Wiimote.B or Wiimote.Minus or Wiimote.Home)
var.G = not(Wiimote.A or Wiimote.B or Wiimote.Minus or Wiimote.Home or Wiimote.Plus)
else
var.A = false
var.B = false
var.C = false
var.D = false
var.E = false
var.F = false
var.G = false
endif
if var.yRotN > 30 then
var.H = Wiimote.Nunchuk.ZButton and not ( Wiimote.Nunchuk.CButton )
var.I = Wiimote.Nunchuk.CButton and not ( Wiimote.Nunchuk.ZButton )
var.J = Wiimote.Nunchuk.ZButton and Wiimote.Nunchuk.CButton
var.K = not (Wiimote.Nunchuk.ZButton or Wiimote.Nunchuk.CButton )
else
var.H = false
var.I = false
var.J = false
var.K = false
endif
Midi.volume = 100%
Midi.AcousticSnare = var.K
Midi.ClosedHiHat = var.G
|
|
|
| Back to top |
|
 |
Elo
Joined: 19 Dec 2006 Posts: 19
Digg It |
Posted: Tue Dec 19, 2006 11:04 pm Post subject: |
|
|
id recommend raising the value of | Code: | | if var.yRotN > 30 then |
to 50 else in my experience the nc will tap very often..
ohwell.feel free to modify and redo the script ..i do it all the time
well, as soon as i incorporate the other drum sounds ill put up a new version ..hopefully later today after work
btw..any1 start redoing the wiitar script to use the nc instead of second mote ?
was thinking of maybe making a script so u can use the arrow buttons to change instrument and pitch maybe so u can play multiple instruments on it..(got idea from a diff script i saw here..)
ohwell..we will see what happens next
we havent wiialized the true potential yet im sure  |
|
| Back to top |
|
 |
Dako
Joined: 19 Dec 2006 Posts: 4 Location: Mexico
Digg It |
Posted: Tue Dec 19, 2006 11:42 pm Post subject: |
|
|
First, just wanted to say thanks for GlovePIE and how it works with the wiimote, I still don't have a Wii but I'm still having fun, heheh .
Well, I tried 0.27 this morning, and it works great, the stick and the nunchuck buttons work, but I found some problems. Would've posted about them earlier, but I didn't know we had a forum .
Mainly what the others have said, GlovePIE is registering some random peaks in the nunchuck X and Y axis, though those can be solved with comparison operators and conditionals in the script (although we shouldnt have to do that, heheh).
The other problem I found is the button response on the wiimote. The nunchuck buttons respond instantenously, but the wiimote buttons have a delay, or at least they don't respond as fast as they should. When you press A sometimes it will respond but wont respond again for some seconds, responds but remain pressed or something (noticed when Link didn't just swing his sword, he did the whole spin attack), or just don't respond.
Hope this helps a little, and thanks again . _________________ Woooo..! |
|
| Back to top |
|
 |
squeakypants
Joined: 09 Nov 2006 Posts: 99
Digg It |
Posted: Wed Dec 20, 2006 12:08 am Post subject: |
|
|
Why have the waits in there? Why not just
| Code: | if (Wiimote.Nunchuk.JoyX > 0.2) {
D = True;
}
if (Wiimote.Nunchuk.JoyX < -0.2) {
A = True;
}
if (Wiimote.Nunchuk.JoyY > 0.2) {
S = True;
}
if (Wiimote.Nunchuk.JoyY < -0.2) {
W = True;
} |
|
|
| Back to top |
|
 |
paradoxperfect
Joined: 19 Dec 2006 Posts: 11
Digg It |
Posted: Wed Dec 20, 2006 12:44 am Post subject: |
|
|
Squeakypants,
Because when I press up on the JoyStick, it will only show "W" once (in notepad for example)... not repeatedly. Thus the reason for the waits to turn on/off the W. |
|
| Back to top |
|
 |
|