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

[L4D2] Melee Swing Speed (v1.3, 2023-7-27)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
HarryPotter
Veteran Member
Join Date: Sep 2017
Location: Taiwan, Asia
Plugin ID:
7657
Plugin Version:
1.3
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Adjustable melee swing rate for each melee weapon.
    Old 05-30-2021 , 01:21   [L4D2] Melee Swing Speed (v1.3, 2023-7-27)
    Reply With Quote #1

    -Convar-
    cfg/sourcemod/l4d2_melee_swing.cfg

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

    // 0=Value Default, The interval for swinging Baseball Bat. (clamped between 0.2 and 1.0)
    l4d2_melee_swing_baseball_bat_rate "0.75"

    // 0=Value Default, The interval for swinging Cricket Bat.(clamped between 0.2 and 1.0)
    l4d2_melee_swing_cricket_bat_rate "0.8"

    // 0=Value Default, The interval for swinging Crowbar. (clamped between 0.2 and 1.0)
    l4d2_melee_swing_crowbar_rate "0.8"

    // 0=Value Default, The interval for swinging Electric Guitar.(clamped between 0.2 and 1.0)
    l4d2_melee_swing_electric_guitar_rate "1.0"

    // 0=Value Default, The interval for swinging Fire Axe. (clamped between 0.2 and 1.0)
    l4d2_melee_swing_fireaxe_rate "1.0"

    // 0=Value Default, The interval for swinging Frying Pan. (clamped between 0.2 and 1.0)
    l4d2_melee_swing_frying_pan_rate "0.75"

    // 0=Value Default, The interval for swinging Golf Club. (clamped between 0.2 and 1.0)
    l4d2_melee_swing_golfclub_rate "0.75"

    // 0=Value Default, 1=Each melee rate unchanged, modify melee swinging rate multi when incapacitated. (ex. Use 'Incapped Weapons Patch by Silvers' to allow using Weapons while Incapped)
    l4d2_melee_swing_incapacitated_multi_rate "2.0"

    // 0=Value Default, The interval for swinging Katana. (clamped between 0.2 and 1.0)
    l4d2_melee_swing_katana_rate "0.8"

    // 0=Value Default, The interval for swinging Knife. (clamped between 0.2 and 1.0)
    l4d2_melee_swing_knife_rate "0.8"

    // 0=Value Default, The interval for swinging Machete.(clamped between 0.2 and 1.0)
    l4d2_melee_swing_machete_rate "0.8"

    // 0=Value Default, The interval for swinging Pitchfork. (clamped between 0.2 and 1.0)
    l4d2_melee_swing_pitchfork_rate "0.88"

    // 0=Value Default, The interval for swinging shovel. (clamped between 0.2 and 1.0)
    l4d2_melee_swing_shovel_rate "1.0"

    // 0=Value Default, The interval for swinging Tonfa. (clamped between 0.2 and 1.0)
    l4d2_melee_swing_tonfa_rate "0.75"

    // 0=Value Default, Custom Third Party Melee, The interval for swinging unknown melee weapon. (clamped between 0.2 and 1.0)
    l4d2_melee_swing_unknown_rate "0.0" 
    -Related plugin-
    -Source Code Download-
    Latest version always here
    __________________

    Last edited by HarryPotter; 07-27-2023 at 05:49.
    HarryPotter is offline
    Kid_Bandes
    Member
    Join Date: May 2010
    Old 05-30-2021 , 04:45   Re: [L4D2] Melee Swing Speed (v1.0, 2021-5-30)
    Reply With Quote #2

    Is this compatible with "Adrenaline & Pills Powerups"? Will they accumulate?
    Kid_Bandes is offline
    ddd123
    Senior Member
    Join Date: May 2021
    Old 05-30-2021 , 04:58   Re: [L4D2] Melee Swing Speed (v1.0, 2021-5-30)
    Reply With Quote #3

    Quote:
    Originally Posted by Kid_Bandes View Post
    Is this compatible with "Adrenaline & Pills Powerups"? Will they accumulate?
    It worked together
    Adrenaline effect give even more faster swing
    ddd123 is offline
    Kid_Bandes
    Member
    Join Date: May 2010
    Old 05-30-2021 , 05:09   Re: [L4D2] Melee Swing Speed (v1.0, 2021-5-30)
    Reply With Quote #4

    Thank ddd, good to know that, I will try, nice work HP!
    Kid_Bandes is offline
    HarryPotter
    Veteran Member
    Join Date: Sep 2017
    Location: Taiwan, Asia
    Old 05-30-2021 , 08:22   Re: [L4D2] Melee Swing Speed (v1.0, 2021-5-30)
    Reply With Quote #5

    Quote:
    Originally Posted by Kid_Bandes View Post
    Is this compatible with "Adrenaline & Pills Powerups"? Will they accumulate?
    depends on which one makes melee swing faster

    Adrenaline & Pills Powerups Improved Version
    PHP Code:
    // The interval for swinging melee weapon (clamped between 0.3 < 0.9)
    l4d_powerups_weaponmelee_rate "0.45" 
    __________________

    Last edited by HarryPotter; 05-30-2021 at 08:24.
    HarryPotter is offline
    Shao
    Senior Member
    Join Date: Jan 2015
    Old 09-01-2021 , 07:28   Re: [L4D2] Melee Swing Speed (v1.0, 2021-5-30)
    Reply With Quote #6

    The plugin has issues with downstate melee from Silvers, it doesn't transfer melee speeds and instead use defaults.
    Shao is offline
    Silvers
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 09-01-2021 , 15:57   Re: [L4D2] Melee Swing Speed (v1.0, 2021-5-30)
    Reply With Quote #7

    Quote:
    Originally Posted by Shao View Post
    The plugin has issues with downstate melee from Silvers, it doesn't transfer melee speeds and instead use defaults.
    Which plugin?



    @HarryPotter:
    I don't think the "tmrStart" stuff is necessary. Just reset the variables in "round_start" event and "OnMapEnd".

    You don't need "ResetPlugin" in "OnPluginEnd" since it's only resetting variables.

    "flGameTime" doesn't need to be a global bool since its only used in 1 function. Creating the variable each time is trivial and making it a global bool really doesn't optimize anything. But that's up to you.

    "char sBuffer[64];" in "Event_WeaponFire" shouldn't be 64 when you're only comparing a string that's 5 chars long. You can make this "char sBuffer[8];".

    Same as "char sBuffer[32];" in "OnWeaponSwitched" could be 16.

    In "OnGameFrame" you have "if (g_bCvarAllow == false || IsServerProcessing()==false || g_bIsLoading == true)" - you should process bools and ints first before using natives or comparing things which are more resource intensive, that way it's more optimized. So change it to "if (g_bCvarAllow == false || g_bIsLoading == true || IsServerProcessing()==false)".

    You may want to add support for "shield" and "unknown" since some 3rd party maps have their own melee weapons.
    __________________

    Last edited by Silvers; 09-01-2021 at 15:57.
    Silvers is offline
    HarryPotter
    Veteran Member
    Join Date: Sep 2017
    Location: Taiwan, Asia
    Old 09-02-2021 , 13:37   Re: [L4D2] Melee Swing Speed (v1.0, 2021-5-30)
    Reply With Quote #8

    Quote:
    Originally Posted by Silvers View Post
    @HarryPotter:
    I don't think the "tmrStart" stuff is necessary. Just reset the variables in "round_start" event and "OnMapEnd".

    You don't need "ResetPlugin" in "OnPluginEnd" since it's only resetting variables.

    "flGameTime" doesn't need to be a global bool since its only used in 1 function. Creating the variable each time is trivial and making it a global bool really doesn't optimize anything. But that's up to you.

    "char sBuffer[64];" in "Event_WeaponFire" shouldn't be 64 when you're only comparing a string that's 5 chars long. You can make this "char sBuffer[8];".

    Same as "char sBuffer[32];" in "OnWeaponSwitched" could be 16.

    In "OnGameFrame" you have "if (g_bCvarAllow == false || IsServerProcessing()==false || g_bIsLoading == true)" - you should process bools and ints first before using natives or comparing things which are more resource intensive, that way it's more optimized. So change it to "if (g_bCvarAllow == false || g_bIsLoading == true || IsServerProcessing()==false)".
    Thanks for your advice, I will update and optimize my code

    Quote:
    You may want to add support for "shield" and "unknown" since some 3rd party maps have their own melee weapons.
    "unknown" already there
    PHP Code:
    // 0=Value Default, Custom Third Party Melee, The interval for swinging unknown melee weapon. (clamped between 0.2 and 1.0)
    l4d2_melee_swing_unknown_rate "0.0" 
    __________________

    Last edited by HarryPotter; 09-02-2021 at 13:38.
    HarryPotter is offline
    Silvers
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 09-02-2021 , 14:13   Re: [L4D2] Melee Swing Speed (v1.1, 2021-9-3)
    Reply With Quote #9

    Oh I missed that while skimming through haha. Nice!
    __________________
    Silvers is offline
    Shao
    Senior Member
    Join Date: Jan 2015
    Old 09-15-2021 , 20:22   Re: [L4D2] Melee Swing Speed (v1.1, 2021-9-3)
    Reply With Quote #10

    @Silvers Took me a bit to get back here sorry! This one particularly. https://forums.alliedmods.net/showthread.php?t=322859
    Shao is offline
    Reply



    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 20:58.


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