Getting steering wheel to work in T2D 176
by Andy Hawkins · in Torque Game Builder · 02/08/2013 (5:28 am) · 2 replies
I've asked for support in the Kart Kit forum but it's seems it's not getting many hits at the moment. When I thought about it, I realised the issue is just a Torque 2D issue.
Is it simple enough to just add the steering wheel support for Torque and then remap the move map in script or is it more involved? Anyone done this yet?
I've read that it's the same as a joystick so I've written enableJoystick() in Torquescript then added move binds to it like this. But the functions aren't being triggered. I've checked in the properties for the steering wheel and also putting just a joystick in. They both respond in the Windows Control Panel just not in Torque.
I think it might be my moveMap.bind syntax but all around the forums it changes quite a lot. Does this look correct, and can someone help me with getting the steering code to work please?
Is it simple enough to just add the steering wheel support for Torque and then remap the move map in script or is it more involved? Anyone done this yet?
I've read that it's the same as a joystick so I've written enableJoystick() in Torquescript then added move binds to it like this. But the functions aren't being triggered. I've checked in the properties for the steering wheel and also putting just a joystick in. They both respond in the Windows Control Panel just not in Torque.
I think it might be my moveMap.bind syntax but all around the forums it changes quite a lot. Does this look correct, and can someone help me with getting the steering code to work please?
// support wheel
moveMap.bind (joystick, "xaxis", "steeringWheelTurn();");
//moveMap.bind (joystick, "yaxis", joystickPitch);
//moveMap.bind (joystick, "zaxis", joystickThrottle);
moveMap.bind (joystick, "button0", "testPressButton();");
moveMap.bind (joystick, "button1", "testPressButton();");
}
return;
}
function testPressButton()
{
echo("Pressing a button");
}
function steeringWheelTurn(%val)
{
echo("Steering:"@%val);
if (%val < 0)
{
kart1.leftOnSteer(-0.1);
kart1.leftOff();
}
else
{
kart1.rightOnSteer(0.1);
kart1.rightOff();
}
}
#2
www.garagegames.com/community/forums/viewthread/132803
But I'm now testing on a Logitech Force Feedback MOMO and I made the fix in this thread but it doesn't seem to work for Torque 1.7.6
www.garagegames.com/community/forums/viewthread/102797
Anyone know what else I could try to get it to find my steering wheel?
The change required this addition in winDInputDevice.cc but it doesn't appear to work.
04/18/2013 (9:03 am)
I've fixed it mainly, and it works really well with a gamepad as I've solved in this thread...www.garagegames.com/community/forums/viewthread/132803
But I'm now testing on a Logitech Force Feedback MOMO and I made the fix in this thread but it doesn't seem to work for Torque 1.7.6
www.garagegames.com/community/forums/viewthread/102797
Anyone know what else I could try to get it to find my steering wheel?
The change required this addition in winDInputDevice.cc but it doesn't appear to work.
case DI8DEVTYPE_DRIVING: //<-- ADD THIS LINE!
case DI8DEVTYPE_JOYSTICK:
case DI8DEVTYPE_GAMEPAD:
mDeviceType = JoystickDeviceType;
mDeviceID = smJoystickCount++;
dSprintf( mName, 29, "joystick%d", mDeviceID );
break;
default:
mDeviceType = UnknownDeviceType;
mDeviceID = smUnknownCount++;
dSprintf( mName, 29, "unknown%d", mDeviceID );
break;
Torque Owner Max Kielland
MK Development
GlobalActionMap.bind("joystick","xaxis", "onSteerX");I can be wrong in this asumption but...
joystick refers to joystick0 and if I'm not remembering it wrong, with USB devices they get the same ordered number from installation. joystick0 may work with your joystick because it was the first one you installed.
You can try joystick1,joystick2,joystick3 etc... and see if you can find your wheel.