Left 4 Dead 2

Left 4 Dead 2

Throwable Melee Weapons (Prototype) (Vscript)
30 Comments
kurochama  [author] 16 Feb @ 7:56am 
@Cory Benston , I still have no clue of how to reset the low gravity on melee throw via ZOOM key. I tried to reset via netprops but it had no effect. Probably I'll try to add some velocity later, to see if that could reset the low gravity.
As for "Melee Throw Glow Type", if you set to 1, it uses dynamic light. If it's set to 2, it uses custom glow (orange). You can test it yourself to see how it looks like.
Cory Benston 16 Feb @ 6:21am 
i hope the zoom throw is gonna be fix later. Also can you explain how does the "Melee Throw Glow Type" work?
kurochama  [author] 15 Feb @ 5:38am 
@Cory Benston , probably I'll do a quick update again soon. I'll slightly modify the scripts to remove that error on console, & also add a new mechanism to force player to switch to primary gun if they have primary gun. They'll still get the temporary pistol though.
kurochama  [author] 15 Feb @ 5:14am 
@Cory Benston , that's what I mentioned on the "Notes". When using ZOOM to throw, the melee is thrown, but somehow with lower gravity. & in fact, I didn't modify the throw mechanisms at all except by adding the ZOOM key. That error on console is also strange, because if the melee is successfully thrown, then it means that the scripts work. Probably it's triggered because I used "Think" function to check ZOOM button & whether the melee is still in player's hand (the moment it's thrown, it's no longer in player's hand so that's why the "player" there is "null").
Cory Benston 15 Feb @ 5:03am 
@kurochama i tried it and it works, but when i throw it (the zoom button), the melee has zero gravity to it. And also it gives me this in the console:


AN ERROR HAS OCCURED [the index 'GetActiveWeapon' does not exist]

CALLSTACK
*FUNCTION [GetActiveMainWeapon2()] c:/program files (x86)/steam/steamapps/common/left 4 dead 2/left4dead2/addons/workshop/3426113086.vpk/scripts/vscripts/director_base_addon.nut line [147]
*FUNCTION [unknown()] c:/program files (x86)/steam/steamapps/common/left 4 dead 2/left4dead2/addons/workshop/3426113086.vpk/scripts/vscripts/director_base_addon.nut line [157]

LOCALS
[player] NULL
[this] TABLE
[owner] NULL
[this] TABLE
kurochama  [author] 15 Feb @ 4:23am 
@Cory Benston , I just finished updating the ZOOM button. You can try it.
kurochama  [author] 15 Feb @ 3:23am 
@Cory Benston , I just finished testing, & the ZOOM button can work almost instantly (or instantly? It's triggered in 0.05 second when a player presses ZOOM buttom while holding melee). Probably I'll update this & the advanced version soon, after testing it on the advanced version too.
Cory Benston 15 Feb @ 3:12am 
@kurochama you can make a seprate addon with my idea and call it "alternate" version. (if you want)
kurochama  [author] 15 Feb @ 2:30am 
@Cory Benston , if what you meant was using ZOOM key to throw melee, I think this is also possible, but it might have a delay. For example, players need to hold ZOOM key in less than 0.1 second to throw melee (not instant throw on click/ press).
Cory Benston 15 Feb @ 2:10am 
@kurochama i dont quite think that you understood the "zoom option". What i meant is throwing the melee with the single key press.
I dont know how to enable/disable the "Melee Throw Glow Type" in the console. Also i made a mistake for calling the outline a "highlight".
kurochama  [author] 14 Feb @ 11:22pm 
@Cory Benston , I just added "ZOOM + FIRE" as a new alternative mechanism to throw melee. As for changing dynamic light to glow, I added a new feature, "Melee Throw Glow Type" on the advanced version instead.
kurochama  [author] 14 Feb @ 9:51am 
@Cory Benston:
- So, it's that glow. Probably I can try it, though not all objects can have a glow. But if the glow successfully shows up, probably the glow will stay on the melee

- I wonder if that's related on a "secret feature" I mentioned on advanced version about "One-Time-Protection Flare". I'm not sure if it's a real invincibility, because last time I checked that "secret feature", I simply just used it as an automatic attack that ends after being triggered, & the attack was fast enough so zombies almost didn't have a chance to attack.
Cory Benston 14 Feb @ 9:27am 
@kurochama
- highlights are those glowy things when you get near a object (ammo, weapon,throwables,etc). And what i mean is that making the throwable melee glow in that highlight


-Yes, it make me invicible for 5 seconds, but when im near a zombie, i make them take damage from me and the ability disappear, so what i believe is that, when i pick up the thrown melee, the game thinks that the melee is still on the ground and still lethal.
kurochama  [author] 14 Feb @ 9:00am 
@Cory Benston:
- Highlight? Did you mean a glow? I'm not sure if I can apply it on melee. I ever applied it on special infected & the glow worked, but I haven't tried on melee yet.
- For optional combo keys , ZOOM + ATTACK (just like the advanced version), I can add it later.
- the advanced version already has the cfg file to adjust the cooldown timer when hit & missed, so, for this version, I think it would be better to keep the return mechanisms as they are.
Anyway about the glitch,I think that's the first time I heard. There's no script about invincibility on the mod. Did the invincible state last for 5 seconds too?
Cory Benston 14 Feb @ 7:41am 
I really enjoyed this addon, but i want to change a few thing:

-instead of the dynamic light it can be a red highlight

-it would be better if it was the middle mouse button (aka the zoom key)

-it can't return after a failed throw (you don't need to change this on advance version)

