AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [L4D2] Melee Range (2.0) [21-Apr-2024] (https://forums.alliedmods.net/showthread.php?t=318958)

Silvers 10-02-2019 14:35

[L4D2] Melee Range (2.0) [21-Apr-2024]
 
15 Attachment(s)
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.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.

Sev 10-02-2019 17:34

Re: [L4D2] Melee Range (1.0) [02-Oct-2019]
 
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.

hoanganh81097 02-01-2020 08:45

Re: [L4D2] Melee Range (1.1) [03-Oct-2019]
 
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 :D
sry my bad english

Silvers 02-04-2020 17:46

Re: [L4D2] Melee Range (1.2) [05-Feb-2020]
 
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.

Silvers 09-24-2020 13:49

Re: [L4D2] Melee Range (1.5) [24-Sep-2020]
 
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".


PEK727 09-26-2020 18:07

Re: [L4D2] Melee Range (1.5) [24-Sep-2020]
 
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.

Silvers 09-26-2020 18:11

Re: [L4D2] Melee Range (1.5) [24-Sep-2020]
 
Quote:

Originally Posted by PEK727 (Post 2719128)
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.

NoroHime 12-15-2021 16:36

Re: [L4D2] Melee Range (1.5) [24-Sep-2020]
 
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

Silvers 12-15-2021 18:18

Re: [L4D2] Melee Range (1.5) [24-Sep-2020]
 
The convar melee_range affects all melee weapons. This plugin lets you customize the range for individual melee types.

NoroHime 12-16-2021 15:06

Re: [L4D2] Melee Range (1.5) [24-Sep-2020]
 
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


All times are GMT -4. The time now is 16:33.

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