BeamNG inputmap syntax error for USB Joystick

242 views Asked by At

I wanted to make inputmap for my USB Joystick. I made all like in this tutorial: http://wiki.beamng.com/Playing My inputmap:

// Product Name: (USB Joystick)
// GUID: (00030E8F-0000-0000-0000-504944564944, format: {XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX})
// axes: (4^Y^X^RZ^Z, format 3^X^X^X or 4^X^X^X^X, etc.)

//%device = "{00030E8F-0000-0000-0000-504944564944}-" @ %joyNum 0;  (<- Guid goes there too)
%device = "joystick" @ %joyNum 0; (<- device type goes there, joystick/gamepad)

// 0 deadzone
$gp_deadzone = "-0.15 0.15"; (possible deadzone configure)

// camera
moveMap.bind(%device, (axis name), "D", $gp_deadzone, gamepadYaw);
moveMap.bind(%device, (axis name), "D", $gp_deadzone, gamepadPitch);
// movement
moveMap.bind(%device, (rzaxis), joy_steer_nl_dz);
//moveMap.bind(%device, thumbly, "D", $gp_deadzone, gamePadMoveY); // using triggers instead

moveMap.bind(%device, (zaxis), "D", $gp_deadzone, joy_brake);
moveMap.bind(%device, (yaxis), "D", $gp_deadzone, joy_accelerate);

moveMap.bindCmd(%device, (button name), "beamNGResetPhysics();", "");
moveMap.bindCmd(%device, (button name), "beamNGTogglePhysics();", "");
moveMap.bindCmd(%device, (button1), "beamNGToggleParkingBrake();", "");
moveMap.bindCmd(%device, (button2), "beamNGSwitchVehicle();", "");
moveMap.bindCmd(%device, (button name), "gamepadZoom(-0.1);", "gamepadZoom(0);");
moveMap.bindCmd(%device, (button name), "gamepadZoom(0.1);", "gamepadZoom(0);");
moveMap.bindCmd(%device, (button3), "beamNGResetCamera();", "");

moveMap.bindCmd(%device, (button4), "beamNGCameraToggle();", "");

When I start the game, I am not able to steer with my joystick. This is what the torque3d.log says:

38.952018|scripts/client/inputmaps/custom/usbjoystick.inputmap.cs Line: 6 - syntax error
38.952085|>>> Advanced script error report.  Line 6.
38.952146|>>> Some error context, with ## on sides of error halt:
38.952211|// GUID: (00030E8F-0000-0000-0000-504944564944, format: {XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX})

38.952233|// axes: (4^Y^X^RZ^Z, format 3^X^X^X or 4^X^X^X^X, etc.)

38.952249| 

38.952264|//%device = "{00030E8F-0000-0000-0000-504944564944}-" @ %joyNum 0;  (<- Guid goes there too)

38.952279|%device = "joystick" @ %joyNum 0; (<- device type goes there, joystick/gamepad)

38.952294|##
38.952309|##
38.952323|// 0 deadzone

38.952339|$gp_deadzone = "-0.15 0.15"; (possible deadzone configure)

38.952369|// camera

38.952383|moveMap.bind(%device, (axis name), "D", $gp_deadzone, gamepadYaw);

38.952398|moveMap.bind(%device, (axis name), "D", $gp_deadzone, gamepadPitch);

38.952413|// movement

38.952427|moveMap.bind(%device, (rzaxis), joy_steer_nl_dz);
38.952487|>>> Error report complete.

I tried everything I can to solve this problem but I still don't succeed. Sorry for my english.

1

There are 1 answers

0
Flick On
38.952294|##
38.952309|##

these two signs indicates where the fault is...

It means you need to delete the space that is between the line that says...

%device = "joystick" @ %joyNum 0;

device type goes there, joystick / gamepad

and the line below it.