Raised This Month: $32 Target: $400
 8% 

[L4D2] Melee Range (1.6) [11-Dec-2022]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Plugin ID:
6740
Plugin Version:
1.6
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
    4 
    Plugin Description:
    Adjustable melee range for each melee weapon.
    Old 10-02-2019 , 14:35   [L4D2] Melee Range (1.6) [11-Dec-2022]
    Reply With Quote #1

    Related Plugins:

    About:
    • Adjustable melee range for individual melee types.
    • Now supports setting the correct distance per client and melee type during simultaneous melee swings.


    Thanks:
    • xZk - For the idea and request.
    • hoanganh81097 - For testing version 1.2.


    Cvars:

    Saved to l4d2_melee_range.cfg in your servers \cfg\sourcemod\ folder.

    PHP Code:
    // 0=Plugin off, 1=Plugin on.
    l4d2_melee_range_allow "1"

    // Turn on the plugin in these game modes, separate by commas (no spaces). (Empty = all).
    l4d2_melee_range_modes ""

    // Turn off the plugin in these game modes, separate by commas (no spaces). (Empty = none).
    l4d2_melee_range_modes_off ""

    // Turn on the plugin in these game modes. 0=All, 1=Coop, 2=Survival, 4=Versus, 8=Scavenge. Add numbers together.
    l4d2_melee_range_modes_tog "0"

    // 70=Default. Range for Baseball Bat.
    l4d2_melee_range_weapon_baseball_bat "150"

    // 70=Default. Range for Cricket Bat.
    l4d2_melee_range_weapon_cricket_bat "150"

    // 70=Default. Range for Crowbar.
    l4d2_melee_range_weapon_crowbar "150"

    // 70=Default. Range for Electric Guitar.
    l4d2_melee_range_weapon_electric_guitar "150"

    // 70=Default. Range for Fire Axe.
    l4d2_melee_range_weapon_fireaxe "150"

    // 70=Default. Range for Frying Pan.
    l4d2_melee_range_weapon_frying_pan "70"

    // 70=Default. Range for Golf Club .
    l4d2_melee_range_weapon_golfclub "150"

    // 70=Default. Range for Katana.
    l4d2_melee_range_weapon_katana "150"

    // 70=Default. Range for Knife.
    l4d2_melee_range_weapon_knife "70"

    // 70=Default. Range for Machete.
    l4d2_melee_range_weapon_machete "120"

    // 70=Default. Range for Pitchfork.
    l4d2_melee_range_weapon_pitchfork "70"

    // 70=Default. Range for Shovel.
    l4d2_melee_range_weapon_shovel "80"

    // 70=Default. Range for Tonfa.
    l4d2_melee_range_weapon_tonfa "120"

    // 70=Default. Range for unknown melee weapons, 3rd party
    l4d2_melee_range_weapon_unknown "70"

    // Melee Range plugin version.
    l4d2_melee_range_version 


    Changes:
    Code:
    1.6 (11-Dec-2022)
        - Changes to fix compile warnings on SourceMod 1.11.
    
    1.5 (24-Sep-2020)
        - Compatibility update for L4D2's "The Last Stand" update.
        - Added support for the 2 new melee weapons.
        - Added 2 new cvars "l4d2_melee_range_weapon_pitchfork" and "l4d2_melee_range_weapon_shovel".
    
    1.4 (10-May-2020)
        - Added better error log message when gamedata file is missing.
        - Extra checks to prevent "IsAllowedGameMode" throwing errors.
    
    1.3 (01-Apr-2020)
        - Fixed "IsAllowedGameMode" from throwing errors when the "_tog" cvar was changed before MapStart.
    
    1.2 (05-Feb-2020)
        - Added cvar "l4d2_melee_range_weapon_unknown" for 3rd party melee weapons.
        - Changed melee detection method and setting of range.
        - Should no longer conflict with simultaneous melee swings and set the correct range per weapon.
        - Optimized cvars for faster CPU processing.
        - Now requires DHooks and gamedata file.
        - Compiled with SourceMod 1.10.
    
    1.1 (03-Oct-2019)
        - Increased string size to fix the plugin not working. Thanks to "xZk" for reporting.
    
    1.0 (02-Oct-2019)
        - Initial release.


    Requirements:

    Installation:
    1. Click "Get Plugin" and put the .smx file into your servers \addons\sourcemod\plugins\ folder.
    2. Download the .txt gamedata file and put into your servers \addons\sourcemod\gamedata\ folder.


    Updating from 1.4 or older:
    • New cvars have been added: use the Cvar Configs Updater, or delete the old cvars config or manually add them.
    • Now requires DHooks and new GameData file.
    Attached Files
    File Type: sp Get Plugin or Get Source (l4d2_melee_range.sp - 643 views - 13.8 KB)
    File Type: txt l4d2_melee_range.txt (1.0 KB, 1277 views)
    __________________

    Last edited by Silvers; 09-07-2023 at 22:06.
    Silvers is offline
    Sev
    Veteran Member
    Join Date: May 2010
    Old 10-02-2019 , 17:34   Re: [L4D2] Melee Range (1.0) [02-Oct-2019]
    Reply With Quote #2

    Very neat.

    Too bad about the riotshield. I assume adding that weapon requires some kind of script? I remember way back in the day it seemed like that weapon was a seen a lot more. Something must've changed.
    Sev is offline
    hoanganh81097
    Senior Member
    Join Date: Apr 2016
    Old 02-01-2020 , 08:45   Re: [L4D2] Melee Range (1.1) [03-Oct-2019]
    Reply With Quote #3

    my server has custom melee. I have to change frame 30 because animation of custom melee. But when i change this, other melee weapon was affected. Can you help me to change this for only custom melee
    sry my bad english

    Last edited by hoanganh81097; 02-01-2020 at 08:47.
    hoanganh81097 is offline
    Silvers
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 02-04-2020 , 17:46   Re: [L4D2] Melee Range (1.2) [05-Feb-2020]
    Reply With Quote #4

    Code:
    1.2 (05-Feb-2020)
        - Added cvar "l4d2_melee_range_weapon_unknown" for 3rd party melee weapons.
        - Changed melee detection method and setting of range.
        - Should no longer conflict with simultaneous melee swings and set the correct range per weapon.
        - Optimized cvars for faster CPU processing.
        - Now requires DHooks and gamedata file.
        - Compiled with SourceMod 1.10.
    Quite a big update now requires DHooks, supports 3rd party melee weapons, supports simultaneous swings correctly setting the range for each without any hackish method.
    __________________

    Last edited by Silvers; 02-04-2020 at 17:46.
    Silvers is offline
    Silvers
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 09-24-2020 , 13:49   Re: [L4D2] Melee Range (1.5) [24-Sep-2020]
    Reply With Quote #5

    Code:
    1.5 (24-Sep-2020)
    	- Compatibility update for L4D2's "The Last Stand" update.
    	- Added support for the 2 new melee weapons.
    	- Added 2 new cvars "l4d2_melee_range_weapon_pitchfork" and "l4d2_melee_range_weapon_shovel".
    __________________
    Silvers is offline
    PEK727
    Junior Member
    Join Date: Aug 2020
    Location: United States
    Old 09-26-2020 , 18:07   Re: [L4D2] Melee Range (1.5) [24-Sep-2020]
    Reply With Quote #6

    I've noticed an issue with all melee weapons. When you attack farther than the default melee range value it fails to play their respective hit sounds.
    PEK727 is offline
    Silvers
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 09-26-2020 , 18:11   Re: [L4D2] Melee Range (1.5) [24-Sep-2020]
    Reply With Quote #7

    Quote:
    Originally Posted by PEK727 View Post
    I've noticed an issue with all melee weapons. When you attack farther than the default melee range value it fails to play their respective hit sounds.
    Thanks, will fix and add them eventually.

    Edit: not sure how to go about this. Using games default range "70" the function sometimes says it hit when it didn't. Seems to emit sound but nothing can heard (using sound hook to check). The function doesn't return what's been hit and hooking every entity to detect seems overkill for what it's worth. The hit sound range is determined by the "melee_range" cvar so for example setting to 1000 will emit sound when hitting something far away even if the weapons range has been changed to 100 for example. Without being able to determine what's been hit or how far away, I cannot check if the sound should be emitted or not. Blocking the actual sound being emitted and re-emitting could work, but the hit world and hit flesh happen at different frames and somehow the game determines if the flesh or world sound should play and in this case you hear both world and flesh sound.
    __________________

    Last edited by Silvers; 09-26-2020 at 19:54.
    Silvers is offline
    NoroHime
    Veteran Member
    Join Date: Aug 2016
    Location: bed
    Old 12-15-2021 , 16:36   Re: [L4D2] Melee Range (1.5) [24-Sep-2020]
    Reply With Quote #8

    how game convar melee_range work?it is min range or scaled by proportionally to weapon? im confuses for choose cvar or plugins,i have idea to add melee range for Compensating delay
    __________________
    NoroHime is offline
    Silvers
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 12-15-2021 , 18:18   Re: [L4D2] Melee Range (1.5) [24-Sep-2020]
    Reply With Quote #9

    The convar melee_range affects all melee weapons. This plugin lets you customize the range for individual melee types.
    __________________
    Silvers is offline
    NoroHime
    Veteran Member
    Join Date: Aug 2016
    Location: bed
    Old 12-16-2021 , 15:06   Re: [L4D2] Melee Range (1.5) [24-Sep-2020]
    Reply With Quote #10

    looks melee_range is all melee shared range,but difference is swing route and swing speed,works great but plugins default 150 is over powered,also i cant measure it to a reasonable range
    __________________
    NoroHime 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 07:27.


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