|
Re: ackwii with SP3?
[Re: FBL]
#286311
08/24/09 16:03
08/24/09 16:03
|
Joined: Aug 2009
Posts: 3 Germany - Stuttgart
Lunchbox
Guest
|
Guest
Joined: Aug 2009
Posts: 3
Germany - Stuttgart
|
und was heißt das genau für mich? Was muss ich anders machen? Ich hab mal statt ackwii.h irgendwas adneres geschrieben und es gab auch keinen Fehler - also kann ich nichtmal mit Sicherheit sagen, ob er die Datei lädt...
A man's gotta do what a man's gotta do!
|
|
|
No Wii connect with Lite-C
[Re: FBL]
#287485
09/01/09 02:03
09/01/09 02:03
|
Joined: Apr 2009
Posts: 27 Silicon Valley
Dillinger
Newbie
|
Newbie
Joined: Apr 2009
Posts: 27
Silicon Valley
|
I isolated the problem: on my laptop I was running a registered copy of GameStudio. On the PC, I was trying to compile the same using Lite-C. Today I downloaded the GS trial and the wiimote sprang to life like clockwork! I even uninstalled my copy of Lite-C, downloaded and reinstalled. It comes with the latest ackwii plugins and everything seems to be in order. Sure enough, the wiimote won't pair even though there is clearly a bluetooth connection established. P.S. Here is the list of compatible bluetooth devices: Wiimote compatible Bluetooth devices @ Wii Homebrew
Last edited by Dillinger; 09/01/09 02:16.
|
|
|
Re: Multiple Wiimotes
[Re: FBL]
#288454
09/06/09 16:10
09/06/09 16:10
|
Joined: Sep 2003
Posts: 9,859
FBL
OP
Senior Expert
|
OP
Senior Expert
Joined: Sep 2003
Posts: 9,859
|
I did a test run on my PC. The plugin seems to work fine with two Wiimotes. Maybe there is something odd in your code, can you post it? My sample code:
#include <acknex.h>
#include <default.c>
#define WII_DEBUG //define before including ackwii.h to enable debugging
#include "ackwii.h"
/* assigned to '1' button */
void toggleIR (var handle, WIIMOTE* buffer)
{
/* note: IR sensor requires a sensor bar or adequate replacement */
wiimote_ir(handle, 1 - buffer->status.ir);
}
/* assigned to '2' button */
void toggleVibration (var handle, WIIMOTE* buffer)
{
wiimote_vibration(handle, 1 - buffer->status.vibration);
}
WIIMOTE buffer; //needs to be declared globally
WIIMOTE buffer2; //needs to be declared globally
var curbuf = 0;
void toggle_buffer()
{
#ifdef WII_DEBUG
if (curbuf == 0)
wiimote_debug(&buffer);
else
wiimote_debug(&buffer2);
#endif
curbuf = 1-curbuf;
}
void main ()
{
on_a = toggle_buffer;
video_mode = 7;
screen_color.blue = 150;
fps_max = 100;
var wii_handle;
var wii_handle2;
/* clear buffer before using!! */
zero(buffer);
zero(buffer2);
/* assign functions to Wiimote buttons */
buffer.event.on_1 = toggleIR;
buffer.event.on_2 = toggleVibration;
on_esc = NULL;
/* check if any Wiimote is found */
if (wiimote_getdevices() > 0)
{
/* connect first device */
wii_handle = wiimote_connect(0);
wii_handle2 = wiimote_connect(1);
if(wii_handle != NULL && wii_handle2 != NULL)
{
/*
debug mode: show buffer in panel and assign log function to B button
of Wiimote. Use F12 to toggle visibility of panel
*/
#ifdef WII_DEBUG
wiimote_debug(&buffer);
#endif
/*
a value close to 1 results in very soft angle smoothing
drawback: smoothing delivers the resulting angle delayed
*/
wiimote_smoothfac(wii_handle, 0.9);
while (key_esc != 1)
{
/* update buffer with data coming from Wiimote */
wiimote_status(wii_handle, &buffer);
wiimote_status(wii_handle2, &buffer2);
wait(1);
}
/*
IMPORTANT: this function must be called before closing the engine window.
Otherwise engine will crash! Also wait a few ticks to ensure that DLL is
not running anymore.
*/
wiimote_disconnect(wii_handle);
wiimote_disconnect(wii_handle2);
wait(2);
}
}
sys_exit("");
}
This is a quick hack and it uses wiimote_connect/disconnect which is not necessarily required as A7 also uses it internally. Use the 'a' key on keyboard to toggle the buffer display between Wiimote 1 and 2. About the enumeration this might depend on the Bluetooth driver. I know that Bluesoleil leaves dead devices when unplugging batteries of a Wiimote which still are detected by the Wiimote driver, so this is possible. I ran into this problem during development but could not find a way to sort out all those "false" Wiimotes. edit: I tried now using wiimote_handle() and got some strange results including engine freeze during startup window. Maybe jcl should recheck what they are doing in this function. Can you test the snippet I posted above on your system?
Last edited by Firoball; 09/06/09 16:19.
|
|
|
Re: Multiple Wiimotes
[Re: FBL]
#288844
09/09/09 02:03
09/09/09 02:03
|
Joined: Apr 2009
Posts: 27 Silicon Valley
Dillinger
Newbie
|
Newbie
Joined: Apr 2009
Posts: 27
Silicon Valley
|
of course, how dumb of me. I had the code all copied into memory and then I forgot to put it in the post.
// Wii2Vars.c
// Show Wiimote Variables onscreen
#include <acknex.h>
#include <default.c>
#include <ackwii.h>
fps_max = 60 ;
WIIMOTE buffer ; // defines a new buffer
WIIMOTE buffer2 ;
var howManyR_Wii = 0 ; // wiimote_getdevices()
var who_wii_R = 0 ; // wiimote_handle(var)
var who_wii_R2 = 0 ;
var who_wii_R3 = 0 ;
var who_wii_R4 = 0 ;
var wii_R_On = 0 ; // wiimote_connected(var)
var wii_R_On2 = 0 ;
var wii_R_On3 = 0 ;
var wii_R_On4 = 0 ;
var vibe1 = 1 ;
var vibe2 = 1 ;
PANEL* panButtons =
{
digits( 60, 10, "Wii Buttons", Arial#28b, 1, 0 ) ;
digits( 60, 40, "# of Wiis Online = %0.f", Arial#18b, 1, howManyR_Wii ) ;
// digits( 60, 60, "NULL = %0.f", Arial#18b, 1, NULL ) ;
digits( 60, 80, "WiiMote Handle = %0.f", Arial#18b, 1, who_wii_R ) ;
digits( 60, 100, "WiiMote Connected? = %0.f", Arial#18b, 1, wii_R_On ) ;
digits( 60, 120, "A button = %0.f", Arial#18b, 1, buffer.buttons.butA ) ;
digits( 60, 140, "WiiStick Angle Tilt = %0.f", Arial#18b, 1, buffer.angle1.tilt ) ;
digits( 60, 160, "WiiStick Angle Roll = %0.f", Arial#18b, 1, buffer.angle1.roll ) ;
// digits( 60, 180, "NULL = %0.f", Arial#18b, 1, NULL ) ;
digits( 60, 200, "Wii2 Buttons", Arial#28b, 1, 0 ) ;
// digits( 60, 220, "NULL = %0.f", Arial#18b, 1, NULL ) ;
digits( 60, 240, "WiiMote2 Connected? = %0.f", Arial#18b, 1, wii_R_On2 ) ;
digits( 60, 260, "WiiMote2 Handle = %0.f", Arial#18b, 1, who_wii_R2 ) ;
digits( 60, 280, "A button = %0.f", Arial#18b, 1, buffer2.buttons.butA ) ;
digits( 60, 300, "WiiStick2 Angle Tilt = %0.f", Arial#18b, 1, buffer2.angle1.tilt ) ;
digits( 60, 320, "WiiStick2 Angle Roll = %0.f", Arial#18b, 1, buffer2.angle1.roll ) ;
// digits( 60, 340, "NULL = %0.f", Arial#18b, 1, NULL ) ;
red = 1 ; green = 1 ; blue = 1 ; // Change Text color to black
flags = VISIBLE;
}
PANEL* panMoButtons =
{
digits( 300, 10, "Wii3 Buttons", Arial#28b, 1, 0 ) ;
// digits( 300, 60, "NULL = %0.f", Arial#18b, 1, NULL ) ;
digits( 300, 80, "WiiMote3 Handle = %0.f", Arial#18b, 1, who_wii_R3 ) ;
digits( 300, 100, "WiiMote3 Connected? = %0.f", Arial#18b, 1, wii_R_On3 ) ;
// digits( 300, 120, "A button = %0.f", Arial#18b, 1, buffer3.buttons.butA ) ;
// digits( 300, 140, "WiiStick Angle Tilt = %0.f", Arial#18b, 1, buffer3.angle1.tilt ) ;
// digits( 300, 160, "WiiStick Angle Roll = %0.f", Arial#18b, 1, buffer3.angle1.roll ) ;
// digits( 300, 180, "NULL = %0.f", Arial#18b, 1, NULL ) ;
digits( 300, 200, "Wii4 Buttons", Arial#28b, 1, 0 ) ;
// digits( 300, 220, "NULL = %0.f", Arial#18b, 1, NULL ) ;
digits( 300, 240, "WiiMote4 Connected? = %0.f", Arial#18b, 1, wii_R_On4 ) ;
digits( 300, 260, "WiiMote4 Handle = %0.f", Arial#18b, 1, who_wii_R4 ) ;
// digits( 300, 280, "A button = %0.f", Arial#18b, 1, buffer4.buttons.butA ) ;
// digits( 300, 300, "WiiStick4 Angle Tilt = %0.f", Arial#18b, 1, buffer4.angle1.tilt ) ;
// digits( 300, 320, "WiiStick4 Angle Roll = %0.f", Arial#18b, 1, buffer4.angle1.roll ) ;
// digits( 300, 340, "NULL = %0.f", Arial#18b, 1, NULL ) ;
red = 1 ; green = 1 ; blue = 1 ; // Change Text color to black
flags = VISIBLE;
}
action update_Earth()
{
my.scale_x = .5 ; my.scale_y = .5 ; my.scale_z = .5 ;
while ( who_wii_R )
{
my.z = -( buffer.angle1.tilt ) / 2 ;
my.y = -( buffer.angle1.roll ) / 2 ;
wait(1);
}
}
void main()
{
level_load("") ; // Load empty Level
wait(1);
sky_color.red = 255 ; sky_color.green = 255 ; sky_color.blue = 255 ;
who_wii_R = wiimote_handle(1) ;
who_wii_R2 = wiimote_handle(2) ;
who_wii_R3 = wiimote_handle(3) ;
who_wii_R4 = wiimote_handle(4) ;
wait(2);
// if ( !who_wii_R )
// {
// printf( "No WiiMote connected!" ) ;
// sys_exit( "G'bye Y'all" ) ;
// }
// else
// {
ent_create("earth.mdl", vector( 100, -30, 20 ), update_Earth) ; // Create Earth Model
while( who_wii_R )
{
howManyR_Wii = wiimote_getdevices() ; // Return the number of Wiimotes online
wait(1);
wiimote_status( who_wii_R, buffer ) ; // Copy all the Wiimote Variables to a Struct named "buffer"
wiimote_status( who_wii_R2, buffer2 ) ;
wii_R_On = wiimote_connected( who_wii_R ) ; // Are Wii Connected? Query by Handle Name
wii_R_On2 = wiimote_connected( who_wii_R2 ) ;
if ( wii_R_On && vibe1 )
{
wiimote_vibration( who_wii_R, 1 ) ; // Turn the vibration on (1)
wait(100) ; // Shake until thoroughly agitated
wiimote_vibration( who_wii_R, 0 ) ; // Turn the vibration off (0)
vibe1 = 0 ; // and never do it again
}
if ( wii_R_On2 && vibe2 )
{
wiimote_vibration( who_wii_R2, 1 ) ; // Turn the vibration on (1)
wait(100) ; // Shake until thoroughly agitated
wiimote_vibration( who_wii_R2, 0 ) ; // Turn the vibe off (0)
vibe2 = 0 ; // and never do it again
}
}
// }
}
I tried the code sample you posted. All it does is exit immediately. Pardon my ignorance, but am I supposed to add something to make this work? The code seems to say Connect, then promptly Disconnect and Exit. I'm still pretty green to C. No BlueSoliel. I'm using default Windows driver at the moment.
|
|
|
Re: Multiple Wiimotes
[Re: FBL]
#289878
09/16/09 02:23
09/16/09 02:23
|
Joined: Dec 2005
Posts: 478 India
msl_manni
Senior Member
|
Senior Member
Joined: Dec 2005
Posts: 478
India
|
I would like to know your opinion about the motionplus addon for wii remote. Is it any good or not. And one more thing before I buy the wiimote, what accessories should I buy, like sensor bar needed?, nunchuck needed? and any other things that I dont know of, and would it be better to buy two wiimotes instead of wiimote+nunchuck. And should the motes be non-synced with the wii itself? Your opinion is important for me.
My Specialities Limited.
|
|
|
|