Raised This Month: $12 Target: $400
 3% 

[L4D & L4D2] Costly Sprint / Dash v2.2 [22-December-2022]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
NoroHime
Veteran Member
Join Date: Aug 2016
Location: bed
Plugin ID:
8277
Plugin Version:
2.2
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
Servers with this Plugin:
1 
Plugin Description:
hold Shift to sprint like another game or double tap move key, here comes costly.
Old 11-09-2022 , 05:53   [L4D & L4D2] Costly Sprint / Dash v2.2 [22-December-2022]
Reply With Quote #1

about
  • hold Shift to sprint like another game, or double tap the forward key
  • consume the health if keep dashing or use stamina
  • wont consume if under adrenaline duration
  • dashing sounds (l4d2 only)
  • stop dashing when health gets lower than value

ConVar

PHP Code:
// hurt survivor even he under adrenaline duration
costly_sprint_ache_adren "0"

// damage to hurt survivor every interval, less than 1 will be randomly
costly_sprint_ache_amount "2.0"

// interval(seconds) of hurt survivor when keep dashing
costly_sprint_ache_interval "1.0"

// boost rate of dashing
costly_sprint_boost "1.5"

// stop dashing when health under this value
costly_sprint_limp "4.0"

// boost mode 0=L4D_OnGet*TopSpeed(more compatibility)
// 1=m_flLaggedMovementValue(most smoothly, only suggest on *_tap 1)
costly_sprint_mode "0"

// does play dash sound for dashing
costly_sprint_sound "1"

// duration(seconds) of stamina mode, set duration use stamina mode to instead ache mode
costly_sprint_stamina "0"

// factor to scale speed when used up stamina during penelty
costly_sprint_stamina_penalty_rate "0.5"

// stamina progress bar position, 1=center text 2=hint text 0=disabled
costly_sprint_stamina_progress "1"

// stamina recovery rate
costly_sprint_stamina_recovery_rate "0.5"

// method to trigger dash 0=shift+move key 1=double tap move key
costly_sprint_tap "0"

// interval(seconds) to trigger double tap
costly_sprint_tap_interval "0.3" 

changelog
  • v1.0 just releases; 9-November-2022
  • v1.1
    new ConVar *_mode to control boost work way, more compatible or smoothy,
    new ConVar *_tap to control how to trigger dash, shift+MoveKey or double tap forward key,
    add support "[L4D & L4D2] Lagged Movement" if set *_mode to 1 ; 13-November-2022
  • v1.1.1 fix *_limp no work proper, optimize code more robust thanks to Silvers; 13-November-2022 (2nd time)
  • v1.2
    new ConVar *_tap_interval to control interval time between double tap forward key,
    make damage randomly if *_ache_amount less than 1; 14-November-2022
  • v2.0 new features, fixes:
    - new Stamina mode, to instead hurt mode, if stamina used up, survivor speed gets down:
    - new ConVar *_stamina to control max stamina duration, if set then use stamina mode
    - new ConVar *_stamina_penalty_rate to control panalty move speed,
    - new ConVar *_stamina_progress to print stamina progress text position,
    - new ConVar *_stamina_recovery_rate to scale stamina recovery ratio,
    - ConVars *_ache_* also control the stamina mode,
    - fix key not detecting on incapped,
    - fix double tap mode not work,
    - remove ConVar *_sound_delay,
    - double tap mode now can accept any move key,
    - simplify codes, remove useless sounds because they sounds same,
    - uploaded translation file for stamina mode; 13-December-2022
  • v2.0.1 optimizes:
    - optimize double tap logic,
    - clear state when player unavailable; 13-December-2022 (2nd time)
  • v2.1 new features:
    - new Command +dash -dash let player work on "bind shift +dash"; 21-December-2022
  • v2.2 fixes:
    - add Command sm_dashstart, sm_dashstop for dedicated server,
    - fix dash command wrong speed on *_tap == 0,
    - when set _ache_adren as 0, adrenaline state will ignore *_limp; 22-December-2022

Installation
Attached Thumbnails
Click image for larger version

Name:	stamina mode.jpg
Views:	465
Size:	74.5 KB
ID:	198472  
Attached Files
File Type: sp Get Plugin or Get Source (l4d_costly_sprint.sp - 503 views - 19.1 KB)
File Type: txt l4d_costly_sprint.phrases.txt (98 Bytes, 314 views)
__________________

Last edited by NoroHime; 12-21-2022 at 18:45.
NoroHime is offline
little_froy
Senior Member
Join Date: May 2021
Old 11-09-2022 , 10:35   Re: [L4D & L4D2] Costly Sprint / Dash v1.0 [9-November-2022]
Reply With Quote #2

i assume if use OnPlayerRunCmd, you can deny shift buttons effect by buttons &= ~IN_SPEED and make it more smoothly.
little_froy is offline
NoroHime
Veteran Member
Join Date: Aug 2016
Location: bed
Old 11-09-2022 , 11:50   Re: [L4D & L4D2] Costly Sprint / Dash v1.0 [9-November-2022]
Reply With Quote #3

Quote:
Originally Posted by little_froy View Post
i assume if use OnPlayerRunCmd, you can deny shift buttons effect by buttons &= ~IN_SPEED and make it more smoothly.
i was try it, but something other plugin or game behavior still need shift key, so for the compatibility here.
and when remove the IN_SPEED, movement will causes screen stuttering, i guess this problem from Network Latency Prediction.
in comparison, L4D_OnGetWalkTopSpeed work not bad here.

the alternative solution is using NetProp m_flLaggedMovementValue, but it causes stuttering at dashing stop, and some jump to air problem,
i was seen Silvers fix that problem on [L4D & L4D2] Weapons Movement Speed, im trying learn from that :C
__________________

Last edited by NoroHime; 11-09-2022 at 11:57.
NoroHime is offline
NoroHime
Veteran Member
Join Date: Aug 2016
Location: bed
Old 11-13-2022 , 05:21   Re: [L4D & L4D2] Costly Sprint / Dash v1.1 [13-November-2022]
Reply With Quote #4

update, now smoothy movement work no bad when set *_mode 1 and *_tap 1

Quote:
PHP Code:
// boost mode 0=L4D_OnGetWalkTopSpeed(more compatibility)
// 1=m_flLaggedMovementValue(most smoothly, only suggest on *_tap 1)
costly_sprint_mode "0"

// method to trigger dash 0=shift+move key 1=double tap W
costly_sprint_tap "0"

// interval(seconds) to trigger double tap
costly_sprint_tap_interval "0.3" 

changelog
  • v1.1
    new ConVar *_mode to control boost work way, more compatible or smoothy,
    new ConVar *_tap to control how to trigger dash, shift+MoveKey or double tap forward key,
    add support "[L4D & L4D2] Lagged Movement" if set *_mode to 1 ; 13-November-2022
  • v1.1.1 fix *_limp no work proper, optimize code more robust thanks to Silvers; 13-November-2022 (2nd time)
  • v1.2
    new ConVar *_tap_interval to control interval time between double tap forward key,
    make damage randomly if *_ache_amount less than 1; 14-November-2022

Installation
__________________

Last edited by NoroHime; 11-14-2022 at 15:14.
NoroHime is offline
NoroHime
Veteran Member
Join Date: Aug 2016
Location: bed
Old 12-12-2022 , 15:47   Re: [L4D & L4D2] Costly Sprint / Dash v2.0 [13-December-2022]
Reply With Quote #5

finally updated stamina mode, to instead hurt mode, if stamina used up, survivor speed gets down
Quote:

ConVar

PHP Code:
// duration(seconds) of stamina mode, set duration use stamina mode to instead ache mode
costly_sprint_stamina "0"

// factor to scale speed when used up stamina during penelty
costly_sprint_stamina_penalty_rate "0.5"

// stamina progress bar position, 1=center text 2=hint text 0=disabled
costly_sprint_stamina_progress "1"

// stamina recovery rate
costly_sprint_stamina_recovery_rate "0.5" 
changelog
  • v2.0 new features, fixes:
    - new Stamina mode, to instead hurt mode, if stamina used up, survivor speed gets down:
    - new ConVar *_stamina to control max stamina duration, if set then use stamina mode
    - new ConVar *_stamina_penalty_rate to control panalty move speed,
    - new ConVar *_stamina_progress to print stamina progress text position,
    - new ConVar *_stamina_recovery_rate to scale stamina recovery ratio,
    - ConVars *_ache_* also control the stamina mode,
    - fix key not detecting on incapped,
    - fix double tap mode not work,
    - remove ConVar *_sound_delay,
    - double tap mode now can accept any move key,
    - simplify codes, remove useless sounds because they sounds same,
    - uploaded translation file for stamina mode; 13-December-2022
  • v2.0.1 optimizes:
    - optimize double tap logic,
    - clear state when player unavailable; 13-December-2022 (2nd time)
  • v2.1 new features:
    - new Command +dash -dash let player work on "bind shift +dash"; 21-December-2022
  • v2.2 fixes:
    - add Command sm_dashstart, sm_dashstop for dedicated server,
    - fix dash command wrong speed on *_tap == 0,
    - when set _ache_adren as 0, adrenaline state will ignore *_limp; 22-December-2022


Installation
  • optional put l4d_costly_sprint.phrases on /translations/
Attached Thumbnails
Click image for larger version

Name:	stamina mode.jpg
Views:	140
Size:	74.5 KB
ID:	198471  
__________________

Last edited by NoroHime; 12-21-2022 at 12:30.
NoroHime is offline
Zonehxoz
New Member
Join Date: Dec 2022
Old 12-26-2022 , 19:09   Re: [L4D & L4D2] Costly Sprint / Dash v2.2 [22-December-2022]
Reply With Quote #6

It's a bit weird having to see someone "sprint" while using the walking animation though, would be nice if it was just the normal running animation instead, i know it doesn't matter as much in firstperson but in thirdperson looks kinda meh, either way pretty neat sprinting system though.
Zonehxoz is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:23.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode