Jump to content


Photo

Giimote


  • Please log in to reply
726 replies to this topic

#1 leif902

leif902

    GreenMan Games

  • New Member
  • 748 posts

Posted 14 July 2007 - 02:13 PM

GiiMote
Version 2.51

GiiMote is an extension package for GM7 that allows for the use of a single Wii Remote (unofficially, "Wiimote") in Game Maker.

GiiMote version 2.51 and earlier is licensed under the Ms-PL (Meaning you can use it and distribute the full package with few restrictions).
Version 3.0 and above is licensed under the GNU GPL along with the additional permissions of the GNU LGPL

Known Limitations:
Does not support sound
Does not pair the Wii Remote to your PC (you must do this manually)


Dependencies:
Requires the Microsoft .NET Framework 3.5 or later which can be found here.


Links:
Project Home: http://giimote.googlecode.com/
Blog: http://giimote.samwhited.com/
SVN: http://giimote.googlecode.com/svn/
Source (SVN Browser): http://code.google.c...e/source/browse
Issues: http://code.google.c...ote/issues/list
FAQ: http://code.google.c...iimote/wiki/FAQ
Changelog: http://code.google.c.../wiki/ChangeLog
Wiki: http://code.google.c.../giimote/w/list

Actions:
Report a Bug
Download Latest Version

Edited by leif902, 13 May 2009 - 10:20 PM.

  • 1
Sam Whited (Leif902)
YoYo Games Wiki | SamWhited.com (blog)

#2 jobro

jobro

    GMC Member

  • GMC Member
  • 1300 posts
  • Version:GM:Studio

Posted 14 July 2007 - 03:13 PM

I wish I could help you out. But what's the purpose of it? So you can control the game with your Wii controls?
  • 0

Marketplace.png


#3 cdm319

cdm319

    C++ Programmer

  • New Member
  • 885 posts

Posted 14 July 2007 - 03:15 PM

yes... nice extension leif :chikin
  • 0

Chris Matthews, Co-Leader of Digital X

#4 leif902

leif902

    GreenMan Games

  • New Member
  • 748 posts

Posted 15 July 2007 - 01:23 AM

yes... nice extension leif :angry:

<{POST_SNAPBACK}>



Thanks glad you like it :D this is what I was making when I asked you that C++ question :) I got it working (obviously) but anyways, this is the result
if anyone has the chance to test it, let me know... as soon as I can test it (in about a week when by bluetooth receiver comes in) I'm going to add some higher-level functionality and create a nice demo prog. but as of now, I have no idea if it even works or not :)

And yes, the purpose is just so that you can use the Wii Remote as a controller/pointer for GM games.
- Leif

Edited by leif902, 15 July 2007 - 05:45 AM.

  • 0
Sam Whited (Leif902)
YoYo Games Wiki | SamWhited.com (blog)

#5 Scott_AW

Scott_AW

    GMC Member

  • New Member
  • 143 posts

Posted 15 July 2007 - 01:31 AM

Wish I had a Wii to test this, it'd open alot of possibilities for GM and user interaction.
  • 0

#6 leif902

leif902

    GreenMan Games

  • New Member
  • 748 posts

Posted 15 July 2007 - 01:33 AM

Wish I had a Wii to test this, it'd open alot of possibilities for GM and user interaction.

<{POST_SNAPBACK}>



You don't need a Wii, just a Wiimote (steal one from a friend :D )
heh, I'd like it if i could test it too... beleive me...

- Leif
  • 0
Sam Whited (Leif902)
YoYo Games Wiki | SamWhited.com (blog)

#7 Scott_AW

Scott_AW

    GMC Member

  • New Member
  • 143 posts

Posted 15 July 2007 - 01:40 AM

Wish I had a Wii to test this, it'd open alot of possibilities for GM and user interaction.

<{POST_SNAPBACK}>



You don't need a Wii, just a Wiimote (steal one from a friend :D )
heh, I'd like it if i could test it too... beleive me...

- Leif

<{POST_SNAPBACK}>


Well I still want one.
  • 0

#8 Element_TJ

Element_TJ

    GMC Member

  • New Member
  • 132 posts

Posted 15 July 2007 - 01:45 AM

