Jump to content

All my products and services are free. All my costs are met by donations I receive from my users. If you enjoy using any of my products, please donate to support me. My bare hosting costs are currently not met so please consider donating by either clicking this text or the Patreon link on the right.

Patreon

Recommended Posts

Posted
Actually, the attached file in the start of this topic does not include the PlugInUltraStik.ini as I did not want anyone to accidentally overwrite their current version. The the file attached I attached with this post includes the PlugInUltraStik.ini, my copy, which I originally released.

In the same zip file, I have also included another zip file which contains all source code, licenses, etc., associated with the project. Hopefully, this will please the developers from whom I borrowed code. (Try to make the community better, and get slapped on the wrist for it. Go figure.)

Ok, finally got around to testing this and no luck for me. Maybe I'm missing something, here's what I did:

Copied the following files to my GameEx plugins folder overwriting the one's already there:

ICSharpCode.USBlib.dll

PlugInUltraStik.dll

PlugInUltraStik.ini (enabled the debug at first for testing which showed the correct map types)

SetControls.exe

Didn't do anything with libusb0.dll since I have the most up to date Ultimarc firmware

Activated the plugin in the GameEx Plugins manager (says it version 1.3)

After disabling debug in the .ini and firing up GameEx again I figured I'd be good to go but the maps remain in 8way continually. According to the PlugInUltraStik.ini file it should set it to the mouse map when exiting GameEx, no luck there either.

Did I miss a step? Haven't worked with this PlugIn before since there wasn't a Vista version.

  • Replies 56
  • Created
  • Last Reply

Top Posters In This Topic

Posted

Can I make a few points about your code

- Consider using a Dictionary instead of a Hashtable because it's stongly typed there is no unboxing so it's faster. Your also checking if a value exists using Hashtable.ContainsKey() and then your retrieving the value. That means your looking up the key twice. Using Dictionary.TryGetValue() will mean one lookup.

- Note this line File.Exists("PLUGINS\\PlugInUltraStik.ini")

Your assuming the current directory is GameEx. While this is true this may change during the lifetime of the program. Try this instead

string appPath = Path.GetDirectoryName(this.GetType().Assembly.Location); // If it wasn't a dll you would use Application.StartupPath

if(File.Exists(Path.Combine(appPath, "PlugInUltraStik.ini")))...

- File.ReadAllLines() is a nice way to replace your StreamReader() code. It returns a string[] of all the lines. Then you can just loop through them all.

- When splitting the values in the ini file, take a look at

string[] lineSplit = line.Split(new char[] { '=' });

if(lineSplit.Length == 2)

// lineSplit[0] is the name, lineSplit[1] is the value.

Just a few things I thought worth mentioning. Some of it I learnt when moving from .NET 1.1 to .NET 2.0. Lot's of cool new stuff (one of my favourites being the System.Collections.Generic namespace with Dictionary<K, T> and List<T>)

Posted
Can I make a few points about your code

- Consider using a Dictionary instead of a Hashtable because it's stongly typed there is no unboxing so it's faster. Your also checking if a value exists using Hashtable.ContainsKey() and then your retrieving the value. That means your looking up the key twice. Using Dictionary.TryGetValue() will mean one lookup.

- Note this line File.Exists("PLUGINS\\PlugInUltraStik.ini")

Your assuming the current directory is GameEx. While this is true this may change during the lifetime of the program. Try this instead

string appPath = Path.GetDirectoryName(this.GetType().Assembly.Location); // If it wasn't a dll you would use Application.StartupPath

if(File.Exists(Path.Combine(appPath, "PlugInUltraStik.ini")))...

- File.ReadAllLines() is a nice way to replace your StreamReader() code. It returns a string[] of all the lines. Then you can just loop through them all.

- When splitting the values in the ini file, take a look at

string[] lineSplit = line.Split(new char[] { '=' });

if(lineSplit.Length == 2)

// lineSplit[0] is the name, lineSplit[1] is the value.

Just a few things I thought worth mentioning. Some of it I learnt when moving from .NET 1.1 to .NET 2.0. Lot's of cool new stuff (one of my favourites being the System.Collections.Generic namespace with Dictionary<K, T> and List<T>)

