Modding input bindings

Modding input bindings

From BeamNG

Version 0.7.0.0 brings some changes that make it easier to provide new bindings to the users in your mods.


Adding new global actions

"Actions" are each of the possible activities that the user can trigger with their gamepad/keyboard/etc.

BeamNG.drive bundles many different actions, such as "steering", "toggleMenues", "switch_camera", etc.


If you want your mod to provide new actions, the only way used to be overwriting the lua/ge/input_actions.json file with your own version. This meant that, any new actions that the official file adds after an update, would not be accessible until the mods are updated to include those changes too.


The new way to achieve this is to create new actions files. Their filename must match the pattern input_actions*.json.


For example:

lua/ge/input_actions_my_awesome_mod.json

You can include as many of those files as you want. Just make sure you follow the original json format.

Note: try to choose filenames that are unlikely to collide with other mods' filenames.


The syntax of the file is the same as usual.


Adding vehicle-specific actions

The same applies to vehicle actions: create extra files using the same pattern, but this time inside the vehicle directory.

For example:

vehicles/pickup/input_actions_foobar.json

For more information, see Vehicle Specific Bindings