:D This sounds awesome. It's too bad my Wiimote stopped
working with my Bluetooth since I restarted my computer.
I guess I can try again. I'll tell ya if I got it to work or not.

It made no sense. I got it to work perfectly the first time I tried
it. I turned my computer off and tried the next morning, and then...
Nothing. :angry:

Edit: Just wait, I have to get BlueSoilel or whatever. The disk
isn't working with Vista... Figures. :) I sure do hope I can
get the Wiimote to work. Using it to control my mouse was
fun! I could never get it to work in Half-Life 2 though... Maybe,
Halo 2? That'd be awesome! YEAH! :)

Edited by Element_TJ, 15 July 2007 - 01:50 AM.

  • 0

#9 leif902

leif902

    GreenMan Games

  • New Member
  • 748 posts

Posted 15 July 2007 - 01:45 AM

Well I still want one.


Yah they're pretty nice :) definitly worth the pricetag (which is suprisingly low)!
(Zelda:TP is one of the best games of all time...)
- Leif

This sounds awesome. It's too bad my Wiimote stopped
working with my Bluetooth since I restarted my computer.
I guess I can try again. I'll tell ya if I got it to work or not.

It made no sense. I got it to work perfectly the first time I tried
it. I turned my computer off and tried the next morning, and then...
Nothing. 


Hm... interesting. Try reinstalling BlueSoiel 2 and see if that helps you :D the default windows stacks don't work well w/ all bluetooth devices. If you list your device too I may be able to help you w/ device specific info depending on what it is. Also check out wiili.org for more info (there is an article on various devices that may help you)

Edited by leif902, 15 July 2007 - 01:49 AM.

  • 0
Sam Whited (Leif902)
YoYo Games Wiki | SamWhited.com (blog)

#10 Element_TJ

Element_TJ

    GMC Member

  • New Member
  • 132 posts

Posted 15 July 2007 - 01:54 AM

I'm downloading the new BlueSoiel because the one on
the disk doesn't work with Vista. I am using... Well,
I'm not really sure. The dongle is so small. It only says

RoHS compliant 2002/95/EC

I can't remember
and the disk doesn't tell me. :S When BlueSoiel installs,
I should have the information. I'm glad you are into this
kind of stuff. Have you checked out

http://wiili.org/

yet? It's awesome and has all kinds of Wiimote to PC related stuff.
You should check it out. ^-^
  • 0

#11 leif902

leif902

    GreenMan Games

  • New Member
  • 748 posts

Posted 15 July 2007 - 01:58 AM

I'm downloading the new BlueSoiel because the one on
the disk doesn't work with Vista. I am using... Well,
I'm not really sure. The dongle is so small. It only says

RoHS compliant 2002/95/EC

I can't remember
and the disk doesn't tell me. :S When BlueSoiel installs,
I should have the information. I'm glad you are into this
kind of stuff. Have you checked out

http://wiili.org/

yet? It's awesome and has all kinds of Wiimote to PC related stuff.
You should check it out. ^-^

<{POST_SNAPBACK}>


lol yah, I love Wiili, it's where I got all the info i needed to make this :D This library is based off of Brian Peeks managed wiimote dll and a bit of my own work.
  • 0
Sam Whited (Leif902)
YoYo Games Wiki | SamWhited.com (blog)

#12 sleija

sleija

    GMC Member

  • New Member
  • 174 posts

Posted 15 July 2007 - 01:59 AM

I'm gonna test it.
  • 0

#13 leif902

leif902

    GreenMan Games

  • New Member
  • 748 posts

Posted 15 July 2007 - 02:00 AM

I'm gonna test it.

<{POST_SNAPBACK}>

Thank you so much, like I said, i'm not even sure if I have the DLL's instilizing correctly... so any errors, bugs, or complete failures to connect you find just post them here :D
  • 0
Sam Whited (Leif902)
YoYo Games Wiki | SamWhited.com (blog)

#14 Element_TJ

Element_TJ

    GMC Member

  • New Member
  • 132 posts

Posted 15 July 2007 - 02:01 AM

