Half-Life: Alyx

Half-Life: Alyx

Sprint Button Mod
76 Comments
CementStairs  [author] 21 Nov, 2024 @ 4:07pm 
@chicken paste

You might want to use the "beta" version of the mod here:

https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2808938697

It has options for fully custom bindings or some straightforward binding presets.
In this case, you should be changing what buttons the script is tied to, rather than changing the bindings of the buttons themselves through SteamVR.

Take a look at the beta and let me know if you figured it out.
chicken paste 21 Nov, 2024 @ 1:34pm 
I'm not sure what you mean, am I not supposed to manually bind those on the left controller? I went into them and bound my left stick click to open inventory/eject mag so that sprint would work.
CementStairs  [author] 21 Nov, 2024 @ 1:30pm 
@chicken paste
Hi,
did you by any chance modify your SteamVR bindings for Alyx?

By default, the identical buttons on the other controller should not trigger the action as the other hand (such as, non-dominant hand's 'open inventory' button will not open inventory, but trigger crouch, if it is enabled). Though the changed bindings might affect this, so let me know.

You might also want to try different values listed on the wiki, as some of the actions share buttons, but not all are detected (for instance Arm Grenade and Toggle Health pen).
chicken paste 21 Nov, 2024 @ 1:03pm 
And yes it's on my non dominant hand. Using Quest 3.
chicken paste 21 Nov, 2024 @ 1:01pm 
If I use the bindings for inventory or mag eject the sprint function works but it also does those actions too, how do I stop that?
Skummeh 22 Oct, 2024 @ 1:18pm 
@Battlefeelz You can turn it off with sprint_hud_scale 0. Read the description.
Battlefeelz 22 Oct, 2024 @ 12:57pm 
WHY is there a dumb number attached to my wrist when theres already sound cues to let us know when we're runnning low on stamina?
Nekotaku 24 Sep, 2024 @ 6:16pm 
The UI needs to be better.
CementStairs  [author] 17 Feb, 2024 @ 4:20am 
@MacMashPotato

Apologies, Steam included the brackets as a part of the link.

Hey, you can use the "beta" (latest version) that is linked in the Customisation section: https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2808938697

It has a convar "sprint_control_disable_grip" just for that.
MacMashPotato 17 Feb, 2024 @ 1:14am 
@CementStairs

That link got flagged.
MacMashPotato 16 Feb, 2024 @ 4:35pm 
Is there a way to disable grip toggle of this mod so that only the button toggles it? i find it annoying that each time i use grip it toggles sprint.
CementStairs  [author] 30 Jan, 2024 @ 1:04am 
@TopCat

Indeed, I recommend to try the beta, because it should give you complete controls over your binds (while still offering some default options for the controls for easier changes).
TopCat 29 Jan, 2024 @ 3:23pm 
Had "hide file extensions" enable and kept renaming the "sprint_config.cfg" "sprint_config.cfg.txt" :steamfacepalm: thx team :cozyspaceengineersc:

On Quest 2 sprint is coupled with the "Adjust Height" button (left joystick press). Can disable "Adjust Height" and enable "Crouch" option instead. Your beta should give more options so to re-couple with another bind (not tested yet).
Angelminecart15 12 Jan, 2024 @ 5:51pm 
ah thanks
CementStairs  [author] 10 Jan, 2024 @ 3:14am 
@Floppa Friend!!

Hey,
if you want to change the default Sprint settings automatically, I recommend to make a .cfg file as it is described in the "Customisation" section of this mod's description.

In the .cfg file, you can add a single line "sprint_drain_speed 0" to set the stamina drain to zero, or you can increase the max stamina with "sprint_max_stamina X".
Angelminecart15 9 Jan, 2024 @ 7:44pm 
i cant access the console is something wrong? just wanna make the sprint never run out
xBrightShadows 31 Oct, 2023 @ 2:22pm 
Hello CementStairs,
Thanks for the help! Using "+hlvr_continuous_normal_speed X" is giving us the desired results. Except for low speeds, which are not being picked up at all. It seems like there might be some sort of threshold. We will try to find a fix, but maybe you already have an idea. You can also contact me on discord under marvinfachtner if you like.
CementStairs  [author] 31 Oct, 2023 @ 1:32pm 
@BrightShadow

Hello, if you wish to increase the player speed globally, you may do so by using the launch options "+hlvr_continuous_normal_speed X" and "+hlvr_continuous_combat_speed X" (with other launch options possibly helping further).

It might also be worth checking console variable such as "+vr_continuous_dampen_rate_...", which will likely have effect on the player's friction and movement.

The Sprint Button Mod allows for setting the speed multiplier as you wish using a customisable console variable "sprint_speed_multiplier" described above (by default it increases standard speed by 75%). You can set it to a fixed value (through the .cfg file) or you can change it dynamically during gameplay, so you could use information from your hardware and set this variable through console automatically.

For the most up-to-date version with more customisation options, see the latest beta of this mod here: https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2808938697
xBrightShadows 31 Oct, 2023 @ 12:49am 
Hello CementStairs!
I have developed a new type of omnidirectional treadmill for VR. I'm very excited that the tracking is finally working and with our emulator, we can walk and run in basically every VR game.
But of course, we can't have a 1:1 analog velocity translation from the real-world velocity to the in-game velocity. We can control the velocity pretty accurately from 0 to full walking speed, if the game has continuous movement.
We can also automatically activate the sprinting, but this jump in velocity is obviously not how it happens in reality. So in order to solve this problem, we should simply need to change the maximum in-game walking speed. Do you think this would be possible for you to do?
Please send me a message, If you are interested in developing a Half Life Alyx mod for this purpose.
You can also find me on Discord under marvinfachtner or send a mail to marvin@xelerate-vr.com.
moong lol 26 Sep, 2023 @ 3:45pm 
its insane they didnt add this in the vanilla game major oversight
ceasersalad. 21 Sep, 2023 @ 8:37pm 
lol sorry just found that out
CementStairs  [author] 19 Sep, 2023 @ 8:30am 
@schidto

That already exists in base game.
ceasersalad. 18 Sep, 2023 @ 2:31pm 
need crouch button
Cubenmaker 14 Mar, 2023 @ 4:01am 
Can't seem to re-find your last comment to respond. There seems to be too many places where messages go here on Steam. Your menu thing looks really cool. How did you learn all this stuff?
Cubenmaker 13 Mar, 2023 @ 8:50pm 
If a player running my addon has already increased speed in the Launch Options, then I increase it again with speedmod, it will be too fast. I have no sense of how many players might do this. I can think of three options.

1. Start with a message suggesting the player disable Launch Option speed before running my addon. This is crude, but foolproof.

2. Access the hlvr_continuous_normal_speed variable in game, say with a script, and set the speedmod accordingly. Maybe you know if this is possible.

3. Have an in game menu where the user can set the speed. I can't see how to customise the Alyx menu. I can place a menu in front of the player, but don't know how to access it. How do you access the controller button in your addon? Or I could create a tablet model with buttons acting as a menu stored in the wrist holder. But I can't see how to create a model with functional buttons. I guess I could parent a button to a model and get the same result.

What do you think?
Cubenmaker 13 Mar, 2023 @ 8:41pm 
I tried out the player_speedmod and it works beautifully. Thanks so much! I've been using Launch Options "+hlvr_continuous_normal_speed" and this works, but there are three issues with it . The user has to exit the addon and set the speed under Launch Options, two is you can't set it in game, and third it works poorly going up steep stairs, as you can run through them. Interestingly, the speedmod method works perfectly going up steep stairs and you even hear the sound of each stair footfall. No problem diving through the stairs even going quite fast. So this is much better.
Cubenmaker 13 Mar, 2023 @ 2:48pm 
Will do. You've been very helpful in the past, and there's still a lot I don't know.
CementStairs  [author] 13 Mar, 2023 @ 10:36am 
@Cubenmaker

No problem, feel free to ask if you need help with anything else.
Cubenmaker 13 Mar, 2023 @ 4:11am 
You're right. I'll do some experimenting with the entity. Thanks again for your help and the quick replies.
CementStairs  [author] 13 Mar, 2023 @ 12:18am 
@Cubenmaker

Yes, it can be changed instantly (or if you at some point wanted to do it gradually, you could just code that in with VScript). Just like in this mod.

I really recommend to try the entity for yourself, in order to see how it functions. That would be the best way to get familiar with it.
Cubenmaker 12 Mar, 2023 @ 4:40pm 
Thanks. The documentation I found says this entity varies speed over time. Does this just mean there is a period of acceleration as the speed varies from one speed to another and then it stays at the new speed? If this is the case then I'm confused as to why the rate of acceleration isn't mentioned. Or does it mean as the player starts moving the speed starts out slow and speeds up to a maximum, and does this every time the player moves. This would not work for my purposes.

I need to change the speed to a fixed value instantly (or close to it) and have it stay there, even when the player begins moving. I basically just want to replicate the effect of changing movement speed in the launch options, but on demand in game. Will this entity do that?
CementStairs  [author] 12 Mar, 2023 @ 5:45am 
@Cubenmaker

"player_speedmod" is just a Hammer entity, like any other. It exists in all of Alyx, but if you want to use it in Hammer, you need to enable it in the FGD(as described below). This means that it will work for everyone using your mod - in the same way this Sprint Button Mod works for all mods. It's just a matter of seeing it in the tools or not.
Cubenmaker 12 Mar, 2023 @ 4:21am 
Thanks for the reply. I want to be able to change the speed for an addon that can be run by anybody. If a file needs to be modified, then it sounds like this has to be done on each system. In other words it looks like the player of my addon would have to make this change on their own system, which would not be practical. Do I have this right? I already have instructions with my addon as to how to set the speed under the launch options, but this is not a great solution. I was hoping your solution could be done by my addon without the player having to even know about it and so it would only affect my addon while someone is playing it.
CementStairs  [author] 12 Mar, 2023 @ 12:35am 
@Cubenmaker

Hey,

The speed can be changed on-the-fly using the "player_speedmod" entity. This entity isn't normally enabled, so you'll have to find your "hlvr.fgd" file and add "//" behind "@exclude player_speedmod".

You can also change the speed permanently by using these game launch commands: +hlvr_continuous_normal_speed 200 +hlvr_continuous_combat_speed 200
Cubenmaker 11 Mar, 2023 @ 9:29pm 
I thought there was no way to change walking speed in game. Do you have a script or something that I could get? I was hoping to be able to change speed through a script call from a trigger. Is this possible?
CementStairs  [author] 3 Mar, 2023 @ 7:04am 
@Lexica

Hey,

even if the mod and Scalable Init Support are active in the Addons menu, you should make sure you started the campaign with the "Start Game with Addons" button. It might also be necessary to have the addon active prior to creating new game(saveslot).

Now if that is the case and the mod is positively running (which you can verify by opening the console and typing any of the customisation commands mentioned on this page; which isn't necessary, it's only a way to be completely sure it's running), then indeed the binding on Vive can be a bit different.

If none of the available buttons activate the sprint, then I'd direct you to the "beta" version of this mod (it is an update with more customisation options, which should be completely stable, but I haven't tested it as extensively as this one), which has more presets for activating the sprint.

You can check it here: https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2808938697
The Lexica 2 Mar, 2023 @ 4:35pm 
Has this been tested with the original Vive controllers? I can't seem to get it working, even with only it and it's dependency active.
White Male 22 Feb, 2023 @ 5:37am 
But the mod does not work for me while using the crowbar mod.
I use your mod instead of crowbar, since sprinting is a must, yet this game really lacks melee.
White Male 22 Feb, 2023 @ 3:26am 
Thank you for finishing a part of this game, that the devs could not grasp to make.
CementStairs  [author] 24 Jan, 2023 @ 6:04am 
No problem, thanks for trying the mod out!
greeyv 23 Jan, 2023 @ 4:08pm 
@CementStairs

Thanks I was able to figure it out
I knew the folders looked wrong, I didn't realize I just needed to make a .txt file then change it to .cfg
Thanks again!
CementStairs  [author] 22 Jan, 2023 @ 2:46am 
@greeyv

Hey!

You should create a file called "sprint_config.cfg" instead of a folder , in the "...\game\hlvr\cfg\" directory. You can open and edit it with a regular notepad like a normal .txt file.

NOTE: Make sure you don't have file extensions hidden in Windows. Otherwise you could be creating "sprint_config.cfg.txt" which would not work.

Apart from that, format you've mentioned is correct. You simply type the command and then the value next to it: "sprint_hud_scale 0.1" should be written in the file.

There should also be only one command per line.
greeyv 22 Jan, 2023 @ 2:14am 
Hey I'm trying to make the config option permanent, I noticed when I change the hud size, it reverts back to the default the next time a new area is loaded.

So I tried going into the game files '\Half-Life Alyx\game\hlvr\cfg\ '
I made a folder called 'sprint_config.cfg ' but I'm not sure how to add the config options to that, I'm sure I'm doing something wrong here, do I just add folders and name them the config options like "sprint_hud_scale 0.1" ?
Thanks

Also great mod, I was hating not having a sprint button, how could valve not add it as a default? Luckily was only on chapter 3 when I found your mod so wont have to redo too much. Thanks!
Shrimps 30 Dec, 2022 @ 4:58pm 
So tried it with a new workshop map and works just fine. Thank you so much for this.

For some reason on Quest 2 the eject mag button on the off hand doesn't trigger it, but I am glad that its a toggle and not a hold to press on the off hand stick. True on the Quest 2 pressing that brings you in and out of a supposed crouch. But standing straight up the crouch button does almost nothing noticeable and I quickly learned just to give it a double click if I have to. Honestly I just leave the sprint mode on all the time and don't have to think about it anymore.

Thanks again.
Shrimps 28 Dec, 2022 @ 9:04am 
Ah ok. So I do need to start a new game. I guess I'll try that later after I'm done with current campaign. Looking forward to sprinting. Thanks.
CementStairs  [author] 28 Dec, 2022 @ 1:32am 
Hey,

when you're starting a new game, press the "Start Game with Addons", otherwise no mods are allowed in the campaign.

If it's an issue with Quest 2 button-layout, then you can use the extended version of this mod here: https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2808938697

It allows you to either straight-up enable specific buttons to activate sprinting, or you can bind the sprint to any button you want.
Shrimps 27 Dec, 2022 @ 4:05pm 
Not working with my Quest 2. Tried both stick toggle and mag eject in off hand and neither makes me sprint. Do I need to start a fresh game for this to work?

I didn't mind the slow speed before but after finishing Half Life 2 VR Mod this game became insanely slow for me :D
Ookami 14 Dec, 2022 @ 12:32pm 
I think I'll turn the sprint limit off. It's one of my most hated mechanics in games
BAD 3RIP 9 Dec, 2022 @ 4:09pm 
Thank you very much for this great mod it's really a game changer stuff :D
CementStairs  [author] 2 Dec, 2022 @ 7:19am 
@pacmanproductionsz27

Hey,

if you wish to customise the Sprint in any way, feel free to read above in the "Customisation" section on this Workshop page. It allows you to change practically anything about the function of the Sprint, from binding to the amount of speed you gain or in your case - how long the sprint lasts.