Left 4 Dead 2

Left 4 Dead 2

[VSCRIPT] Charger Fixes (Correct difficulty scaling + Carry Damage + no FF on 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.