Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Joystick Help

Author
Message
robster
15
Years of Service
User Offline
Joined: 15th Dec 2008
Location:
Posted: 24th Jan 2009 12:34
can anyone help me, i'm a noob at all of this and i need help with how sensitive my joystick is. basicly i want to have to push the joystick up a bit more before my object starts moving.

any help would be great thx.
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 24th Jan 2009 14:49
Post some of your code and it should be an easy fix.
robster
15
Years of Service
User Offline
Joined: 15th Dec 2008
Location:
Posted: 24th Jan 2009 17:30
here u go



i know its very basic but my object just moves backward i think its because it's to sensitive.
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 25th Jan 2009 02:49
Why don't you use the value that the dbJoystickY() function returns?


I'm not sure what values the joystick returns since I haven't played with it yet and the documentation doesn't state what range and sign the functions return. But a few tests should give you an answer.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
sydbod
16
Years of Service
User Offline
Joined: 14th Jun 2008
Location: Just look at the picture
Posted: 25th Jan 2009 03:52
Quote: "not sure what values the joystick returns"




Hope that is of value.
Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 25th Jan 2009 05:09
Lilith, I think he's compensating for a deadzone. This is where there's no physical movement, but the joystick won't return 0.
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 25th Jan 2009 05:21
Quote: "I think he's compensating for a deadzone. This is where there's no physical movement, but the joystick won't return 0.
"


With the code he shows, the dbJoystickUp() function would have to do the compensating since it only returns the equivalent of true/false. But there's no sensitivity setting for what the function considers to be up or down.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 25th Jan 2009 05:28
Where are you quoting that from Lilith?

Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 25th Jan 2009 05:32
Oh wait, sorry. I didn't read it all. Never mind.
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 25th Jan 2009 05:54
Quote: "Where are you quoting that from Lilith?"


I'm quoting from the message that was emailed to me that there was a response to this thread. If I wait for the newbie delay to kick in I might be asleep and I don't do my best thinking when I'm asleep. Someday I'll tell you about the dreams I have.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 25th Jan 2009 05:56
@sydbod: What range does dbJoystickX (or Y) return and does it return negative values when it's in a down position?

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
sydbod
16
Years of Service
User Offline
Joined: 14th Jun 2008
Location: Just look at the picture
Posted: 25th Jan 2009 07:26 Edited at: 25th Jan 2009 07:31
"dbJoystickY ( )"
returns 0 in middle position
returns -1000 stick pushed full forward
returns +1000 stick pulled full backwards

"dbJoystickX ( )"
returns 0 in middle position
returns -1000 stick pushed full left
returns +1000 stick pulled full right

"dbJoystickTwistZ ( )"
returns +0 stick twisted full left
returns +32767 in middle position
returns +65535 stick twisted full right

"dbJoystickSliderA ( )" ....... throttle
returns +65535 on minimum setting
returns +0 on maximum setting

As you can see, it is all over the place.
If one also wants to use the tophat for pointing the camera, then one also has to be careful as there are 2 different default values that get returned for the hat switch sitting in its center position (depending upon what brand of joystick is being used).
robster
15
Years of Service
User Offline
Joined: 15th Dec 2008
Location:
Posted: 25th Jan 2009 12:58
hay thx for all of your help.

i think i can just about get my head around all of this!
robster
15
Years of Service
User Offline
Joined: 15th Dec 2008
Location:
Posted: 25th Jan 2009 13:09 Edited at: 25th Jan 2009 13:58
oh i just tryed out your code Lilith and it is sayin something about

"error C2065: 'MinimumSensitivity' : undeclared identifier"

im not sure what it means but any help would be apprecaited.

edited

srry doesnt matter got it to work
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 25th Jan 2009 17:01
Quote: ""error C2065: 'MinimumSensitivity' : undeclared identifier""


I was using that as an example. You'd have to declare an integer with that identifier and assign it some value in the range of, it appears, 0 to 1000. This would represent the value beyond which the joystick would have to be pushed in order for your code to consider it up, down, right or left. According to sydbod you have to take into account that forward/up is negative, which is counter intuitive to me.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 25th Jan 2009 17:04
@sydbod: Thanks for that information. It keeps me from having to write a test program.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
robster
15
Years of Service
User Offline
Joined: 15th Dec 2008
Location:
Posted: 25th Jan 2009 17:31
ya thx for that and i got it to work thx for all your help

Login to post a reply

Server time is: 2024-09-30 17:28:55
Your offset time is: 2024-09-30 17:28:55