-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'pygame.error: Invalid joystick hat' at first run and crash #10
Comments
There might be a problem about some pseudo-joysticks as pointed out in #5. Can you try this patch? Funatiker@7bc2dc5 |
Patch merged. Sorry for late returns, somehow I do not get E-Mail notifications for every new issues & every message. |
Thank you @Funatiker and @WinterLicht ( got your email, I'll reply asap ;-) ).
|
@Deevad oops. My bad. Sorry. My patch only included checking whether there are enough axes but not whether there are enough hats. Can you try whether this patch fixes it for your hardware? |
Thank you @Funatiker , your patch is working here, now I need to find a Joystick to move the character. :-) |
@Deevad Glad to hear that. My code does no magic. It just ignores controllers without hats. Maybe we should think about adding support for the controllers you have. There is another problem: We assume the controller to have a specific ID. If PyGame knows several joysticks (i.e several controller or controller-like devices plugged in) and the wrong one has the assumed ID, the game will believe that there is no compatible controller. |
It's fun, because I had all this issues with no joystick plugged.
|
@Deevad That's exactly the point. Some devices are joysticks in PyGame's world although they don't look like joysticks to human beings. I guess it's your graphic tablet. But maybe you want to run the example code on |
I'm a total noob with Python, I tried to copy the two lines proposed on the page you linked inside a joytest.py file, give it execution right, and run it, here is the result:
|
Looks like you haven't installed PyGame. How are you able to run the game without PyGame?! o.0 |
I have it installed, but I have a mess into this system, it's half python2 and python3 mixed together. I'll try to tweak later this week about it. |
@Deevad besides running it with |
The Joystick-Test was started with python 2.7.6 (as stated above it is the output of "python -V") I have the same version. Pygame is installed. Otherwise ChaosProjectile couldn't start with a "python game.py". Also PyTMX and pyscroll are installed correctly. "name 'pygame' is not defined" may come up from missing "import pygame" at the beginning of the joytest.py! Btw. SDL_JoystickGetAxis shows (almost) the lowest number for signed integer (16 bit) -32767 (lower is only -32768) Please consider my comment above, the game was only tested with a Sony controller and it is playable with keyboard&mouse. |
@WinterLicht You are totally right about the missing About the irritating values of the axes: The reason might be that The biggest problem is that keyboard and mouse input are disabled when the game believes to have a joystick available. @Deevad Download pygametest.py.txt |
The script ran! (I just had to change the 'import pygame2' to 'import pygame' on line 2). Thank you @Funatiker for the ready-made script. Here is a screenshot of the output; and you were right: the device pygame analysis as a joystick is my Wacom tablet: |
@Deevad Interesting. Can you take a screenshot with an actual gamepad plugged in? As I assumed: The non-gamepad-joystick reserves ID 0, |
@Funatiker With a Sixaxis Ps3 gamepad (USB) connected, it list only the gamepad. I also installed the package jstest-gtk to see if the Ps3Gamepad was auto-installed by LinuxMint, and fun, jstest-gtk list Wacom and the Ps3Gamepad as two devices available for Joystick. Here is the screenshot: |
@Deevad Interesting. PyGame doesn't see the graphic tablet anymore when there is the PS3-USB-Controller and this controller does not have a "hat". We have two options: Either someone adds compatibility for your controller (and possibly some other controllers … or even a tool to configure controllers) or we enable at least the keyboard when there are only incompatible controllers. |
@Funatiker : Oh I see. The Ps3 gamepad is also something irregular as a joypad for pygame. It looks to be a common issue with pygame joystick module, same for xbox gamepad. ( https://github.com/davide-P/sixAxis/blob/master/sixAxis.py ) I'll try to test with a generic gamepad, if I can find one. |
@Deevad Very interesting. Ignoring Wacom-devices sounds like a good first start. The other option would be seeking for specifically the supported devices. |
I've rewritten the whole controller thing. An Intuos3 was not recognized as a joystick on my computer. Default controls should always work now despite "strange" joystick behavior. |
Hi,
As a newbie, I'm doing my first local install, cloning the game at commit 714d34c on a LinuxMint 17.3 Cinnamon 64bit (ubuntu 14.04 based, rather old library) the viewport of the game launch, blink then crash after a little half-second.
Python is 2.7.6 when I do
python -V
in a console.Here is the full log, text version:
I hope this is not my operating-system. I'm available to enter more command line in terminal if you need more information about my library versions. Thank you for your time.
The text was updated successfully, but these errors were encountered: