Left 4 Dead 2

Left 4 Dead 2

41 ratings
Sprint System (Vscript)
   
Award
Favorite
Favorited
Unfavorite
Game Content: Scripts
Game Modes: Single Player, Co-op
File Size
Posted
Updated
21.079 KB
4 Jul @ 2:31am
6 Jul @ 3:34am
3 Change Notes ( view )

Subscribe to download
Sprint System (Vscript)

In 1 collection by kurochama
Useful "Side-Dish" Mods (Especially for Bots)
47 items
Description
"If L4D1 tank can sprint when he's on fire, why not making a sprint feature for survivors too?"


Just a random idea coming out of the blue. I'm not sure if there's already a mod like this or not,because so far I have only ever seen a mod to randomize common infected's speed. But well, I just made it anyway :D .

This mod allows survivors to sprint by holding E (Use) & then press movement keys (A, W, S, D).

Q:"Isn't normal movement without holding SHIFT already a running movement?"
A:"Let's say that it's a normal run, not sprint. This mod makes survivors sprint."


List of features available on "sprint system.txt" cfg file:
  1. sprint_user: Who can use this (bots/ players/ all). For bots, they will sprint automatically, & when stamina hits 0, they will restore automatically.

  2. sprint_speed: How fast is the sprint speed. The value is a multiplier of the normal speed, & can be in decimals/ floats. Min= 1, max= no limit (you can go into saiyan mode by moving too fast when setting the value higher than 4, at your own risk :D ).

  3. max_stamina: Max stamina of each survivor. This will be decreased by 1 every 0.5 second when sprinting.

  4. allow_custom_button_for_sprint: Disabled by default. When disabled, E (Use) is used as the sprint button. When enabled, a custom cvar "kuro_sprint_mode" can be used. Bind this cvar to a key with alias on console, for example like this:
    bind = "sprint+" alias sprint+ "kuro_sprint_mode 1; bind = sprint-" alias sprint- "kuro_sprint_mode 0; bind = sprint+"


List of features available on "sprint system.txt" cfg file:
  • Hold E (Use) & then press any movement keys (A,W,S,D) to activate sprinting.

  • When "allow_custom_button_for_sprint" is set to 1, you need to bind a key with alias (follow the example on the feature above). When the bind on a key is set, it works as toggle on/off. It means that one press will activate sprint, & one more press to deactivate (like how flashlight works).

  • Sprinting speed is controlled by "sprint_speed"

  • Sprinting reduces stamina by 1 every 0.5 second. There will be notifications when stamina is low, & when stamina hits 0 or minus.

  • WHen stamina is 0 or minus, the movement speed is reduced to 50% when attempting to sprint. However, the speed will be back to normal (1x) when releasing E key.

  • Stamina can be restored every 1 second by releasing E. Crouching will greatly restore stamina (standing= +1 stamina/ second, sitting= +3 stamina/ second).

  • You can't jump properly when sprinting (Jump will be cancelled halfway). So, if you're sprinting, don't jump.

  • When bots are allowed to sprint, they will sprint automatically. & when their stamina hits 0, they will restore stamina automatically. Bot's movement penalty is disabled, so if they run out of stamina, they simply just move with 1x normal speed like usual.

  • *NEW*] a chat commandis available: "refresh sprint script". This chat command will re-launch the sprint script. Use this chat command in case if the sprint script stops working when loaded together with lots of mods at once, or in custom maps that heavily use lots of scripts that can make some mods stop working.


Ok, now it looks more like COD then... Well, but Squall said, "Whatever..." :D


CREDITS:
  • Postal: Running With Scissor logo.


NOTES:
  • This mod may be incompatible with mods that increase or decrease movement speed via vscripts.
32 Comments
Zaden 12 Aug @ 3:36pm 
@kurochama
May I ask, how did you manage to do it?! :O
I've been trying to do a vscript that would give you a speed boost (mine would be while you scoped-in), and yours is the only scrip that lets me do it :mbnecodown:
kurochama  [author] 13 Jul @ 8:13am 
@Wero !!! , the custom button works like flashlight. One press to activate, & another press to deactivate. & the formats on the alias must be like that on the example to set a toggle on/off on a button.
Wero !!! 13 Jul @ 6:42am 
@kurochama for some reason I can't stop running when I try to use the stop button
kurochama  [author] 12 Jul @ 7:48pm 
@Wero !!! , just write it on console like on the example. Another example by using "TAB":
bind tab "sprint+"
alias sprint+ "kuro_sprint_mode 1; bind tab sprint-"
alias sprint- "kuro_sprint_mode 0; bind tab sprint+"
Wero !!! 12 Jul @ 4:32pm 
I didn't understand how to change the buttons...
kurochama  [author] 10 Jul @ 11:54am 
@톰 , actually the value there is not on/ off but the number of ammo clip added. For example, if you set "Smg Ammo Clip" to 50, after reloading & shooting your first bullet, you'll get 99 ammo clip (50 + 50 - 1 bullet shot).
10 Jul @ 8:59am 
The number of bullets in the magazine.
I've used the "Merciless Bots" you mentioned
"More primary ammo clip" has only on and off
It is difficult to adjust the details of the numbers
Pwnage Peanut 8 Jul @ 5:54pm 
Rushers gonna rush
kurochama  [author] 8 Jul @ 7:52am 
@ 톰 , ammo clip, or reserve ammo? If it's reserve ammo, normally that can be done by changing some cvars related to certain guns, like "ammo_smg_max", "ammo_assault_rifle_max" etc. Even "Admin System" should be possible to modify these cvars.
If it's ammo clip, I already made that long time ago, but it's bundled with "Merciless Bots" mod as one of the features there.
8 Jul @ 7:30am 
I'm sorry, I was talking about the magazine capacity for local servers