Raised This Month: $ Target: $400
 0% 

[L4D2] Melee Range (2.1) [05-Nov-2024]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Plugin ID:
6740
Plugin Version:
2.1
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
    16 
    Plugin Description:
    Adjustable melee range for each melee weapon.
    Old 10-02-2019 , 15:35   [L4D2] Melee Range (2.1) [05-Nov-2024]
    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.


    Admin Commands: (requires "z" flag)

    PHP Code:
    sm_melee_range_reload // Reloads the Melee Weapon Range data config.
    sm_melee_range_set // Usage: sm_melee_range_set <melee script name - must exist in the config> <range>. Set the melee range (does not update the config). 

    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"

    // Melee Range plugin version.
    l4d2_melee_range_version 


    Changes:
    Code:
    2.1 (05-Nov-2024)
        - Fixed the "Tonfa" from "Riot" zombies, and possibly other melee weapons not being recognized when missing their script name.
    
    2.0 (21-Apr-2024)
        - Removed all the melee range cvars, now using a data config instead. Requested by "little_froy".
        - Added command "sm_melee_range_reload" to reload the data config.
        - Added command "sm_melee_range_set" to set a melee weapon range.
    
    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.
    3. Download the .cfg data file and put into your servers \addons\sourcemod\data\ 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 - 74 views - 14.9 KB)
    File Type: txt l4d2_melee_range.txt (1.0 KB, 1540 views)
    File Type: cfg l4d2_melee_range.cfg (975 Bytes, 233 views)
    __________________

    Last edited by Silvers; 11-05-2024 at 07:29.
    Silvers is offline
    Sev
    Veteran Member
    Join Date: May 2010
    Old 10-02-2019 , 18: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 , 09: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 09:47.
    hoanganh81097 is offline
    Silvers
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 02-04-2020 , 18: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 18:46.
    Silvers is offline
    Silvers
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 09-24-2020 , 14: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 , 19: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 , 19: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 20:54.
    Silvers is offline
    NoroHime
    Veteran Member
    Join Date: Aug 2016
    Location: bed
    Old 12-15-2021 , 17: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 , 19: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 , 16: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 11:22.


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