Raised This Month: $2 Target: $400
 0% 

[L4D & L4D2] Tank Barbecue [v1.0.1 | 30-June-2020]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Marttt
Senior Member
Join Date: Jan 2019
Plugin ID:
7176
Plugin Version:
1.0.1
Plugin Category:
Fun Stuff
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Allows Tanks to spawn with burnt skin
    Old 06-29-2020 , 16:37   [L4D & L4D2] Tank Barbecue [v1.0.1 | 30-June-2020]
    Reply With Quote #1

    Description

    There is a game behavior that applies a skin change to Tanks, while on fire, that darkens it's skin from time to time. Check Preview image.

    This plugin:
    • Allows Tanks spawning with burnt skin. (Configurable chance and percentage burn)
    • Increases the maximum burnt skin value from 85% to 100%. (z_burn_max hidden cvar)
    • Bonus damage to Tanks based on the % amount of skin burned. (default: 0-10%)

    Some game-related cvars (thanks Lux):
    • z_burn_max => Max amount for the burn effect (default: 0.85)
    • z_burn_rate => How fast the burn effect grows on burning players (default: 0.01)

    Preview



    Cvars

    A configuration file named "l4d_tank_barbecue.cfg" will automatically be created for you upon the first run in the "\cfg\sourcemod\" folder.

    PHP Code:
    // Increases the hidden cvar "z_burn_max" to its maximum value (from default: 0.85, to: 1.00).
    // 0 = Enable, 1 = Disable.
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d_tank_barbecue_burnmax "1"

    // % chance of a Tank being spawn with burnt skin.
    // -
    // Default: "100.0"
    // Minimum: "0.000000"
    // Maximum: "100.000000"
    l4d_tank_barbecue_chance "100.0"

    // Damage bonus % multiplied by the percentage of Tank's burnt skin.
    // Formula: Damage + (Damage * Bonus/100 * Burn Percentage).
    // -
    // Default: "10.0"
    // Minimum: "-100.000000"
    // Maximum: "100.000000"
    l4d_tank_barbecue_dmgmultiplier "10.0"

    // Enables/Disables the plugin.
    // 0 = Enable, 1 = Disable.
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d_tank_barbecue_enabled "1"

    // Maximum random % of burn on Tank's skin.
    // -
    // Default: "100.0"
    // Minimum: "0.000000"
    // Maximum: "100.000000"
    l4d_tank_barbecue_maxpercent "100.0"

    // Minimal random % of burn on Tank's skin.
    // -
    // Default: "0.0"
    // Minimum: "0.000000"
    // Maximum: "100.000000"
    l4d_tank_barbecue_minpercent "0.0" 
    Admin Commands
    • sm_print_cvars_l4d_tank_barbecue => Prints the plugin related cvars and their respective values to the console. (z flag required)
    • sm_getburnpercent => Gets the percentage of burnt skin from the target Tank. (z flag required)
    • sm_setburnpercent => Sets the percentage of burnt skin from the target Tank. Opens a menu when no value is specified. (z flag required)

    Change Log

    Spoiler


    Notes
    • This effect was achieved by changing the Tank's m_burnPercent netprop value.
    • All classname player has this netprop but it only applies changes to the Tank skin.
    • The barbecue on plugin's name is because while the Tank is burning, the Tank's m_bbqPercent netprop value also changes. (but I didn't find any use for that, except for the plugin's name)
    • If you want to make the tank always look totally burnt out, set the following cvars: l4d_tank_barbecue_chance;l4d_tank_barbecue_minpercent;l4d_tank_barbecue_maxpercent to 100.

    To Do
    • Make the menu select automatically a Tank if there is only one spawned.

    Thank you!
    • Lux - for all your shared plugins that helped me a lot to make this one, and also for some help on this one.
    • Silvers - for all your shared plugins that helped me a lot to make this one.
    • Rain - for testing in his server.

    Related Plugins

    Post Reply
    • Any feedback, bug reports, fixes, improvements, translations or suggestions for the plugin are welcome.

    Installation
    • Put the "l4d_tank_barbecue.smx" file (click Get Plugin) in your "\addons\sourcemod\plugins\" folder.
    Attached Files
    File Type: sp Get Plugin or Get Source (l4d_tank_barbecue.sp - 32 views - 22.1 KB)
    __________________

    Last edited by Marttt; 06-30-2020 at 18:10. Reason: Allows Tanks to spawn with burnt skin
    Marttt is offline
    Lux
    Veteran Member
    Join Date: Jan 2015
    Location: Brexit
    Old 06-29-2020 , 16:45   Re: [L4D & L4D2] Tank Barbecue
    Reply With Quote #2

    Nice however pretty sure burn percentage is controled by these cvars
    Code:
    z_burn_max                               : 0.85     : , "sv", "launcher" : Max amount for the burn effect
    z_burn_rate                              : 0.01     : , "sv", "launcher" : How fast the burn effect grows on burning players
    Also with your current method using prethink, higher tickrates will make the effect happen quicker not really gamebreaking just something to look out for when making plugins use do stuff overtime perframe, GetGameTime() I usually use for effects over time.

    Goodjob code is nice to read
    __________________
    Lux is offline
    Marttt
    Senior Member
    Join Date: Jan 2019
    Old 06-29-2020 , 16:49   Re: [L4D & L4D2] Tank Barbecue
    Reply With Quote #3

    Thanks for the info Lux. Always pointing me the right direction. I will check and update the post/plugin after some analysis.
    __________________

    Last edited by Marttt; 06-30-2020 at 18:17.
    Marttt is offline
    Marttt
    Senior Member
    Join Date: Jan 2019
    Old 06-30-2020 , 18:17   Re: [L4D & L4D2] Tank Barbecue [v1.0.1 | 30-June-2020]
    Reply With Quote #4

    New version released (1.0.1).

    Code:
    1.0.1 (30-June-2020)
    - Added cvar for damage bonus.
    - Removed OnPreThink hook, replaced logic by default "z_burn_max" hidden cvar. (Thanks Lux for reporting)
    __________________
    Marttt 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:28.


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