Did I ever mention that Java is my primary language? :D I guess it's obvious I am not as # with .NET.

Well, it looks like there is going to be 1.3.1 now. B)

Posted
Can I make a few points about your code

- Consider using a Dictionary instead of a Hashtable because it's stongly typed there is no unboxing so it's faster. Your also checking if a value exists using Hashtable.ContainsKey() and then your retrieving the value. That means your looking up the key twice. Using Dictionary.TryGetValue() will mean one lookup.

- Note this line File.Exists("PLUGINS\\PlugInUltraStik.ini")

Your assuming the current directory is GameEx. While this is true this may change during the lifetime of the program. Try this instead

string appPath = Path.GetDirectoryName(this.GetType().Assembly.Location); // If it wasn't a dll you would use Application.StartupPath

if(File.Exists(Path.Combine(appPath, "PlugInUltraStik.ini")))...

- File.ReadAllLines() is a nice way to replace your StreamReader() code. It returns a string[] of all the lines. Then you can just loop through them all.

- When splitting the values in the ini file, take a look at

string[] lineSplit = line.Split(new char[] { '=' });

if(lineSplit.Length == 2)

// lineSplit[0] is the name, lineSplit[1] is the value.

Just a few things I thought worth mentioning. Some of it I learnt when moving from .NET 1.1 to .NET 2.0. Lot's of cool new stuff (one of my favourites being the System.Collections.Generic namespace with Dictionary<K, T> and List<T>)

Thats another reason why GameEx is not open source. You really do put me to shame buddy :)

EDIT: The file.readalline is a particular nice shortcut to know, as I've been doing a file.readall and then a split

Posted
Did I ever mention that Java is my primary language? :D I guess it's obvious I am not as # with .NET.

Well, it looks like there is going to be 1.3.1 now. B)

They aren't really "mission critical" things I was pointing out but handy stuff to know.

If Java is your primary language you will pick up C# easily. It takes a while to learn some of the namespaces, but soon enough I'm sure it will grow on you. When you get rolling in C# it really is a pleasent language to code in. I've coded in many different languages and C# is by far my favourite. In fact it pains me when I sometimes have to go back to something else.

Thats another reason why GameEx is not open source. You really do put me to shame buddy :)

Not really. Lurking on .NET forums helps alot, but there is alot of new stuff that came along with .NET 2.0. I can thank you for starting the 2.0 upgrade. That's when I discovered System.Collections.Generic. Still got to be _heaps_ of stuff still to find in there and I haven't even looked at 3.0 let alone 3.5!

Posted
They aren't really "mission critical" things I was pointing out but handy stuff to know.

If Java is your primary language you will pick up C# easily. It takes a while to learn some of the namespaces, but soon enough I'm sure it will grow on you. When you get rolling in C# it really is a pleasent language to code in. I've coded in many different languages and C# is by far my favourite. In fact it pains me when I sometimes have to go back to something else.

Not really. Lurking on .NET forums helps alot, but there is alot of new stuff that came along with .NET 2.0. I can thank you for starting the 2.0 upgrade. That's when I discovered System.Collections.Generic. Still got to be _heaps_ of stuff still to find in there and I haven't even looked at 3.0 let alone 3.5!

I thought this thread was about PlugInUltraStik 1.3 beta testing? Not that I'm not happy that you discovered Systems.Collections.Generic but to most of us this is greek. ;)

Posted
Actually, the attached file in the start of this topic does not include the PlugInUltraStik.ini as I did not want anyone to accidentally overwrite their current version. The the file attached I attached with this post includes the PlugInUltraStik.ini, my copy, which I originally released.

In the same zip file, I have also included another zip file which contains all source code, licenses, etc., associated with the project. Hopefully, this will please the developers from whom I borrowed code. (Try to make the community better, and get slapped on the wrist for it. Go figure.)

It's working now :) Thank you very much!

Posted
I thought this thread was about PlugInUltraStik 1.3 beta testing? Not that I'm not happy that you discovered Systems.Collections.Generic but to most of us this is greek. ;)

Actually, to most of us, this is greek:

Δεν είναι πραγματικά κρίσιμα "πράγματα" αποστολής που επισήμαινα αλλά πρακτική ουσία για να ξέρω. Εάν η Ιάβα είναι η αρχική γλώσσα σας θα πάρετε γ # εύκολα. Διαρκεί μια στιγμή για να μάθει μερικά από τα namespaces, αλλά σύντομα αρκετός είμαι βέβαιος ότι θα αυξηθεί σε σας. Όταν παίρνετε το κύλισμα γ # είναι πραγματικά μια pleasent γλώσσα που κωδικοποιεί μέσα. Έχω κωδικοποιήσει σε πολλές διαφορετικές γλώσσες και γ # είναι κατά πολύ η συμπάθειά μου. Στην πραγματικότητα αυτό πόνοι εγώ όταν πρέπει μερικές φορές να επιστρέψω στο κάτι άλλο. Όχι πραγματικά. Να κρυφτεί επάνω. τα φόρουμ δικτύου βοηθά alot, αλλά υπάρχει alot νέας ουσίας που ήρθε μαζί με. το δίκτυο 2,0. Μπορώ να σας ευχαριστήσω για την έναρξη της βελτίωσης 2,0. Ότι όταν ανακάλυψα System.Collections.Generic. Ακόμα αποκτημένου για να είμαι _ σωροί _ της ουσίας για να βρώ ακόμα μέσα εκεί και δεν έχω εξετάσει ακόμη και 3,0 πόσο μάλλον 3,5!

That stuff that HK wrote is "Geek" ;)

No offense HK, I truly wish I spoke geek too!

Posted

I have made all the changes that HK outlined. However, I am still waiting on a confirmed Vista user before we make it official.

Posted
I have made all the changes that HK outlined. However, I am still waiting on a confirmed Vista user before we make it official.

I'm a 'confirmed Vista user' and I've confirmed that it doesn't work for me. :)

No one responded to my question/comment above before breaking into geek speak as Tempest put it.

Posted
I'm a 'confirmed Vista user' and I've confirmed that it doesn't work for me. :)

No one responded to my question/comment above before breaking into geek speak as Tempest put it.

Can you open a Command Prompt, change to the directory where you installed it and type setControls.exe mouse and see if it goes into mouse mode? I just want to make sure that it is not my plugin, but rather the USB HID code.

Posted
Can you open a Command Prompt, change to the directory where you installed it and type setControls.exe mouse and see if it goes into mouse mode? I just want to make sure that it is not my plugin, but rather the USB HID code.

Done. It doesn't go into mouse mode, it says the following:

Detecting Ultrastiks...

2 Ultrastiks found

* Ultrastik #1 - Vendor ID:d209, Product ID:0501

* Ultrastik #2 - Vendor ID:d209, Product ID:0502

Done.

Posted
Anyone? Anyone?

Right back at ya Oggalz.

Wuzzup? You wanted a Vista beta tester and you got'em. ;)

Don't take this wrong I know you're probably busy and I do appreciate you working on this. Just drop an update when you get a chance. Even if just to say there's no way in hell this will ever work in Vista.

Posted
Can you open a Command Prompt, change to the directory where you installed it and type setControls.exe mouse and see if it goes into mouse mode? I just want to make sure that it is not my plugin, but rather the USB HID code.

I just realized that I had the wrong setControls within my release. That version was one I was testing that used a new USBHID library, which could read, but I could never get it to program the stiks.

Please try your manual setControls.exe test again from the command line with the attached files in Vista. If it works, then try it GameEx.

setControls.zip

Posted
I just realized that I had the wrong setControls within my release. That version was one I was testing that used a new USBHID library, which could read, but I could never get it to program the stiks.

Please try your manual setControls.exe test again from the command line with the attached files in Vista. If it works, then try it GameEx.

Thanks for the update Oggalz, still no luck. setConrols crashes when I try this with the new files. See the attached screenshot for the error dialog and text from the cmd prompt after crash.

Posted