that's all the change's.

(also i found a glitch were you throw the melee and quickly pick it up, you become invicible)
kurochama  [author] 13 Feb @ 12:20pm 
@botian , thanks :steamhappy:

@Leon, you can try this version if you want to adjust the cooldown timer freely via cfg file: https://gtm.steamproxy.vip/sharedfiles/filedetails/?id=3426757231
botian 13 Feb @ 9:10am 
awesome
Leon 13 Feb @ 6:08am 
Don't worry, take your time, will play with this for the time being.
kurochama  [author] 13 Feb @ 5:11am 
@Leon , I haven't played those games, but I ever played hack & slash games like Samurai Warriors & Dynasty Warriors that have boomerang melee mechanisms on some characters that always return to the owner after traveling at certain distance, so I kind of know how it works, more or less. Unfortunately this boomerang melee mechanisms might take more time to make & test, as it's basically like creating new mechanisms. Probably I can add a feature like "Boomerang Melee Mode" someday, to switch between normal melee throw & boomerang melee throw. But I don't know when I'll do that, as my main focus now would be adding some features about damage multiplier & melee throw cooldown first.
Leon 13 Feb @ 4:10am 
Also, I guess you will be much more vulnerable when using a pistol than using a melee during that moment because pistol have low attack power. For tank, keeping your distance is also a problem already lol.
Leon 13 Feb @ 4:07am 
Have you played Star Wars Jedi Knight 2 or 3? The concept are more or less similar to the lightsaber throw in these games. Just throw and return, not hovering on a specific position lol.
kurochama  [author] 13 Feb @ 2:46am 
@Leon , so in other words, you want it to look completely like a boomerang melee, & damage any zombies on its path before it returns? That probably would make it too strong almost like a sniper then. & tank would probably become the problem, as the melee probably couldn't slice through the tank, he would take a continuous damage until the melee returns.
Leon 12 Feb @ 9:52pm 
I think the logic work like this:
1)throw melee - if no obstacles + 1 or more enemy in path - keep flying and hit until max distance - start return + apply cd before next throw;
2)throw melee - if no obstacles + no enemy in path - keep flying until max distance - start return + apply cd before next throw;
3)throw melee - if no obstacles + zero/1 or more enemy in path - keep flying until max distance - start return - if user moves to position with obstacles - keep flying back and stop when collide with obstacle - apply cd before weapon returns.
Leon 12 Feb @ 9:40pm 
Damage cancel on hitting objects isn't an issue, but you can set them return immediately on contact. For fly back, you can apply the 5 secs cd penalty when bounces and fall on the ground if obstructed during return journey, so the user get a pistol temporarily during cd.
kurochama  [author] 12 Feb @ 7:33pm 
@Leon , actually the first plan was like that, like, no matter what the thrown melee hit, it would return to the owner. But then this became a problem when a zombie was hiding behind an object, because the moment the melee hit an object, the damage was cancelled. The reason why I put 5 seconds of cooldown penalty when not hitting any zombies are to let players bounce their melee weapons on wall or make it slide on the floor (like some of the animated previews). But this can be adjusted later when I add "Throw Miss Cooldown", as you can set how long until the melee returns when missed with this feature.
As for the flyback animation, that might be possible but it could also create a new problem, like, if there's an object between the melee & the owner, the melee would bounce & fail to reach the owner.
Leon 12 Feb @ 6:35pm 
If it hit a wall and stopped, return immediately. Would be better if there is a fly back animation.
Leon 12 Feb @ 6:31pm 
I just thought of an additional feature: after throwing the melee, no matter what's been hit or missed during its path, return to the owner after reaching a specific distance, away from the owner.
L_M 12 Feb @ 4:25pm 
goat mod again:steamthumbsup:
Unsants 12 Feb @ 2:10pm 
Impressive:steamthumbsup::steamhappy:
SalaaMohamed05 12 Feb @ 10:39am 
HELL YEAHHHHHHHHHHHHHHHHHHH!!!! 🗣🗣🗣🗣🗣🗣 :steamthumbsup::steamhappy: