Half-Life: Alyx

Half-Life: Alyx

Body Holsters
FrostEpex  [developer] 16 Feb @ 8:49pm
Custom Input Actions Guide
Using Custom Buttons

This guide explains how to use custom buttons for holstering and unholstering weapons. This is not required to use the Body Holsters addon as the addon will automatically set typical inputs based on your controller type.

If you have a controller that doesn't work well by default, please leave a comment with the controller you use and buttons you suggest should be default for that controller.

Due to the multitude of controllers and mappings, Body Holsters allows you to set custom input actions (buttons) for holstering/unholstering weapons.

In Half-Life Alyx, input actions can be categorized as either analog or digital. Analog inputs are continuous and can have varying degrees of engagement (e.g., trigger pull or hand curl), while digital inputs are discrete and have a simple on/off state (e.g., button press).

When configuring custom input actions, you must specify a numerical value that corresponds to the desired input action instead of using its name. Additionally, you must indicate whether the action is an analog input or a digital input using the "body_holsters_unholster_is_analog" and "body_holsters_holster_is_analog" convars. This is because some values are shared between analog and digital actions.

See "Input Actions and Values" at the bottom for a list of all available input actions and their corresponding values.

It is recommended to experiment in-game using the console commands to find the best controls for you, then add them to the hlvr config file so they will be automatically set every time the game sets.

To find the config file, right click Half-Life Alyx in your Steam library and go to "Manage > Browse local files" then navigate to "game\hlvr\cfg\" and open the "skill_hlvr.cfg" file. You can add your custom inputs right at the top of the file just as you would enter them in the console. See the next section for examples.




Examples using the default setups for each controller (please remember that these default examples are automatically set and do not need to be done manually):

Valve Index Controller
The Index controllers (Knuckles) use the analog Squeeze Xen Grenade action for unholstering and the analog Hand Curl action for holstering.
body_holsters_unholster_is_analog 1 body_holsters_unholster_action 2 body_holsters_holster_is_analog 1 body_holsters_holster_action 0 body_holsters_holster_ungrip_amount 0.5

HTC Vive Controller
The Vive controllers use the analog Hand Curl action for unholstering and the digital Slide Release action for holstering.
body_holsters_unholster_is_analog 1 body_holsters_unholster_action 0 body_holsters_holster_is_analog 0 body_holsters_holster_action 11

All Other Controllers
All other controllers use the analog Hand Curl action for unholstering and the analog Hand Curl action for holstering.
body_holsters_unholster_is_analog 1 body_holsters_unholster_action 0 body_holsters_holster_is_analog 1 body_holsters_holster_action 0

To mimic the old 'body_holsters_require_trigger_to_unholster' convar you can use the digital Fire action for unholstering.
body_holsters_unholster_is_analog 0 body_holsters_unholster_action 7

Input Actions and Values

You can see some more information about these values at https://developer.valvesoftware.com/wiki/Half-Life:_Alyx_Workshop_Tools/Scripting_API#Enumerations

Analog Input Actions
Name
Value
Hand Curl
0
Trigger Pull
1
Squeeze Xen Grenade
2
Teleport Turn
3
Continuous Turn
4

Digital Input Actions
Name
Value
Toggle Menu
0
Menu Interact
1
Menu Dismiss
2
Use
3
Use Grip
4
Show Inventory
5
Grav Glove Lock
6
Fire
7
Alt Fire
8
Reload
9
Eject Magazine
10
Slide Release
11
Open Chamber
12
Toggle Laser Sight
13
Toggle Burst Fire
14
Toggle Health Pen
15
Arm Grenade
16
Arm Xen Grenade
17
Teleport
18
Turn Left
19
Turn Right
20
Move Back
21
Walk
22
Jump
23
Mantle
24
Crouch Toggle
25
Stand Toggle
26
Adjust Height
27