Gamepad controls
The zGamePad plugin comes with a default control scheme, but it is possible to create your own. The plugin will search for any file with the .gamepad.overlay
extension placed in Gothic/System
directory or in any of the loaded .mod
and .vdf
archives.
Control file syntax
Gamepad controls are set using the .gamepad
configuration file. This file encodes the controls for different actions in the game and the hint string in multiple languages.
Warning
The .gamepad
file must be encoded in Unicode or UTF-8 to accommodate the multilingual hint strings.
Regions
The format supports code blocks specified by the #region
and #endregion
keywords. These regions do not have any syntactical meaning, they only offer a convenient way to collapse sections of the code in editors with the syntax highlighting capabilities such as Notepad++
Comments
Comments are useful for quick information or just to disable some old code that might come in handy later. The .gamepad
file syntax supports C++ line comments using two forward slashes //
.
Warning
Comments can only be used at the start of any given line!
Strings
Strings are used for interactive hints. They should be defined at the top of the file. To define a string, use the keyword String
. Strings have the following format:
Example
name
must be unique and is used to reference the string while defining hints. The language tag matches the language in SystemPack.ini
. If the file does not contain the user's language, English will be taken by default. If there is no English, then the first one. Control bindings
A binding is a description of an event that includes emulation object and conditions. Hints are part of the binding.
The general structure of the bind starts with the keyword KeyRecord
and has the following format:
Control binding | |
---|---|
Id
- unique identifier used by other users to override this control binding[modifier]
- can be empty or take the value ofToggled
If the value is empty, the control binding will work as long as the player holds down the specified button or button combination.
If the value isToggled
, the control binding will work only when the player toggles the button or button combination. (One press to start sneaking, another press to stop sneaking)Combination
- these are the gamepad buttons that the player must press or hold to activate the control binding.Emulation
- specify which buttons will be emulated. You can specify absolute buttons, or that are defined in the game settings (logical).Condition
- specify the condition under which the control binding can be activated. To invert condition, use the operator!
before the operand (!Cond_IsOverlayTop, !JOY_B)-
Help
- name of the text string with a hint which will be displayed when the Conditions are met. -
[gamepad keys]
- Gamepad key list [engine logical keys]
- Engine logical key list[engine absolute keys]
- Engine absolute key list[logical functions]
- Logical function list
Tip
All operators are optional! This means that if a binding should only show a hint, it doesn't have to contain Combination.
Example
Controls override
If you want to change or remove bindings from another controls file, use the KeyDisable
keyword.
Default controls file
Controls override syntax | |
---|---|
fileName
is the name of the controls file without extension and id
is a key of the binding.