shaunopp: Are you running 64-bit Vista? The reason I ask is because you will get that error if Oggalz has setcontrols.exe MSIL compiled using "Any CPU". The error message is "Unable to load DLL 'libusb' : The specified module could not be found." If you have your application compiled using "Any CPU" that means on a 64-bit machine it will be executing in 64-bit. When it goes to load the "libusb" library which is probably only 32-bit it will give the error "Unable to load DLL".

Solution: Compile setcontrols.exe for "x86" instead of "Any CPU"

If your running 32-bit Vista another possible reason for that error is compiling setcontrols.exe using a different version of "libusb" than the one your trying to run it with. Or it could simply be that the libusb.dll file is not located in the same folder as setcontrols.exe.

Posted
shaunopp: Are you running 64-bit Vista? The reason I ask is because you will get that error if Oggalz has setcontrols.exe MSIL compiled using "Any CPU". The error message is "Unable to load DLL 'libusb' : The specified module could not be found." If you have your application compiled using "Any CPU" that means on a 64-bit machine it will be executing in 64-bit. When it goes to load the "libusb" library which is probably only 32-bit it will give the error "Unable to load DLL".

Solution: Compile setcontrols.exe for "x86" instead of "Any CPU"

If your running 32-bit Vista another possible reason for that error is compiling setcontrols.exe using a different version of "libusb" than the one your trying to run it with. Or it could simply be that the libusb.dll file is not located in the same folder as setcontrols.exe.

No 64-bit, I'm running Vista Home Basic. Not sure where the libusb.dll is, I didn't copy this over as the instructions in the thread said that if you had the latest UltraStik firmware you didn't have to replace the libusb.dll. I'll double check the libusb.dll location tomorrow.

Posted
No 64-bit, I'm running Vista Home Basic. Not sure where the libusb.dll is, I didn't copy this over as the instructions in the thread said that if you had the latest UltraStik firmware you didn't have to replace the libusb.dll. I'll double check the libusb.dll location tomorrow.

There's no libusb.dll on my machine. There's a libusb0.dll file in a PluginUltraStik folder in my GameEx Plugins folder. Where are the plugin files supposed to reside? Floating in the GameEx Plugins folder, within a PluginUltraStik folder in the Plugins folder? To confirm, the main components of this plugin are:

ICSharpCode.USBlib.dll

PlugInUltraStik.ini

PlugInUltraStik.dll

setControls.exe

libusb.dll

Posted
Here is another compile of setControls and lower ICSharpCode.USBLib built exclusively for x86. Shaunopp try this one, and see if you can run it manually.

Hey Oggalz, thanks again for trying to work through this.

I had similar results on this go around, getting another error and crashing setControls.exe the 2 times I tried it.

Just for experimental purposes, I moved the libusb0.dll file into the GameEx Plugins folder and renamed it libusb.dll and then got an error message saying No UltraStiks found. Screenshot of errors below. My UltraStiks definitely show up under Game Controllers and work in GameEx and games. They are the 3rd and 4th device, I have 2 Logitech Rumblepads that are 1 and 2.

Posted
Hey Oggalz, thanks again for trying to work through this.

I had similar results on this go around, getting another error and crashing setControls.exe the 2 times I tried it.

Just for experimental purposes, I moved the libusb0.dll file into the GameEx Plugins folder and renamed it libusb.dll and then got an error message saying No UltraStiks found. Screenshot of errors below. My UltraStiks definitely show up under Game Controllers and work in GameEx and games. They are the 3rd and 4th device, I have 2 Logitech Rumblepads that are 1 and 2.

Can you give me a screenshot of setControls.exe debug

Posted
debug screenshot below.

Have you tried unplugging all your joysticks then just plugging in the 360's. I'd probably reboot too just to be sure then try again.

Also check that the 360's don't have a yellow /!\ icon next to them in Device Manager.

Posted
Have you tried unplugging all your joysticks then just plugging in the 360's. I'd probably reboot too just to be sure then try again.

Also check that the 360's don't have a yellow /!\ icon next to them in Device Manager.

I'll double check, but I'm sure the U360's are fine. They work fine in gameex and every emulator I've tried as well as the UltraStik utility. If every other app can find and use them then I would venture to guess the problem is in the plugin.

Guest
This topic is now closed to further replies.

×
×
  • Create New...