Game Development Community

Adjusting Joystick Speed?

by Denis Linardic · in Torque Game Engine · 10/26/2004 (2:38 pm) · 3 replies

Hi!

Is it possible to adjust joystick speed?

example:

In starter.racing i connected a very cheap Driving wheel which is detected as Joystick in Windows. Everything works fine except those wheels on buggy turns very slowly. Is there a way to speed up that turning?

P.S. Sorry for my english but it's not my native language.

#1
10/26/2004 (2:45 pm)
Ok. I figured out, but I have one more problem. Is it possible when i release joystick to return wheels in first (neutral) position?
#2
10/27/2004 (1:15 am)
Not quite sure about your question. If you want the physical driving wheel to return to it's neutral position, and the wheel supports force feedback, the drivers would probably support switching on self-centering.

If you are talking about the wheels of the car going back when the joystick resumes normal position, try using the following code:

function getJoystickAdjustmentAmount(%val, %last)
{
	%offset = (%val - %last) * 0.6;
	return (%offset);
}

function yaw2(%val)
{
   $mvYaw += getJoystickAdjustmentAmount(%val, $lastYaw);
   $lastYaw = %val;
}

Just remember to set $lastYaw to the appropriate value at the start of the race.
#3
10/29/2004 (2:05 am)
Thanks! My wheel works perfect now! Altough I had to make some small engines changes (from flight stick resource).