Raised This Month: $1951 Target: $400
 487% 

[L4D1 & L4D2] Tank Barbecue [v1.0.4 | 13-July-2020]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Marttt
Senior Member
Join Date: Jan 2019
Plugin ID:
7176
Plugin Version:
1.0.4
Plugin Category:
Fun Stuff
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
    2 
    Plugin Description:
    Allows Tanks to spawn with burnt skin
    Old 06-29-2020 , 16:37   [L4D1 & L4D2] Tank Barbecue [v1.0.4 | 13-July-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%)
    • Control how fast the burn effect grows on burning Tanks. (z_burn_rate hidden cvar)
    • Restores the Tank's burn percent when it gets frustrated (pass the control).

    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"

    // How fast the burn effect grows on burning Tanks (changes the hidden cvar "z_burn_rate" value).
    // -
    // Default: "0.01"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d_tank_barbecue_burnrate "0.01"

    // % 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"

    // Restores the Tank's burn percent when it gets frustrated (pass the control).
    // 0 = Enable, 1 = Disable.
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d_tank_barbecue_restoreburn "1" 
    Related Game 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)

    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 => Prints the burnt skin percentage from the crosshair Tank. Also opens a menu to select an alive Tank and get its the burnt skin percentage. (z flag required)
    • sm_setburnpercent => Sets the burnt skin percentage from the crosshair Tank. Opens a menu to select an alive Tank and set its burnt skin percentage. (z flag required)

    Change Log

    Spoiler


    Known issues
    • Tank's skin changes might NOT work with custom models.
    • If a player controlling a Tank disconnects or changes team, the burn percent is reset (game behavior).

    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 the Tank spawning always 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.
    • Create a cvar to control the z_burn_rate cvar.

    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 - 56 views - 28.4 KB)
    __________________

    Last edited by Marttt; 07-13-2020 at 08:02. 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 10:34.


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