0 registered members (),
677
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: joystick stubborn
[Re: Iglarion]
#406423
08/19/12 21:14
08/19/12 21:14
|
Joined: Jul 2002
Posts: 3,208 Germany
Error014
Expert
|
Expert
Joined: Jul 2002
Posts: 3,208
Germany
|
Hey, let's try if we can at least find what causes this. Can you check what value has? An easy way to do so would be to add this function to your game, then press "j" and let us know what number appears:
function numjoysticktest_startup() {
while(!key_j) wait(1);
error(str_for_num(NULL,num_joysticks));
}
This should give us a hint whether or not that joystick is getting recognized at all. Another possible thing to check: Perhaps it's not registered as the first joystick, or it's not the first button. To check for that, consider adding this function:
function numjoysticktest_startup() {
while(!key_k) wait(1);
while(key_k) wait(1);
error("Ready!");
while(key_any) wait(1);
while(key_any==0) wait(1);
error(str_for_num(NULL,key_lastpressed));
}
If you add that function to your code, then hit [K], a prompt reading "Ready!" will appear. Click "OK", then (before hitting any other key) hit your joystick button. It will (if it recognizes the joystick, at least) report the scancode of whichever key was pressed. You can then check the manual to see what key that is, or report to us the number and we can check that together.
Perhaps this post will get me points for originality at least.
Check out Dungeon Deities! It's amazing and will make you happy, successful and almost certainly more attractive! It might be true!
|
|
|
Re: joystick stubborn
[Re: JazzDude]
#406430
08/19/12 22:20
08/19/12 22:20
|
Joined: Jul 2002
Posts: 3,208 Germany
Error014
Expert
|
Expert
Joined: Jul 2002
Posts: 3,208
Germany
|
Ah, a challenge! Well, let's check that value then! Try adding this function to your script and let us know what numbers appear on the screen!
function alovelytestofalovelykey_startup() {
while(1) {
draw_text(str_for_num(NULL,joy_1),1,1,vector(255,255,255));
draw_text(str_for_num(NULL,key_pressed(256)),1,20,vector(255,255,255));
wait(1);
}
}
It should - in theory - display "0" and "0" if you don't press the joystick button, and "1", "1" otherwise.
Perhaps this post will get me points for originality at least.
Check out Dungeon Deities! It's amazing and will make you happy, successful and almost certainly more attractive! It might be true!
|
|
|
|