Left 4 Dead 2

Left 4 Dead 2

Not enough ratings
[VSCRIPT] Charger Fixes (Correct difficulty scaling + Carry Damage + no FF on carry)
   
Award
Favorite
Favorited
Unfavorite
Game Content: Scripts, Miscellaneous
Items: Other
File Size
Posted
Updated
4.198 KB
18 Jun @ 1:29pm
8 Jul @ 5:28pm
7 Change Notes ( view )

Subscribe to download
[VSCRIPT] Charger Fixes (Correct difficulty scaling + Carry Damage + no FF on carry)

In 2 collections by EcoDoBoteco
Second Wind!
78 items
subbed addons collection
80 items
Description
chargers are funny and have carry impact damage + correct difficulty damage scaling so they delete you.

The damage scaling is 15/15/30/45 - Easy, Normal, Advanced, Expert

The carry damage is 5/5/10/15 - Easy, Normal, Advanced, Expert

Credits (go to the og mods, like, favorite and comment)

Me - adding correct scaling, applying sky's fixes and rewriting a bit of the code.

Original Code by ChimiChamo
Code fix suggestions by skysky199 (code size was decreased by 1/3rd)
Idea by Jugger

Charger Damage Changes on Difficulty

Charger Carry Damage

no FF on Charger carry
6 Comments
EcoDoBoteco  [author] 3 Jul @ 5:42am 
hey skysky199 can you help me with some coding knowledge? accept my friend request, ty
EcoDoBoteco  [author] 19 Jun @ 10:23am 
Hey @skysky199 I edited the code and managed to apply 2. and 3. ty for the help
skysky199 19 Jun @ 9:46am 
1.
You should place all your OnGameEvent_* functions inside the ChCh_ChargeImpactDMG table.
And suggest rename the table, or this will be conflict with the original one.

2.
Don't use OnGameplayStart(), use OnGameEvent_round_start_post_nav(params), or call the initialization function below itself instead. (In your case, initializing via a function is actually unnecessary.)
For example:
function aaa()
{
//do something
}
aaa();

3.
I think the difficulty-related part in the OnGameEvent_charger_charge_start is unnecessary.
Btw, this event may be called more than once per ability use. I'm not entirely sure what your intention is here, so consider this just a friendly reminder.

4.
GetDifficulty() will return 0 on Easy, so the damage will always be zero.
Besides, I suggest using a look-up table for non-linear damage scaling, but you can still simply use
if(diff == 0)
...TakeDamage(5.0, ...);
else if(diff == 1)
...TakeDamage(5.0, ...);
...
(should not ignore "else".)
Internet gangster 18 Jun @ 3:54pm 
could you change the chargers grab on easy to 5 damage (same as normal) to match the scaling
EcoDoBoteco  [author] 18 Jun @ 2:10pm 
We need more Mods including him as thumbnail.
Morsch 18 Jun @ 2:07pm 
GTA San Andreas Charger my beloved.