Left 4 Dead 2

Left 4 Dead 2

M60 Stumbles Specials
36 Comments
T626 21 Feb @ 2:32pm 
@Wenda Got it over and done with! Thank you sm for your help, Wenda!!
I STAPLE TAPEWORMS ON MY  [author] 18 Feb @ 3:31pm 
ill make an ems later tho
I STAPLE TAPEWORMS ON MY  [author] 18 Feb @ 3:31pm 
the .nut file in the addon vpk
T626 18 Feb @ 2:11pm 
@Wenda Then where do I put in the information that you gave me? In the in-game developer console?
I STAPLE TAPEWORMS ON MY  [author] 18 Feb @ 2:01pm 
@T626 there isnt one yet
T626 18 Feb @ 1:13pm 
@Wenda What's the name of the ems file? And where do I find it?
Cat as angel S 18 Feb @ 3:18am 
Is that Dandy World Poster?
I STAPLE TAPEWORMS ON MY  [author] 17 Feb @ 5:26pm 
@T626 change:
if(victim.IsPlayer() && victim.GetZombieType() == 8 || victim.IsPlayer() && victim.GetZombieType() == 6 || victim.IsPlayer() && victim.GetZombieType() == 9) //tank, charger, survivor
to:
if(victim.IsPlayer() && victim.GetZombieType() == 9) //survivor
T626 17 Feb @ 5:21pm 
@Wenda Is there a way to edit this so that it does stumble all the special infected, including chargers and tanks? Because I have a sick minigun mod by @Lt. Rocky that replaces the M60 that would go along perfectly with that.
I STAPLE TAPEWORMS ON MY  [author] 17 Feb @ 1:15pm 
no, but i can figure out how to do it
Legoshi's Lover 17 Feb @ 1:11pm 
Is there EMS settings to disable the Witch in this?
Alpha 17 Feb @ 6:58am 
@Wenda
Sorry, my bad. POSION is my eariler version.
I forget that I have updated my script. Now infected_hurt filter damage by DMG_BULLET, and use takedamage by DMG_BLAST, so that the listener won't be a dead-loop.
So sorry to confuse you :(
I STAPLE TAPEWORMS ON MY  [author] 17 Feb @ 5:20am 
@Milcoенг why did this auto hide the comments
Milcoенг 17 Feb @ 4:50am 
0890
780
78
07
80780
avatar 16 Feb @ 1:33pm 
WHAT THATS MY WORK SHOP
I STAPLE TAPEWORMS ON MY  [author] 16 Feb @ 9:59am 
@zAcasalamentoman tumtara
zAcasalamentoman 16 Feb @ 9:58am 
@Wenda what is the name of this map?
JohnsonCereal986 15 Feb @ 10:18pm 
ew dandys sprunki
Pro_gaming321 15 Feb @ 8:07pm 
why do i see dw poster's
I STAPLE TAPEWORMS ON MY  [author] 14 Feb @ 7:59am 
oh, again, thank you a lot
4512369781 14 Feb @ 7:54am 
One more thing, non-bullet damage should also be filtered out first. For example, if you throw a molotov, then switch to M60, then zombies will dance in the fire.

Add this code in the "if"method that checks the weapon.
&& (params.type & DirectorScript.DMG_BULLET) == DirectorScript.DMG_BULLET
I STAPLE TAPEWORMS ON MY  [author] 14 Feb @ 7:48am 
oh thank you again
4512369781 14 Feb @ 7:28am 
@Wenda
You're welcome.
About what @Alpha said, he should mean that you need to filter the damage type, after you use "DMG_BLAST" to stumble witch, you need to end the function by check the damage type to avoid crashing.
like this: if( victim.GetClassname() == "witch" && (params.type & DirectorScript.DMG_BLAST) != DirectorScript.DMG_BLAST )
I STAPLE TAPEWORMS ON MY  [author] 14 Feb @ 6:50am 
@Alpha I looked at your awp script but i cant find what you are refering to in them? it doesnt seem to use posion at all
I STAPLE TAPEWORMS ON MY  [author] 14 Feb @ 6:20am 
@4512369781 thank you
4512369781 14 Feb @ 2:20am 
hi, you can filter minigun by this:
if (NetProps.GetPropInt(attacker, "m_usingMountedWeapon")) return;
Both OnGameEvent_infected_hurt and OnGameEvent_player_hurt need it.
Alpha 13 Feb @ 6:28am 
Oh I know what happend to you.
Your game is crashed by an infinity "takedamage", cause takedamage lead to takedamage again.
To figure it out, you must add another damage type (like posion, my choice), then make the listener step over this type, then the listener won't be trigger by your "stumble-damage" and finish correctly.
Damage type is bit data. you can combine them with "|" like "blast | posion"(you can find the const name at doc or ask AI). When judege type, you can use "type & posion" to check the damage.
You can check my mod and take a look at the source code, there are detailed solution.
I STAPLE TAPEWORMS ON MY  [author] 13 Feb @ 6:11am 
how do i prevent TakeDamage() from crashing the game
Alpha 13 Feb @ 6:10am 
Yes, there will be 2 events in your "M60Stumble" domain, OnGameEvent_infected_hurt and OnGameEvent_player_hurt, that's all.
BTW, witch is entity, not player. The Class Entity has not function "Stagger()". So the only way to stumble witch is using "TakeDamage" and wih type "DMG_BLAST".
After all, using "OnGameEvent_infected_hurt" to listen witch and stumble her by "TakeDamage()", using "OnGameEvent_player_hurt" to listen other SI and stumble them by "Stagger()". Then put these 2 event into you custom domain "M60Stumble", and load with "__CollectGameEventCallbacks".
I think it will be OK in this way.
I STAPLE TAPEWORMS ON MY  [author] 13 Feb @ 5:54am 
also the current code works fine, it was just when i tried to add more it stopped
I STAPLE TAPEWORMS ON MY  [author] 13 Feb @ 5:51am 
atleast according to the braces they are
I STAPLE TAPEWORMS ON MY  [author] 13 Feb @ 5:49am 
both of them are in it?
Alpha 13 Feb @ 5:47am 
In you script, I find there are two group of "OnGameEvent_infected_hurt" and "OnGameEvent_player_hurt". One in "M60Stumble" then uses "__CollectGameEventCallbacks" to load, the other is out of it.
You should make sure all events are in the a custom domain(M60Stumble) and uses "__CollectGameEventCallbacks" to load, do not write it at root domain, otherwise it will lead to bugs that make same-name-events invalid.
This bug won't print any logs, cause it just override other events, no logic error.
So you can try to remove the events that out of "M60Stumble", and check it again.
I STAPLE TAPEWORMS ON MY  [author] 13 Feb @ 5:23am 
i tried implimenting a change based on yours, but it somehow made the game not recognize OnGameEvent_infected_hurt anymore and give no error as to why. OnGameEvent_player_hurt still works fine and infected_hurt works fine in other scripts. idk what the issue is
I STAPLE TAPEWORMS ON MY  [author] 13 Feb @ 4:24am 
@alpha oh thank you a lot
Alpha 13 Feb @ 4:10am 
I've just seen the source code, and there will be a bug I guess.
You can take the M60 and use minigun to shoot the witch, she will be stumbled, unexpected.
In fact, the function "attacker.GetActiveWeapon().GetClassname()" will still return the weapon you just taken when you use stable weapons.
Besides, other-type damage from you also produces effects such as fire or explode on witch, but it's override by other special effect, you can check it on the log.
You can take a look at my vscript in "AWP script" (the part of "on_infected_hurt"), and use it on your m60.