Oh yeah, I'm getting all excited again. Dial-up is sooo slow.
I got my Infrared Sensors all hooked up and ready. Man,
please work after I turn off the computer. :D No matter
what I tried, I couldn't get the Wiimote to connect. I got that
blinking Wiimote that never connected thing. It just kept
blinking. Nothing worked. Hopefully this time, everything will
work fine. Have you tried out Macromedia/Adobe Flash?
I've made games to work on teh Wii Browser specifically
for the Wii remote. It's awesome. :)
  • 0

#15 sleija

sleija

    GMC Member

  • New Member
  • 174 posts

Posted 15 July 2007 - 02:06 AM

I can't get it to connect to the bluetooth! :D sorry! I really wanted to try this out.
  • 0

#16 leif902

leif902

    GreenMan Games

  • New Member
  • 748 posts

Posted 15 July 2007 - 02:10 AM

Oh yeah, I'm getting all excited again. Dial-up is sooo slow.
I got my Infrared Sensors all hooked up and ready.  Man,
please work after I turn off the computer. :) No matter
what I tried, I couldn't get the Wiimote to connect. I got that
blinking Wiimote that never connected thing. It just kept
blinking. Nothing worked. Hopefully this time, everything will
work fine. Have you tried out Macromedia/Adobe Flash?
I've made games to work on teh Wii Browser specifically
for the Wii remote. It's awesome. :)

<{POST_SNAPBACK}>


I played with flash a little, but I was never any good at it :D I found a page on the nintendo site the other day that told how to get wiimote buttons, etc. through javascript, that was pretty neat so I thought maybe i'd make my site work w/ the wiimote somehow :angry:

- Leif


EDIT: http://wii.nintendo....aq_internet.jsp

Edited by leif902, 15 July 2007 - 10:07 PM.

  • 0
Sam Whited (Leif902)
YoYo Games Wiki | SamWhited.com (blog)

#17 Element_TJ

Element_TJ

    GMC Member

  • New Member
  • 132 posts

Posted 15 July 2007 - 02:10 AM

OK. You're going to have to create me an example code.
I'm going to use the Classic Controller. I decided to use
Jenner's Platformer Engine. Up = Jump - Left,Right = Left,Right...

In Create Event:
wm_set_led(1,on);
wm_set_led(4,on);
wm_set_led(2,off);
wm_set_led(3,off);

Nevermind. I didn't look at all of the help file. :D
The BlueSoliel is still downloading.

Can you make me an example just to see if the Wiimote
is working? I want something to test all of the buttons.
You can do the Infrared and Acceleration and whatnot
if you really want to. That'd be a bit complicated though.

Edited by Element_TJ, 15 July 2007 - 02:14 AM.

  • 0

#18 leif902

leif902

    GreenMan Games

  • New Member
  • 748 posts

Posted 15 July 2007 - 02:20 AM

OK. You're going to have to create me an example code.
I'm going to use the Classic Controller. I decided to use
Jenner's Platformer Engine. Up = Jump - Left,Right = Left,Right...

In Create Event:

wm_set_led(1,on);
wm_set_led(4,on);
wm_set_led(2,off);
wm_set_led(3,off);

Nevermind. I didn't look at all of the help file. :angry:
The BlueSoliel is still downloading.

Can you make me an example just to see if the Wiimote
is working? I want something to test all of the buttons.
You can do the Infrared and Acceleration and whatnot
if you really want to. That'd be a bit complicated though.

<{POST_SNAPBACK}>


Alright, well a quick tutorial perhapse is in order anyways :D I won't make a full example untill I can get my own bluetooth to test it on, but maybe i'll make somehting simple that just outputs data to the screen... but for now:
The first thing you must do (after pairing your Wiimote w/ the PC) is to connect the Wiiremote to GM like so:
if (!wm_connected())
{
     wm_connect(0); // Set to 1 if AND ONLY IF it dosn't read/write well.
}

Now you should be able to use all the features and basic functions.

In your destroy or game end event (or whenever you want to stop using the remote), place:


if (wm_connected())
{
     wm_disconnect(); // Actually it will do this automatically if you forget, but you should remember to clean up your own mess :)
}

Before you use an extension make sure to check and see if one is inserted by calling: wm_check_extension() (see the constants in the help file for a list of returned extension's codes)

Also, wm_set_led(led,on) sets the led 1-4 to on or off, if you want to create a Wiimote that has leds 1 and 3 on you might try:
wm_set_led(1,true);
wm_set_led(2,false);
wm_set_led(3,true);
wm_set_led(4,false);
On is just the name of the argument, it's actually a boolean value, you don't litterally write on (though maybe i'll add that as a constant...)

I can't get it to connect to the bluetooth! :) sorry! I really wanted to try this out.

<{POST_SNAPBACK}>


Pm me w/ details of your OS, bluetooth stack, and bluetooth device and I'll see what I can do :)

- Leif

Edited by leif902, 15 July 2007 - 02:28 AM.

  • 0
Sam Whited (Leif902)
YoYo Games Wiki | SamWhited.com (blog)

#19 Element_TJ

Element_TJ

    GMC Member

  • New Member
  • 132 posts

Posted 15 July 2007 - 02:34 AM

OK. I can get the Wiimote's information from teh Dongle
and receive stuff from it. The Wiimote keeps blinking. :D

The Gamemaker thing won't even start.
I'm getting GlovePIE to test right now.
  • 0

#20 leif902

leif902

    GreenMan Games

  • New Member
  • 748 posts

Posted 15 July 2007 - 02:42 AM

OK. I can get the Wiimote's information from teh Dongle
and receive stuff from it. The Wiimote keeps blinking. :)

The Gamemaker thing won't even start.
I'm getting GlovePIE to test right now.

<{POST_SNAPBACK}>


Okay guys, sorry, I released hoping that some people could hopefully go ahead and test a bit before I could get to it, but it looks like there are already major problems... the test app i'm making pointed out a few to me :D I should probably just wait a week untill I get the dongle in, as of now though, I'll keep working on it and see if I can get the source issues resolved. If anyone else gets it working, feel free to post :)
- Leif

EDIT: yah i found a bug in the init function that the extension calls automatically when it's started... that may be breaking it, i'll fix and test some more, then reupload.

Edited by leif902, 15 July 2007 - 02:43 AM.

  • 0
Sam Whited (Leif902)
YoYo Games Wiki | SamWhited.com (blog)

#21 Element_TJ

Element_TJ

    GMC Member

  • New Member
  • 132 posts

Posted 15 July 2007 - 02:45 AM

I don't think it's your program, I think it's
BlueSoleil. It says right at the top
Evaluation (5MB Only)

So I don't think my Wiimote is fully communicating
with the computer. It wont' work in GlovePIE so
it shouldn't work in your computer. I need a serial. :D

I'm only receiving 50% of the Wiimote's... Stuff.
That's pretty much the reason why nothing else is
working. THat's why the Wiimote is blinking and
whatnot. It's not getting full-power!

Edited by Element_TJ, 15 July 2007 - 02:48 AM.

  • 0

#22 leif902

leif902

    GreenMan Games

  • New Member
  • 748 posts

Posted 15 July 2007 - 02:48 AM

I don't think it's your program, I think it's
BlueSoleil. It says right at the top
Evaluation (5MB Only)

So I don't think my Wiimote is fully communicating
with the computer. It wont' work in GlovePIE so
it shouldn't work in your computer. I need a serial. :)

<{POST_SNAPBACK}>


Oh i see... go on Wiili and try to find another free bluetooth stack perhapse? Sorry I can't help you... the dongle I ordered comes w/ BlueSoleil (albeit an old version that only partially supports wiimotes).

Eventually I will add my own bluetooth connection functions perhapse that will work directly w/ all bluetooth devices, we shall see (I know one of the non-managed wiimote libs out there already does this... I can steal it fom them :D )

- Leif

Edited by leif902, 15 July 2007 - 02:53 AM.

  • 0
Sam Whited (Leif902)
YoYo Games Wiki | SamWhited.com (blog)

#23 Element_TJ

Element_TJ

    GMC Member

  • New Member
  • 132 posts

Posted 15 July 2007 - 02:50 AM

Mine came with BlueSoleil too. It wouldn't install.
Hmmm..... I'm sure this would work fine. Stupid
BlueSoleil!

I'm trying WIDCOMM. I'll update tomorrow. I'm
tired and this is a big download. See ya later.

Edited by Element_TJ, 15 July 2007 - 02:55 AM.

  • 0

#24 leif902

leif902

    GreenMan Games

  • New Member
  • 748 posts

Posted 15 July 2007 - 02:59 AM

Alright, I have a question for anyone versed in managed C++...:

gcnew GiiMote();
or
gcnew GiiMote;

What's the difference since the argument list is void?
I never knew, what is the difference between "gcnew" and plain old "new"? All this Visual/Managed C++ and .NET confuses me...

- Leif
P.S. If i'm not allowed to ask this here just notify me, I didn't see it in the rules since it is about GM compatibility, but I know it's not really about GML or anything.
  • 0
Sam Whited (Leif902)
YoYo Games Wiki | SamWhited.com (blog)

#25 Element_TJ

Element_TJ

    GMC Member

  • New Member
  • 132 posts

Posted 15 July 2007 - 05:32 AM

I can't help you on the C++ thing,
but... WIDCOMM did not work. It's
4 times bigger and doesn't even
detect my freakin' dongle! I'll find a
solution before tomorrow. :)

Nevermind... Stupid WIDCOMM and
stupid BlueSoleil. Why can't BlueSoleil
be free??? So... I can't use my Wiimote
at all anymore. I'll figure it out some
time. :D If anyone can help, I'd
sure appreciate it.

Edited by Element_TJ, 15 July 2007 - 05:49 AM.

  • 0

#26 leif902

leif902

    GreenMan Games

  • New Member
  • 748 posts

Posted 15 July 2007 - 05:49 AM

I can't help you on the C++ thing,
but... WIDCOMM did not work. It's
4 times bigger and doesn't even
detect my freakin' dongle! I'll find a
solution before tomorrow. :)

Nevermind... Stupid WIDCOMM and
stupid BlueSoleil. Why can't BlueSoleil
be free??? So... I can't use my Wiimote
at all anymore. I'll figure it out some
time.  :D If anyone can help, I'd
sure appreciate it.

<{POST_SNAPBACK}>



http://wiibrew.org/i...iimote_Tutorial
  • 0
Sam Whited (Leif902)
YoYo Games Wiki | SamWhited.com (blog)

#27 Element_TJ

Element_TJ

    GMC Member

  • New Member
  • 132 posts

Posted 15 July 2007 - 05:58 AM

That doesn't work. I just need a version
without the 5mb limit that works with Vista.
  • 0

#28 leif902

leif902

    GreenMan Games

  • New Member
  • 748 posts

Posted 15 July 2007 - 06:02 AM

That doesn't work. I just need a version
without the 5mb limit that works with Vista.

<{POST_SNAPBACK}>


If we knew what kind of bluetooth radio you had it would be much easier to debug :D you should try to find it onine somewhere.

If you want, PM me w/ your info and connection issues etc. once you figure out what kind of dongle you have and I'll see if I can't help a little more through PM's.

- Leif
  • 0
Sam Whited (Leif902)
YoYo Games Wiki | SamWhited.com (blog)

#29 GML-PUNK

GML-PUNK

    DC Productions

  • New Member
  • 460 posts

Posted 15 July 2007 - 06:29 AM

cool, this will be great when it is finished.
  • 0
PROJECTS | |

#30 X-tra Fear

X-tra Fear

    Behemoth Creator

  • GMC Member
  • 430 posts
  • Version:GM8

Posted 15 July 2007 - 07:14 AM

ya... this isnt that good, but not to bad. a very bad limitation is first u have to hack the wiimote to work on you pc anyway (i think it''s just a driver... im not for sure). then secondly, no one understands how it works. unless they rlly put some thought into it. If you need help, drop me a pm on that one.

but nice extension

EDIT:

I rlly wouldn''t reccomend making a full out game with this. you would need some kind of option to use the wiimote or not.

Edited by X-tra Fear, 15 July 2007 - 07:16 AM.

  • 0

#31 cdm319

cdm319

    C++ Programmer

  • New Member
  • 885 posts

Posted 15 July 2007 - 12:22 PM

Xtra... *sigh* he was making an extension, to HELP people, not to get flamed.....
  • 0

Chris Matthews, Co-Leader of Digital X

#32 tuntis

tuntis

    GMC Member

  • New Member
  • 1839 posts

Posted 15 July 2007 - 01:25 PM

