banner
Rating
Voted0

Custom hotkeys

1
Mod version:1
Game version:1.1.0
The mod has been successfully tested for the absence of viruses
1749.29K21.12K

Report mod

  • image
  • image
modalImage

About This Mod

This mode allows you to bind console commands to hot keys, and adds many new console commands. For more information, see the description.


Contents:

TL;DR

MOD Options Menu

Shortcut Keys.json

Field description.

Command Separator

New Team

6.1. game teams

6.2 general commands

6.3. game teams*

6.4. development tools

Examples of commands.


1. tl;dr.

This mod is useful for both players and mod creators: You can add/edit hotkeys by editing the hotkeys.json file (changes are applied immediately). The key binding can be changed in the menu of options of mode (key + modifier).


Some features.

Multiple console commands can be executed by pressing a single key.

You can use shortcuts as multi-state switches.

Commands can be repeated continuously while the hotkey is pressed.

You can use additional key selectors for shortcuts.

Added many new console commands (e.g. use/freeze items or change auto-advance mode).


2. MODE options menu

image 1 for

All default shortcuts have been added to the MOD options menu. Each hot key has two snap buttons, but unlike vanilla bindings, they are for keys and additional key modifiers, not for primary/secondary keys.

Both buttons can be used for the snap keys as well as for the modifier keys.


You can use the Control, Alt, and Shift keys as modifier keys (the left and right keys are treated as separate keys). These keys can also be used separately, in which case they act as normal keys.


If two modifier keys or two non-modifier keys are connected at the same time, only the first key is used.


You can unsnap an anchored button by pressing the Delete button when you rest the mouse pointer over the anchored button (you do not need to click the button).


3. HOTKEYS.JSON

All shortcuts are set in the hotkeys.json file in the mod folder. This file can be opened from the game (button in the menu of fashion options).

Changes to the hotkeys.json file are applied immediately (as soon as you switch to the game), so there is no need to reload the game to add or change hotkeys.


An example of a hotkeys.json file with three hotkeys:

{

 "hotkeys": [

  {

   "key": "A",.

   "command": "some_console_command"

  }, }

  {

   "key": "B",.

   "command": "some_console_command1; some_console_command2",

   "label": "Two Commands".

  }, }

  {

   "key": "LeftAlt+C",

   "command": "some_console_command value1 | some_console_command value2",

   "mode": "pressRelease",

   label: Modifier Switch,

   "hidden": true

  }

 ]

}


4. field description

Each shortcut key is defined in the following format:

{

 "key": "A",.

 "command": "some_console_command",

 "mode": "press",

 "label": label": "some tags",

 "hidden": false

}

The key and command fields are required, while the rest are optional.


"key" (required): an empty string (""), a single key (such as "A" or "LeftAlt"), or a modifier key (such as "LeftShift+F1").

command (required): The console command associated with this hotkey. You can use any valid console command here, as well as two types of separators: semicolons (;) and vertical bars (|). For more information, see Chapter 5.

mode (optional, default is Press): the mode of the shortcut key. The shortcut key can operate in three different modes:

Pressure Mode (0 or "Press"): Pressing a key causes the command to run once.

Press/Release mode (1 or Press/Release): The command is executed once when the key is pressed and again when the key is released.

hold mode (2 or "Hold"): the command executes each frame while the key is pressed.

"label" (optional, default: ""): the option label in the mode options menu. If this field is omitted or left blank, the command is used as a label.


hidden (optional, default: false): If true, this option will be hidden from the mode options menu, but the hotkeys will remain active.


5. command delimiter.

You can use two types of separators in the command field: a semicolon (;) and a vertical bar (|). If you want to execute several commands at the press of one key, separate them with semicolons: for example, "command": "titanium item 5; silver item 10; gold item 15".

All of these commands are executed as a single action (each command is executed in a separate frame). You can also insert a delay between commands using the "wait" command (see section 6.2 for more information).


For more complex behaviors, you can use vertical bars as separators. Vertical bars divide a command line into a list of individual commands. Each command in the list is executed by activating a separate hotkey.


For example, suppose you have the following command line: "command": "speed 10 | speed 1", and the default hotkey mode is Press. In this case, the first time you press the hotkey, the "speed 10" command will be executed.

The next time you press the hotkey, the command "speed 1" will be executed; the third time you press the hotkey, the command "speed 10" will be executed again.


In the same command line and PressRelease mode, the second speed 1 command is executed when the hotkey is released.

In Hold mode, the first and second commands are executed alternately at each frame while the hot key is pressed.


Both delimiters can be used in the same command line, for example "daynightspeed 10; speed 10 | daynightspeed 5; speed 5 | daynightspeed 1; speed 1". Vertical bars take precedence over semicolons.

6. new teams

This section describes the new console commands that were added with this change.


Required parameters are specified in square brackets (e.g. <width>) and optional parameters are specified in square brackets (e.g. [itemtype]).


6.1. game teams

autoforward [{true|false}] (autoforward) Enables/Disables automatic forwarding.

Toggles the automatic forwarding mode on/off (toggles if this option is omitted). Auto-forward mode simulates pressing the "forward" key.

Example: autoforward true

