Copyright 6 Vista 7 new! Languages 8 Glovepie scripts 9



Download 0.65 Mb.
Page19/30
Date conversion08.07.2018
Size0.65 Mb.
1   ...   15   16   17   18   19   20   21   22   ...   30

Nunchuck, Classic Controller, Guitar, and Balance Board

To tell whether a Nunchuk, Classic controller, Guitar or BalanceBoard is plugged in, use these values:


Wiimote.HasNunchuck

Wiimote.HasClassic

NEW! Wiimote.HasGuitar

NEW! Wiimote.HasBalanceBoard


They are true or false. Note that GlovePIE now knows the difference between classic controllers and guitar controllers. Old guitar scripts should still work, as long as they didn’t use HasClassic to detect the guitar. But new guitar scripts won’t work if you have a real classic controller plugged in.
The Balance board doesn’t really plug into the expansion port of a real Wiimote. But the Balance Board has its own built in dummy Wiimote. So if you have one real Wiimote, and one Balance Board, then Wiimote1 might be your real Wiimote, and Wiimote2 might be the Balance Board. Then Wiimote1.HasBalanceBoard will be false, and Wiimote2.HasBalanceBoard will be true. You could then the read the balance board by reading Wiimote2.BalanceBoard.Weight or you could read the balance board by reading BalanceBoard2.Weight (which is just a shorter way of saying Wiimote2.BalanceBoard.Weight).
To detect which expansion is plugged in you can also use these, which return a number that says which expansion it is:
Wiimote.Expansion

NEW! Wiimote.Expansion2


Wiimote.Expansion will be one of these values:
0: No expansion

1: Unidentified expansion, or not plugged in properly

2: Nunchuk

3: Classic controller, WiiGuitar or anything compatable with a classic controller (anything that can be used to navigate the Wii Home menu has this value).

4: ??

5: ??


6: Balance Board

…Other values are possible if someone creates a new expansion.


Wiimote.Expansion2 will be one of these values:
0: No expansion

1: Unidentified expansion, or not plugged in properly

2: Really a nunchuk

3: Really a classic controller

4: Really a balance board

5: Really a guitar controller

…Other values are possible if someone creates a new expansion.
Note that these values all have 2 added to them, compared to the decoded values of the last two bytes of the expansion registers.

Nunchuk

The Nunchuk has accelerometers too! Most of the same acceleration values and rotation values are the same as the Wiimote, so see the description in the sections above. The difference is the Nunchuk accelerometers have lower range.


The Nunchuk also has two buttons. NOTE: Unlike a playstation controller, pushing in the joystick is not a button, don’t try it. The two buttons are:
CButton

ZButton
Unlike the other controllers, you need the word “Button” on the end, because Z is the name of an axis and I’m reserving it for future axis use.


The Nunchuk also has a joystick. It uses the following values:
JoyX, JoyY
JoyX is -1 to the left, 0 in the middle, and +1 to the right.

JoyY is -1 up, 0 in the middle, and +1 down.


These are the same ranges used by PPJoy and other joysticks.
The Nunchuk does NOT have vibration, or a speaker.

Classic Controller

The classic controller does NOT have accelerometers or rumble, or a speaker!


The classic controller does have an unexplained lock button in the top centre, which physically opens and closes two slots in the back. The two slots can’t connect to anything and seem totally pointless. The lock button can’t be read.
You can read the following buttons:
a, b, x, y

Minus, Home, Plus

Up, Down, Left, Right

ZL, ZR


LFull, and RFull
They are either True or False.
The L button and the R button (LFull, and RFull above) also have analog versions:
L, and R
They will be between 0 and 1. Although mine won’t go below 0.03 when fully released, and yours may not reach 1 when fully pressed.
There are also two joysticks. I’m calling the one on the left Joy1, and the one on the right Joy2.
Joy1X, Joy1Y,

Joy2X, Joy2Y


They are between -1 and 1, the same as the Nunchuk joystick described above.

NEW! Guitar Hero 3 Controller

The WiiGuitar comes with Guitar Hero 3. It has 5 coloured fret buttons, which are either true or false. It has a strum switch which can be strummed upwards, or strummed downwards. You can hold down the strum switch in either position, or you can strum it so that it is only held for a short time. The strum switch is not analog. There is a Plus and a Minus button on the Guitar. There is a whammy bar (a lever) which is analog. It will be between 0 and 1, although it's range is actually much less than that, and varies between guitars. It also has a joystick.


In addition, you can still use the buttons on the front of the Wiimote, which will be embedded in the guitar face. And you can use the accelerometers in the Wiimote to find the angle or motion of the Guitar. And you can play notes through the Wiimote speaker, and you can flash the lights on the Wiimote. I don't know whether you can feel the Wiimote vibrate or not. The IR will no longer work when the guitar is plugged in, and neither will the B button.
The WiiGuitar values will only be true if a Guitar is plugged in. If a Classic controller or Nunchuk is plugged in, the values will always be false.
You can use the following WiiGuitar fields:
Fret1, Fret2, Fret3, Fret4, Fret5: The five fret buttons counting from the end. These are either true or false. You can also use the names of the colours instead.

Plus, Minus: The + and - buttons on the guitar. They are true or false.

JoyX, JoyY: The joystick. It is between -1 and 1, like any joystick in GlovePIE.

Joy: The joystick as a 2D vector [x,y].

StrumUp: True when the strum switch is held in the up position.

StrumDown: True when the strum switch is held in the down position.

WhammyBar: A value between 0 and 1.

Exists: The same as Wiimote.HasGuitar. True if the guitar is attached, false if it isn't.



1   ...   15   16   17   18   19   20   21   22   ...   30


The database is protected by copyright ©dentisty.org 2016
send message

    Main page