Modding:Key Mapping (Commands): Difference between revisions

From Caves of Qud Wiki
Jump to navigation Jump to search
(To be continued... (submitted bug report because I can't actually get this feature to work))
 
imported>Teamtotobot
m (Teamtotobot moved page Modding: Key Mapping (Commands) to Modding/Key Mapping (Commands): Bot: Moved page)
(No difference)

Revision as of 14:32, 22 September 2019

This page is about modding. See the modding overview for an abstract on modding.
This page is about modding. See the modding overview for an abstract on modding.

Mods can add custom key mapping entries to the Key Mapping menu.

Key Mapping.png

Players can then bind a key to the mod's custom command.

When the player presses that key, the mod's custom command is received as an event on the player character. This means that at least a small amount of C# scripting is required to take advantage of the key mapping infrastructure.

Define Key Mapping Options

A mod defines its custom key mapping options in a Commands.xml file. Here's an example file that defines two commands.

<?xml version="1.0" encoding="utf-8"?>
<commands>
  <command ID="ModName_Cmd_One" DisplayText="My Custom Debug Command" Category="Debug"></command>
  <command ID="ModName_Cmd_Two" DisplayText="My Custom Cool Command" Category="Cool"></command>
</commands>

In this case, we've added one command to the existing "Debug" category in the Key Mapping menu. We've added another command to a new category - the "Cool" category. Here's how it looks in game:

Modding - Custom Key Mapping Menu.png