ya... this isnt that good, but not to bad. a very bad limitation is first u have to hack the wiimote to work on you pc anyway (i think it''s just a driver... im not for sure).

<{POST_SNAPBACK}>

The Wiimote can be connected to a PC without any special drivers (assuming that you don't have a cheap, bad bluetooth dongle)
  • 0

#33 leif902

leif902

    GreenMan Games

  • New Member
  • 748 posts

Posted 15 July 2007 - 01:28 PM

ya... this isnt that good, but not to bad. a very bad limitation is first u have to hack the wiimote to work on you pc anyway (i think it''s just a driver... im not for sure). then secondly, no one understands how it works. unless they rlly put some thought into it. If you need help, drop me a pm on that one.

but nice extension

EDIT:

I rlly wouldn''t reccomend making a full out game with this. you would need some kind of option to use the wiimote or not.

<{POST_SNAPBACK}>



Yah you don't need to hack it onto your pc :D It's an HID compatible blutooth device, just pair it w/ windows, also, I do understand most of the registers and memory locations in the Wiimote and all my functions use the filestream methods of the .NET to read and write directly to it :) (It's actually a wrapper for another DLL w/ some custom code thrown in for stuff that the other one didn't support)

- Leif

EDIT: Also, it dosn't work at all btw, will crash on startup. Just found the bug too (spelled function fnction in the GEX definitions and my cleanup script wasn't being made)

Will update in a moment.

Edited by leif902, 15 July 2007 - 01:29 PM.

  • 0
Sam Whited (Leif902)
YoYo Games Wiki | SamWhited.com (blog)

#34 BrandMan211

BrandMan211

    GMC Member

  • New Member
  • 597 posts

Posted 15 July 2007 - 01:29 PM

If this works, it can bring GM games to a whole new level.

I sure hope it does work.
  • 0
All the best,
Brandon Evans

#35 leif902

leif902

    GreenMan Games

  • New Member
  • 748 posts

Posted 15 July 2007 - 01:38 PM

If this works, it can bring GM games to a whole new level.

I sure hope it does work.

<{POST_SNAPBACK}>


Actually right now it dosn't, and I have a question. I fixed my init and teardown functions, however now I have a few questions.

Can the init and finalization functions be in the DLL? or must they be GML because they can't have a return type?

Also, does GM not like the C++ keyword "new" or "gcnew" for allocating memory off the heap? Whenever I use "new Classname" in my dll GM crashes w/ the unexpected error...

Thanks
- Leif

Edited by leif902, 15 July 2007 - 04:05 PM.

  • 0
Sam Whited (Leif902)
YoYo Games Wiki | SamWhited.com (blog)

#36 leif902

leif902

    GreenMan Games

  • New Member
  • 748 posts

Posted 15 July 2007 - 04:37 PM

Okay, sorry for the double post but this warrents an update:

On the GiiMote homepage (see first post) there is now a link to a sample application in GMK format.

I have also updated the LIB (Duno if it works or not again now) and it DOES NOT automatically call the init and cleanup functions anymore (Since auto calling them or calling them in the create event gave me an error for some reason...)

If anyone has any info about why this might happen, I'd appreciate hearing about it :P

You will need to call gm_init() when you first use the Wiimote and gm_cleanup() as soon as you finish using it and disconnect (wm_disconnect()) for the final time.

Remember though, this still isn't ready for real usage (and might not work still...)
Amazon says my bluetooth dongle is scheduled to arrive on the 23rd, UPS says on the 16th (tomorrow)... hopefully it will come tomorrow and I can actually get this thing working for myself :P

- Leif
  • 0
Sam Whited (Leif902)
YoYo Games Wiki | SamWhited.com (blog)

#37 Element_TJ

Element_TJ

    GMC Member

  • New Member
  • 132 posts

Posted 15 July 2007 - 04:57 PM

Yeah, I can't test this. I can't find any working drivers
besides BlueSoleil 3.0+ for Vista. WIDCOMM doesn't
work at all. I guess you're going to have to do this
yourself until I find a solution. I'm still working... Java
won't even install. :P Good luck!
  • 0

#38 leif902

leif902

    GreenMan Games

  • New Member
  • 748 posts

Posted 15 July 2007 - 05:01 PM