Bind slot <slotID> [item type].

Binds a specific item from the inventory to the slot ID of the slotID (0-based index). If itemtype is omitted, the slot is cleared from the previous binding.

Example (snap flashlight to first quixslot): bindlot 0 flashlight

Equip [slotID] slot.

Equip the item in slotID fast slot (slotID - index based on 0); if slotID is omitted, the current item will be sheathed.

Example (equip item in first slot): equipslot 0

useitem <itemtype> [itemtype2] . [itemtypeN].

Use expendable item from inventory or equip an item to be equipped; if more than one item type is specified, the first item found will be used.

Example (drink a bottle of water): useitem filteredwater disinfectedwater bigfilteredwater

Entrance to the vehicle.

The crew enter a nearby sailor's or shrimp's spacesuit.

Vehicle_Upgrade.

A team that opens an interface for upgrading a nearby sealant or shrimp costume.


6.2 general commands

addhotkey <width>. 

Adds a hotkey for the specified command and opens the options menu. Use to add hotkey templates to the hotkeys.json file from the console.

Example: addhotkey item titanium 10

setresolution <width> <height> [fullscreen:{true|false}] Set permission.

Sets the Subnautica window resolution; the third default is true.

Example: setresolution 1280 720 false

setwindowpos <x> [7] 

Subnatica sets the window position.

Example: setwindowpos 10 10

fov [8]. 

Changes the field of vision. Low diving mask values can block the field of view, which can be hidden using the devtools_hidegui command (section 6.4).

Example: fov 60

showmessage [9]. 

Displays the message in the upper left corner of the screen.

Example: showmessage Hello world.

Clear the message.

Clears all messages displayed in the upper left corner of the screen.

Screen Options

Click the Options menu and then click the Modes tab.

lastcommand [index].

Executes the last console command you entered. The parameter sets the command index to zero from the end of the console history (the default value is 0).

Example (running penultimate command): lastcommand 1

wait [10]. 

Adds delay between semicolon separated commands (see Chapter 5 for details).

Example (adding a delay of 0.5 seconds between two commands): command1; wait 0.5; command2


6.3. game teams*

game_startnew [game_mode:{survival|freedom|hardcore|creative}]

Starts a new game in the specified game mode. Works only in the main menu. The default value is 'creative'.

Example: game_startnew survival

game_load [slot_id].

Loads a saved game with the specified slot ID (you can use UITweaks to see the saved slot ID). Works only in the main menu. By default, the last saved game is loaded.

Example: game_load 10

Saving the game.

Saves the current game to the slot.

game_quit [to_desktop:{true|false}] Exit the game.

Exit the game. The default is false (returns to the main menu).

Example: game_quit true


6.4. development tools

devtools_toggleterrain

Opens the debug information menu (F1 in vanilla).

devtools_togglegraphics

Opens the debug graphics menu (F3 vanilla).

devtools_toggleframegraph

Changes the performance graph.

devtools_hidegui [state:{none|mask|hud|maskhud|all}] Hide/show interfaces.

Hides/shows interface (F6 in vanilla); there are five states:

0 or none - nothing is hidden.

1 or mask - hides the diver mask.

2 or hud - hides HUD.

3 or maskhud - Hides the mask and HUD.

4 or all - hides mask, HUD and player model.

If state is omitted, the command traverses all states.

Example: devtools_hidegui mask


7. sample commands

This section provides examples of different ways to use the team to develop games and modes. You can create your own commands using them as a starting point. These and other sample commands can be found in the hotkeys.sample.json file in the MOD folder (copy or rename some commands to hotkeys.json).


"bindslot 0 flashlight; equipslot 0".

A simple command to equip a flashlight (the flashlight should be in inventory).

"bindslot 1 propulsioncannon; equipslot 1 | bindslot 1 repulsioncannon; equipslot 1" Command to switch between motion and repulsion.

Command to switch between propulsion and repulsion guns (both guns must be in inventory).

"bind slot 0 seaglide; equipslot 0; autooforward true | bind slot 0 flashlight; equipslot 0; autooforward false".

Command to switch between seaplane and flashlight (can also switch autotranslation)

"devtools_hidegui mask; fov 5 | fov 60; devtools_hidegui none".

Scale commands (useful in various situations). Immersion masks do not work well at low FoV values and must be hidden; PressRelease can be used in hotkey mode.

"setresolution 1280 720 false; setwindowpos 10 10 | setresolution 2560 1440".

Command to change full-screen mode (especially useful for mod development). Also moves the game window into a corner.

"Spawn Seamoth; warpforward 10; speed 10; vehicle_enter; wait 2; speed 1; clearmessages".

The spawn and Seamoth login commands (to be used during fashion development) use the speed and wait commands to speed up spawn animation and login (the wait command depends on the speed command, so the actual wait is 0.2 seconds).


What you need.

QModManager

SMLHelper


Installation.

Extract the archive into the QMods folder.


Check for updates.

Mod regularly checks for updates online.

This can be disabled in mod.json (install UpdateCheck in false).

Similar Mods/Addons

Game Version *

1.1.0 (CustomHotkeys-502-1-1-0-1637364409.zip)