Left 4 Dead 2

Left 4 Dead 2

745 ratings
Super Knockback Tanks
9
2
   
Award
Favorite
Favorited
Unfavorite
Game Content: Scripts
Game Modes: Single Player, Co-op
File Size
Posted
2.817 KB
13 Dec, 2024 @ 4:22pm
1 Change Note ( view )

Subscribe to download
Super Knockback Tanks

In 1 collection by Geebanger0
Special Infected Modification Program (S.I.M.P)
6 items
Description
The Jockey modification program was a huge success. So much so that the eggheads in the lab suggested we expand our research to include the other infected variants. Our military contract for the Rocket Jockeys raked in around $75 Million. You know how many kinds of steroids you can buy for $75 Million? It's a lot. Whole shipping containers full of 'em. Then we stuck every last one into a bunch of Tanks just to see what'd happen. Turns out, it kills them. A couple were lucky enough to not suffer an immediate heart attack however, and now you can fight them. Just don't get punched...
Popular Discussions View All (1)
2
19 Dec, 2024 @ 2:45pm
werwerewr
Zadiswa
127 Comments
Isolda 5 Sep @ 4:11pm 
And just to be clear: no lag/jittering (associated with Coldfront) while trying to recreate it privately in single player (but I know it happened hosting local). The error still happens on vanilla maps and Coldfront alike.
Isolda 5 Sep @ 4:02pm 
The full error is:
AN ERROR HAS OCCURED [the index 'GetActiveWeapon' does not exist]

CALLSTACK
*FUNCTION [OnGameEvent_player_hurt()] c:/program files (x86)/steam/steamapps/common/left 4 dead 2/left4dead2/addons/workshop/3383897874.vpk/scripts/vscripts/director_base_addon.nut line [7]
*FUNCTION [__RunEventCallbacks()] unnamed line [211]
*FUNCTION [__RunGameEventCallbacks()] unnamed line [218]

LOCALS
[attacker] INSTANCE
[victim] INSTANCE
[event] TABLE
[this] TABLE
[funcName] "OnGameEvent_player_hurt"
[idx] 0
[useTable] TABLE
[bWarnIfMissing] false
[globalTableName] "GameEventCallbacks"
[prefix] "OnGameEvent_"
[params] TABLE
[event] "player_hurt"
[this] TABLE
[params] TABLE
[event] "player_hurt"
[this] TABLE
Isolda 5 Sep @ 4:02pm 
With every mod unchecked and non-workshop mods moved out of the way, the error still occurs, except this time it appears the fall damage causes the console error, not the Tank punch. I have locally hosted Coldfront a few times with this script on (and I was aware of this at first harmless console error), where the framerate became jittery for everyone when the Tank fight happens halfway through the map (which spammed the error in console if memory serves right).

Launching through console in single player does not cause jittering (but the error persists). I remember killing the Tank removed the stuttering, and no other Tank in the campaign caused that (including the following finale Tanks). At first console glance, Coldfront modifies and is loading a director_base_addon script, but I don't understand why it would cause that.
kurochama 5 Sep @ 3:40pm 
Actually "GetActiveWeapon" is tricky sometimes. Sometimes, you'll need to add some checks like this to prevent "does not exist" error on console:
if(!player.GetActiveWeapon() || !player.GetActiveWeapon().IsValid())
{
return;
}

& although it triggers some errors, usually it won't cause lag unless if it's spammed continuously via timer or regular tick.
Geebanger0  [author] 5 Sep @ 3:14pm 
If you wouldn't mind, could you do a couple more tests?

- Try it on a vanilla map like Dead Center with no other mods enabled, just to confirm that the script is working.

- If it is working, see if you get lag on any map other than coldfront 5.
Geebanger0  [author] 5 Sep @ 3:11pm 
heres how the script works

when a player takes damage
- get the ID of the player and the attacker
- check which weapon the attacker was using
if the attacker was using a tank_claw
- give the player massive upward velocity

from your error, it looks like its failing at the "check which weapon the attacker was using" step. If the script fails in that way, it shouldn't have any lag related impact, it should just stop.
Isolda 5 Sep @ 10:32am 
When a Tank punches a survivor, I get this console error: "AN ERROR HAS OCCURED [the index 'GetActiveWeapon' does not exist]" referencing line 7 on this script. On Coldfront map 5, it has caused massive lag spikes just when a Tank is alive, so I unfortunately can't run this script without worrying about that. Is there any solution you can come up with for this?
Qxxqwas 5 Sep @ 10:25am 
nevermind the mod worked
Geebanger0  [author] 2 Sep @ 4:47am 
are you on a local host server
Qxxqwas 2 Sep @ 4:43am 
the mod didn't worked