Posted: Sat Sep 19, 2020 1:21 pm Post subject:
How to use the new mod hotkeys
Yo,
I just spent an hour trying to figure this out and there doesn't seem to be much info on it, so I figured I'd write something down to make it useful to others.
In the latest/last patch, mods now get access to 4 hotkeys.
In the source code, these are defined in DLLInterface.h as
Code:
INPUT_REQUEST_MOD_GAME_COMMAND_1_AT_POSITION
,
Code:
INPUT_REQUEST_MOD_GAME_COMMAND_2_AT_POSITION
,
Code:
INPUT_REQUEST_MOD_GAME_COMMAND_3_AT_POSITION
and
Code:
INPUT_REQUEST_MOD_GAME_COMMAND_4_AT_POSITION
. You can Ctrl+F to find them.
However, you also need to enable them within the game. To do this you need to add a
Code:
GAMECONSTANTS_Mod.XML
file to your mod's DATA/XML folder. The contents of this file need to contain
Here's the entirity of the file, you can just copy/paste this if it's easier:
Code:
<?xml version="1.0"?>
<GameConstants>
<GameConstantsClass>
<!-- MBL 09.08.2020: Community-requested Mod option so that players can have customized mod hotkey commands -->
<!-- If True, also need to set GAME_COMMAND_CNC_MOD_COMMAND_1 -> GAME_COMMAND_CNC_MOD_COMMAND_4 entries in InputTranslatorConfigurations.xml -->
<CNCEnableModHotKeyGameCommands network="client"> True </CNCEnableModHotKeyGameCommands> <!-- Default is always False -->
</GameConstantsClass>
</GameConstants>
It's worth notinbg that I don't think you have to set the entries in InputTranslatorConfigurations.xml if you just want to bind some commands in the bindings screen, they'll be sent through as INPUT_REQUEST_MOD_GAME_COMMAND_x_AT_POSITION.
Doing this enables them in the bindings screen:
I haven't figured out if there's a way to rename them from Mod Command x to something more specific.
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum