Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, 7th_zorro, dr_panther), 1,297 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 5 of 6 1 2 3 4 5 6
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 Offline
Guest
Lunchbox  Offline
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...
frown


A man's gotta do what a man's gotta do!
Re: ackwii with SP3? [Re: Lunchbox] #286665
08/26/09 12:42
08/26/09 12:42
Joined: Sep 2003
Posts: 9,859
F
FBL Offline OP
Senior Expert
FBL  Offline OP
Senior Expert
F

Joined: Sep 2003
Posts: 9,859
Dann bau mal bewusst einen Syntaxfehler in die ackwii.h und du weißt es wink

Wird der nicht angemeckert, dann wird auch das File nicht includiert.

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
D
Dillinger Offline
Newbie
Dillinger  Offline
Newbie
D

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: No Wii connect with Lite-C [Re: Dillinger] #287728
09/02/09 10:53
09/02/09 10:53
Joined: Sep 2003
Posts: 9,859
F
FBL Offline OP
Senior Expert
FBL  Offline OP
Senior Expert
F

Joined: Sep 2003
Posts: 9,859
Check if there's a difference in the revision of the ackwii.h (see comment block on top).

I haven't done any changes for quite a while, so it should be the same. Also compare sizes of the Ackwii DLL any maybe try out the trial DLL shipping with the retail version.
Make sure you don't start with -nj as this disables the Wiimote.


Multiple Wiimotes [Re: FBL] #288410
09/05/09 22:01
09/05/09 22:01
Joined: Apr 2009
Posts: 27
Silicon Valley
D
Dillinger Offline
Newbie
Dillinger  Offline
Newbie
D

Joined: Apr 2009
Posts: 27
Silicon Valley
Hi, Thanks for the good work on the Wiimote plugins. Very exciting.
I was experimenting with trying to connect more than one Wiimote at a time. I basically just tried to declare a second WIIMOTE struct. I pass the handle to it O.K. but it still seems to be showing the data from Wiimote #1. Also, sometimes the second wii shows up in the #2 position, sometimes 3 or 4. I can always cycle through each and detect using a for loop, so no biggie there.
I was wondering if you've done any experimenting with more than 1 wiimote. Perhaps I just don't understand enough about structs.

Re: Multiple Wiimotes [Re: Dillinger] #288431
09/06/09 10:06
09/06/09 10:06
Joined: Sep 2003
Posts: 9,859
F
FBL Offline OP
Senior Expert
FBL  Offline OP
Senior Expert
F

Joined: Sep 2003
Posts: 9,859
Sounds weird, there might be a bug.
I haven't tested with two Wiimotes for quite a while, the last time it seemed to work ok.

Re: Multiple Wiimotes [Re: FBL] #288454
09/06/09 16:10
09/06/09 16:10
Joined: Sep 2003
Posts: 9,859
F
FBL Offline OP
Senior Expert
FBL  Offline OP
Senior Expert
F

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:
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
D
Dillinger Offline
Newbie
Dillinger  Offline
Newbie
D

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.

Code:
// 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: Dillinger] #288861
09/09/09 06:26
09/09/09 06:26
Joined: Sep 2003
Posts: 9,859
F
FBL Offline OP
Senior Expert
FBL  Offline OP
Senior Expert
F

Joined: Sep 2003
Posts: 9,859
Ok,

if my code exits this means that either the number of returned devices is 0, or one of the handles is NULL. Can you do a printf on these variables to find out?
Also it is necesary for this sample code that two Wiimotes are connected all the time as I check both handles for validity.

Maybe your driver for some reason leaves a gap in the enumeration and thus one of the handles is NULL.

----------------------------

Only thing I see in your code without testing is that you are calling wiimote_getdevices() in a while loop. This is not a good idea as this function is slo, and I think I'm also disconnecting and reconencting all Wiimotes in order to find out the number of Wiimotes.
Call it once before the while loop.

Re: Multiple Wiimotes [Re: FBL] #289878
09/16/09 02:23
09/16/09 02:23
Joined: Dec 2005
Posts: 478
India
M
msl_manni Offline
Senior Member
msl_manni  Offline
Senior Member
M

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.
Page 5 of 6 1 2 3 4 5 6

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1