AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [L4D1 & L4D2] Stagger Tank on Hit [v1.0.5 | 20-November-2021] (https://forums.alliedmods.net/showthread.php?t=335069)

Marttt 11-06-2021 09:59

[L4D1 & L4D2] Stagger Tank on Hit [v1.0.5 | 20-November-2021]
 
44 Attachment(s)
Description

This plugin staggers (explosive ammo effect) the Tank while using explosive ammo, like the other SI.

Features
  • Allow configuring which weapon should stagger.
  • Allow configuring the chance per ammo type. (NORMAL|EXPLOSIVE|INCENDIARY)
  • Allow configuring the chance while shoving.
  • Allow configuring the chance per weapon type.
  • Allow Tank to use his throw ability without staggering him.
  • Allow configuring how many times can be staggered.
  • Allow configuring an interval to be staggered again.

Cvars

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

PHP Code:

// Allow to stagger the Tank while using his throw ability.
// 0 = OFF, 1 = ON.
// -
// Default: "0"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d_stagger_tank_ability_throw "0"

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

// How many times the Tank can be staggered by the plugin.
// 0 = OFF.
// -
// Default: "0"
// Minimum: "0.000000"
l4d_stagger_tank_limit "0"

// How long (seconds) should wait to be able to stagger the Tank again.
// 0 = OFF.
// -
// Default: "0.0"
// Minimum: "0.000000"
l4d_stagger_tank_wait "0.0" 

Data file (data/l4d_stagger_tank.cfg)
PHP Code:

// Attributes explained:
//  "enable"     -> Enable stagger. "0" = Disable, "1" = Enable.
//  "normal"     -> Chance (1%-100%) to stagger in any hit. "0" = OFF.
//  "explosive"  -> Chance (1%-100%) to stagger by explosive ammo. L4D2 only. "0" = OFF.
//  "incendiary" -> Chance (1%-100%) to stagger by incendiary ammo. L4D2 only. "0" = OFF.
//  "shove"      -> Chance (1%-100%) to stagger by shoving. "0" = OFF.

"l4d_stagger_tank"
{
    
"default"
    
{
        
"enable"       "1"
        "normal"       "0"
        "explosive"    "100"
        "incendiary"   "0"
        "shove"        "0"
    
}

    
"classnames"
    
{
        
// Primary Weapons - Slot 1
        // Tier 1
        // SMGs
        
"weapon_smg"
        
{
            
"enable"       "1"
        
}
        
"weapon_smg_silenced"
        
{
            
"enable"       "1"
        
}
        
"weapon_smg_mp5"
        
{
            
"enable"       "1"
        
}
        
// Shotguns
        
"weapon_pumpshotgun"
        
{
            
"enable"       "1"
        
}
        
"weapon_shotgun_chrome"
        
{
            
"enable"       "1"
        
}

        
// Tier 2
        // Rifles
        
"weapon_rifle"
        
{
            
"enable"       "1"
        
}
        
"weapon_rifle_desert"
        
{
            
"enable"       "1"
        
}
        
"weapon_rifle_ak47"
        
{
            
"enable"       "1"
        
}
        
"weapon_rifle_sg552"
        
{
            
"enable"       "1"
        
}
        
// Shotguns
        
"weapon_autoshotgun"
        
{
            
"enable"       "1"
        
}
        
"weapon_shotgun_spas"
        
{
            
"enable"       "1"
        
}
        
// Snipers
        
"weapon_hunting_rifle"
        
{
            
"enable"       "1"
        
}
        
"weapon_sniper_military"
        
{
            
"enable"       "1"
        
}
        
"weapon_sniper_scout"
        
{
            
"enable"       "1"
        
}
        
"weapon_sniper_awp"
        
{
            
"enable"       "1"
        
}

        
// Tier 3
        
"weapon_rifle_m60"
        
{
            
"enable"       "1"
        
}
        
"weapon_grenade_launcher"
        
{
            
"enable"       "1"
        
}
        
"grenade_launcher_projectile"
        
{
            
"enable"       "1"
        
}

        
// Secondary Weapons - Slot 2
        // Pistols
        
"weapon_pistol"
        
{
            
"enable"       "0"
        
}
        
"weapon_pistol_magnum"
        
{
            
"enable"       "0"
        
}

        
// Miniguns
        
"prop_minigun"
        
{
            
"enable"       "0"
        
}
        
"prop_mounted_machine_gun"
        
{
            
"enable"       "0"
        
}
        
"prop_minigun_l4d1"
        
{
            
"enable"       "0"
        
}

        
// Carryables
        
"weapon_gnome"
        
{
            
"enable"       "0"
        
}
        
"weapon_cola_bottles"
        
{
            
"enable"       "0"
        
}

        
// Melees - Slot 2
        
"weapon_chainsaw"
        
{
            
"enable"       "0"
        
}
        
"weapon_melee"
        
{
            
"enable"       "0"
        
}

        
// Infected
        
"tank_rock"
        
{
            
"enable"       "1"
            "normal"       "100"
        
}
        
"weapon_tank_claw"
        
{
            
"enable"       "1"
            "normal"       "100"
        
}
        
"weapon_smoker_claw"
        
{
            
"enable"       "0"
        
}
        
"weapon_boomer_claw"
        
{
            
"enable"       "0"
        
}
        
"weapon_hunter_claw"
        
{
            
"enable"       "0"
        
}
        
"weapon_spitter_claw"
        
{
            
"enable"       "0"
        
}
        
"weapon_jockey_claw"
        
{
            
"enable"       "0"
        
}
        
"weapon_charger_claw"
        
{
            
"enable"       "0"
        
}

        
"infected"
        
{
            
"enable"       "0"
        
}
        
"witch"
        
{
            
"enable"       "0"
        
}
    }

     
// "weapon_melee" must be "enabled" set to "1"
    
"melees"
    
{
        
"fireaxe"
        
{
            
"enable"       "0"
        
}
        
"frying_pan"
        
{
            
"enable"       "0"
        
}
        
"machete"
        
{
            
"enable"       "0"
        
}
        
"baseball_bat"
        
{
            
"enable"       "0"
        
}
        
"crowbar"
        
{
            
"enable"       "0"
        
}
        
"cricket_bat"
        
{
            
"enable"       "0"
        
}
        
"tonfa"
        
{
            
"enable"       "0"
        
}
        
"katana"
        
{
            
"enable"       "0"
        
}
        
"electric_guitar"
        
{
            
"enable"       "0"
        
}
        
"knife"
        
{
            
"enable"       "0"
        
}
        
"golfclub"
        
{
            
"enable"       "0"
        
}
        
"pitchfork"
        
{
            
"enable"       "0"
        
}
        
"shovel"
        
{
            
"enable"       "0"
        
}
        
"riotshield"
        
{
            
"enable"       "0"
        
}
    }


Admin Commands
  • sm_print_cvars_l4d_stagger_tank => Print the plugin related cvars and their respective values to the console. (z flag required)

Change Log

Spoiler


Notes
  • Grenade Launcher has the "explosive ammo" attribute as a default damage type (game design).
  • INCENDIARY and EXPLOSIVE ammo only exist on L4D2.

To Do
  • Add client flag to config.
  • Add others SI to config.
  • Add laser sights config.

Thank you!

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

Requirements

Installation
  • Put the "l4d_stagger_tank.cfg" file in your "\addons\sourcemod\data\" folder.
  • Put the "l4d_stagger_tank.smx" file (click Get Plugin) in your "\addons\sourcemod\plugins\" folder.

Tonblader 11-07-2021 11:12

Re: [L4D1 & L4D2] Stagger Tank on Hit [v1.0.0 | 06-November-2021]
 
I like the idea of this plugin, tell me, is it possible that also the survivors among themselves can also have a different % sucessful?

It would be fun to see how several survivors with melee weapons a attack a single tank and push each other, both the tank and the survivors

Also, I do not know if it is correct to ask for this here, but seeing that the AWP and Scout are not really useful other than a skeet, could you make these weapons have defined that they are always explosive or incendiary ammunition?

Maur0 11-07-2021 17:44

Re: [L4D1 & L4D2] Stagger Tank on Hit [v1.0.0 | 06-November-2021]
 
Thank you! :)

Marttt 11-07-2021 19:06

Re: [L4D1 & L4D2] Stagger Tank on Hit [v1.0.0 | 06-November-2021]
 
Quote:

Originally Posted by Tonblader (Post 2762749)
.

Yes is possible but I personally don't like the idea and won't implement it now.

Anyway, you can edit the OnTakeDamage part from the plugin and implement it by yourself.

By now I only support Tank, maybe in the future I can expand it to all SI/survivors.

Tonblader 11-07-2021 21:16

Re: [L4D1 & L4D2] Stagger Tank on Hit [v1.0.0 | 06-November-2021]
 
Quote:

Originally Posted by Marttt (Post 2762792)
.

Understandable, in the meantime maybe I can add an individual % chance to each different weapon, since it would make more sense that an Axe could have more chances than a Knife for example, In the case of shooting weapons, each one would also have to have a different percentage with respect to its type of explosive or incendiary ammunition.

In what I've been testing the plugin...

Apparently I need to put "enable" "1" on each weapon to make it work with "normal" "1"; "explosive" "10"; "incendiary" "3"
when I only seek that for example it works only with explosive ammunition and not for normal shots.

The grenade_launcher no apply stagger on tanks
I think [L4D2] Special Infected Stumble - Grenade Launcher plugin also had a similar problem.

Mr. Man 11-08-2021 01:24

Re: [L4D1 & L4D2] Stagger Tank on Hit [v1.0.0 | 06-November-2021]
 
Can the attributed be broken down by per weapon or do they apply to all weapons at the same time?

Marttt 11-08-2021 07:13

Re: [L4D1 & L4D2] Stagger Tank on Hit [v1.0.0 | 06-November-2021]
 
Quote:

Originally Posted by Tonblader (Post 2762805)
The grenade_launcher no apply stagger on tanks

Thanks, I added the classname "grenade_launcher_projectile" to the data file. Now seems to work.
You can replace the "weapon_grenade_launcher" with "grenade_launcher_projectile".
I left both just in case someone passes the grenade launcher as inflictor parameter in other plugins.

Quote:

Originally Posted by Tonblader (Post 2762805)
Apparently I need to put "enable" "1" on each weapon to make it work with "normal" "1"; "explosive" "10"; "incendiary" "3"
when I only seek that for example it works only with explosive ammunition and not for normal shots.

I did a test and is working properly, the default section is the value set for all enabled weapons when their attribute is not found inside their section.
See the example below for applying to specific weapons.

Quote:

Originally Posted by Mr. Man (Post 2762816)
Can the attributed be broken down by per weapon or do they apply to all weapons at the same time?

Yes. The section "default" is the value that is applied to all weapons in config with "enable" "1"

E.g: If you want that any hit from SMG staggers the Tank just do this in the data file (short example):

PHP Code:

"l4d_stagger_tank"
{
    
"default"
    
{
        
"enable"       "1"
        "normal"       "0"
        "explosive"    "100"
        "incendiary"   "0"
    
}

    
"classnames"
    
{
        
"weapon_smg"
        
{
            
"normal"       "100"
            "enable"       "1"
        
}
    }


If the "attribute" is not found then it uses the default config.

I didn't add all config per weapon in the data file otherwise the file would become too big.

Tonblader 11-08-2021 10:19

Re: [L4D1 & L4D2] Stagger Tank on Hit [v1.0.0 | 06-November-2021]
 
Quote:

Originally Posted by Marttt (Post 2762840)
Spoiler

Thanks, I don't know if the rock of the tank can also apply shove to another tank.

Quote:

Originally Posted by Marttt (Post 2762840)
Spoiler


So if I do that, Example:
Spoiler


weapon_smg would remove any chance to stagger tanks?

Marttt 11-08-2021 11:06

Re: [L4D1 & L4D2] Stagger Tank on Hit [v1.0.0 | 06-November-2021]
 
Just remove from the "classname" section or change "enable" to "0"

Maur0 11-13-2021 15:39

Re: [L4D1 & L4D2] Stagger Tank on Hit [v1.0.1 | 09-November-2021]
 
Marttt - Great plugin, I loved it a lot. Something that if that occurred to me, maybe if possible, is to apply an anti stagger block when the Tank is doing its animation of throwing the rock. What it does is block the probability of staggering the Tank when he uses his ability to throw his rock, which is to prevent him from being interrupted.

I thought about it because it seems a little more fair for the Tank and that it is not interrupted just at the moment of wanting to throw the rock. It would be more or less the command "l4d_stagger_tank_block_rock_enabled 1" that allows blocking the stagger effect when the Tank is using his ability to throw his rock.

I hope I have not complicated a lot for you and that you have understood what I meant. More than that was nothing more, the rest is perfect. Thank you! :)


All times are GMT -4. The time now is 15:52.

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