Game Development Community

Input Mapping

by JohnT · in Torque X 3D · 06/19/2009 (5:58 pm) · 2 replies

I have been trying to turn the FPS demo into a single player game by changing

fpsGameManager.PlayerCount = 2; to fpsGameManager.PlayerCount = 1;


This eliminates the split screen and I have the one player that appears to react to jump but no other keyboard movement controls appear to work. I've looked through the input Mapping to try and see where the problem is but could not find any problems.

Thanks for any help,
John

#1
06/29/2009 (2:32 pm)
I've been noticing an overall problem with the input mapping in the demos and the keyboard mapping does not appear to work correctly for movement but does for jumping.

I noticed by accident if I change the following line in T3DInputComponent and return -1 for the keyboard id the movemement now works but the jump no longer works.

protected override bool _OnRegister(TorqueObject owner)
{
...
int keyboardId = InputManager.Instance.FindDevice("keyboard");
keyboardId = -1; //Added this line
_SetupInput(_inputMap, gamepadId, keyboardId);

return true;
}


Am I the only one experiencing keyboard mapping problems?
#2
07/08/2009 (10:50 am)
I finally figured something out on this and thought I'd pass along what I discovered.

It appears that the following lines are conflicting with some lower settings for movement. By removing them from the build I was able to get everything working correctly. I realize that this is not a fix and hope that this issue is corrected in the next release.

Let me know if this should be added to the bug list.
Thanks

// move
//inputMap.BindMove(gamepad, (int)XGamePadDevice.GamePadObjects.LeftThumbX, MoveMapTypes.StickAnalogHorizontal, 0);
//inputMap.BindMove(gamepad, (int)XGamePadDevice.GamePadObjects.LeftThumbY, MoveMapTypes.StickAnalogVertical, 0);

// look
//inputMap.BindMove(gamepad, (int)XGamePadDevice.GamePadObjects.RightThumbX, MoveMapTypes.StickAnalogHorizontal, 1);
//inputMap.BindMove(gamepad, (int)XGamePadDevice.GamePadObjects.RightThumbY, MoveMapTypes.StickAnalogVertical, 1);

// wasd
//inputMap.BindMove(keyboard, (int)Keys.D, MoveMapTypes.StickDigitalRight, 0);
//inputMap.BindMove(keyboard, (int)Keys.A, MoveMapTypes.StickDigitalLeft, 0);
//inputMap.BindMove(keyboard, (int)Keys.W, MoveMapTypes.StickDigitalUp, 0);
//inputMap.BindMove(keyboard, (int)Keys.S, MoveMapTypes.StickDigitalDown, 0);

// arrows
//inputMap.BindMove(keyboard, (int)Keys.Right, MoveMapTypes.StickDigitalRight, 1);
//inputMap.BindMove(keyboard, (int)Keys.Left, MoveMapTypes.StickDigitalLeft, 1);
//inputMap.BindMove(keyboard, (int)Keys.Up, MoveMapTypes.StickDigitalUp, 1);
//inputMap.BindMove(keyboard, (int)Keys.Down, MoveMapTypes.StickDigitalDown, 1);