Yeah, I can't test this. I can't find any working drivers
besides BlueSoleil 3.0+ for Vista. WIDCOMM doesn't
work at all. I guess you're going to have to do this
yourself until I find a solution. I'm still working... Java
won't even install. :P Good luck!

<{POST_SNAPBACK}>


Oh well, thanks so much for trying :P I think I jumped the gun on a beta release anyways, should have waited untill I could test it personally. I'm optimizing the DLL right now, should drop the filesize, speed up execution times and hopefully make it actually work :P (lots of code changes... very boring...)

- Leif


EDIT: Optimized the DLL a littlebit... sped up compile time by about 200% and should speed up execution time by a bit too (though it won't be noticable unless you are checking lots of status information per step).

Edited by leif902, 15 July 2007 - 05:16 PM.

  • 0
Sam Whited (Leif902)
YoYo Games Wiki | SamWhited.com (blog)

#39 Element_TJ

Element_TJ

    GMC Member

  • New Member
  • 132 posts

Posted 15 July 2007 - 05:22 PM

Good job. I'm still trying to get it to work.
This is definately going into my signature. :P
  • 0

#40 leif902

leif902

    GreenMan Games

  • New Member
  • 748 posts

Posted 15 July 2007 - 05:28 PM

Good job. I'm still trying to get it to work.
This is definately going into my signature. :P

<{POST_SNAPBACK}>


okay thank you :P Like i said though, be warned... I fixed several (extension pack, not DLL) related errors and optimized the code a bit, but I still do not know if it works or not... (for me when I connect w/o a wiimote paired it just freezes, I've heard of other people having this problem w/ a wiimote connected so it may be a problem w/ certain bluetooth stacks)

lol I hate developing w/o being able to test :P in GM i normally save and play my game/app every couple of edits and even working on a larger C++ project I normally compile as much as I have the time for

- Leif
  • 0
Sam Whited (Leif902)
YoYo Games Wiki | SamWhited.com (blog)

#41 coolsmile

coolsmile

    Programmer

  • New Member
  • 1346 posts

Posted 15 July 2007 - 05:50 PM

NOOOO
You beat me to it...
I was working on a dll for this. I'll still keep working on it though
  • 0

#42 leif902

leif902

    GreenMan Games

  • New Member
  • 748 posts

Posted 15 July 2007 - 05:53 PM

NOOOO
You beat me to it...
I was working on a dll for this.  I'll still keep working on it though

<{POST_SNAPBACK}>


Oh no sorry :P
If you can already use your Wiimote care to test mine? lol I don't have a dongle yet... not sure if this works.
  • 0
Sam Whited (Leif902)
YoYo Games Wiki | SamWhited.com (blog)

#43 coolsmile

coolsmile

    Programmer

  • New Member
  • 1346 posts

Posted 15 July 2007 - 06:09 PM

I have tried it, I keep getting an unexpected error when executing: wm_connect(ext_none);

I am just using a wiimote alone and am connected
  • 0

#44 leif902

leif902

    GreenMan Games

  • New Member
  • 748 posts

Posted 15 July 2007 - 06:16 PM

I have tried it, I keep getting an unexpected error when executing: wm_connect(ext_none);

I am just using a wiimote alone and am connected

<{POST_SNAPBACK}>


wm_connect(ext_none); is not proper syntax btw (though that's not what's creating the error.) it's wm_connect(write_method) where write_method is either 1 or 0 (try 0 normally, if you can't get it to work try 1 for an alternate writing method) but ext_none is 0 anyways so...

is the error comming from the DLL or GM? GM keeps giving me errors... I can't figure it out because there is no problem in the DLL code and I don't know why GM wouldn't like it...
- Leif

Edited by leif902, 15 July 2007 - 06:17 PM.

  • 0
Sam Whited (Leif902)
YoYo Games Wiki | SamWhited.com (blog)

#45 coolsmile

coolsmile

    Programmer

  • New Member
  • 1346 posts

Posted 15 July 2007 - 06:30 PM

I tried
wm_connect(0);
wm_connect(1);
but neither of them worked. I keep getting "an unexpected error occured while running the game"
So I assume it is a problem with the dll, but I could be wrong...
  • 0

#46 leif902

leif902

    GreenMan Games

  • New Member
  • 748 posts

Posted 15 July 2007 - 06:33 PM

I tried

wm_connect(0);
wm_connect(1);
but neither of them worked.  I keep getting "an unexpected error occured while running the game"
So I assume it is a problem with the dll, but I could be wrong...

<{POST_SNAPBACK}>



no, there is no problem w/ the DLL... unexpected error occured while running the game means it's something to do with game maker... lets see, anyone know why this:

extern "C" __declspec( dllexport ) double wm_connect(double use_alt_write_method)
{
	bool alt_write_method = 0;
	if (use_alt_write_method != 0)
	{
  alt_write_method = true;
	}
	else
	{
  alt_write_method = false;
	}
	GiiMote::dll_instance->wm->AltWriteMethod = alt_write_method;
	GiiMote::dll_instance->wm->Connect();
	GiiMote::dll_instance->wm->SetReportType(GiiMote::dll_instance->reportType, 1);
	GiiMote::dll_instance->wm->SetLEDs(false,false,false,false);
	GiiMote::dll_instance->wm->GetBatteryLevel();
	return (1);

}

would cause an error in GM?
  • 0
Sam Whited (Leif902)
YoYo Games Wiki | SamWhited.com (blog)

#47 coolsmile

coolsmile

    Programmer

  • New Member
  • 1346 posts

Posted 15 July 2007 - 06:49 PM

That code looks fine:

I tried with the nunchuck with
alt_write_method == 1
It still doesn't work :P

It is returning 1 and not those constants though...

What is
GiiMote::dll_instance->wm->SetReportType(GiiMote::dll_instance->reportType, 1);
supposed to do?

I'm not sure why it is not working...

EDIT: Could you make a gm6/gm7 version with the dll and scripts, maybe that would help solve the problem, but you don't have to if you don't want to :P

Edited by coolsmile, 15 July 2007 - 06:52 PM.

  • 0

#48 leif902

leif902

    GreenMan Games

  • New Member
  • 748 posts

Posted 15 July 2007 - 06:56 PM

That code looks fine:

I tried with the nunchuck with

alt_write_method == 1
It still doesn't work :P

It is returning 1 and not those constants though...

What is
GiiMote::dll_instance->wm->SetReportType(GiiMote::dll_instance->reportType, 1);
supposed to do?

I'm not sure why it is not working...

<{POST_SNAPBACK}>


GiiMote::dll_instance->wm is where the wiimote data is stored. The report type is what kind of data is being reported by the Wiimote...
The default reportType for my DLL (i'll enable changing it later) is Wiimote::InputReport::IRAccel; (Infrared, accelerometer and buttons)... when you plug in or remove an extension the report type is changed between that and Wiimote::InputReport::IRExtensionAccel. That shouldn't be hurting the code any though... this is something to do w/ how GM executes DLL's I think... maybe I've got the calling convention screwed up, I'm using cdecl, but I really don't know alot about it... that's right though isn't it? GM modifies the stack?

- Leif

EDIT: I may make a GM6 version later after i get this one working, but not now :P
EDIT: Were you writing your own DLL or were you using another Library like I am? (and if so which one?) Just curious :P (I'm considering starting over w/ a native C++ library since managed code dosn't like GM)

Edited by leif902, 15 July 2007 - 06:58 PM.

  • 0
Sam Whited (Leif902)
YoYo Games Wiki | SamWhited.com (blog)

#49 coolsmile

coolsmile

    Programmer

  • New Member
  • 1346 posts

Posted 15 July 2007 - 06:59 PM

Don't use cdecl, use dll_stdcall :P
  • 0

#50 leif902

leif902

    GreenMan Games

  • New Member
  • 748 posts

Posted 15 July 2007 - 07:02 PM

Don't use cdecl, use dll_stdcall :P

<{POST_SNAPBACK}>



Really? I thought cdecl meant that GM would place data on the stack and stdcall meant that the DLL had to controll the stack... (I know nothing about this low level C++ stuff)... dosn't that mean I'd have to add some stack controlling code to my DLL? lol after all these years I'm still a noob when it comes to hardware and memory (which is ironically my favorite part of the computer sciences)
  • 0
Sam Whited (Leif902)
YoYo Games Wiki | SamWhited.com (blog)