Left 4 Dead 2

Left 4 Dead 2

Throwable Melee Weapons Advanced (Vscript)
114 条留言
kouga 12 月 4 日 上午 9:36 
do you mean place AddThinkToEnt(entity, null); on "weapon_drop" event? since you suggested that i try deleting item pickup, and entity.ValidateScriptScope() only exists on "weapon_drop"
kouga 12 月 4 日 上午 5:16 
@kurochama, i made an attempt earlier which i sent to you on our chat.
kurochama  [作者] 12 月 4 日 上午 3:12 
@ kouga , The original when I made the "Prototype" very first version without the cfg file & used the "Scope + Fire" combo keys, the melee was thrown normally without low gravity. The clue might lie on "item_pickup", because back then I only used "weapon_fire" for the combo keys to drop melee, & "weapon_drop" to add the think function on the dropped melee. "item_pickup" was added later when the client who first proposed the throwable melee idea asked to make it only "Scope" button to throw instead of "Scope + Fire". You can try to completely delete the "item_pickup" & see if that removes the low gravity throw.
As for where to put the "AddThinkToEnt(entity, null)", on "item_pickup", right below "entity.ValidateScriptScope()" & above "local entity_entityscript = entity.GetScriptScope()", try to add that "AddThinkToEnt(entity, null)".
kouga 12 月 3 日 下午 10:32 
also what do you mean by put on top of the main scripts?
kouga 12 月 3 日 下午 9:41 
@kurochama, so youre saying that i can remove melee miss cooldown, but it wont get rid of the secret feature unless i also reset the think function on "item_pickup" ?

also, maybe the low gravity bug is caused by some other issue if the original version didnt have it.
kurochama  [作者] 12 月 3 日 下午 8:56 
@ kouga , no. Melee miss cooldown is also one of factors that trigger that secret feature. Probably one of simple ways to remove the secret feature is by resetting the Think function by adding a line like this when picking a melee on "item_pickup" event function: AddThinkToEnt(entity, null)
But that one must be put on top of the main scripts for the throwable melee.
As for the reason why it becomes a low gravity, actually the original version didn't have that problem even with "Scope + Fire" combo keys. I also have no idea about why that happened in your case, because from my experience that low gravity throw happens only when throwing using a timer/ think function, while throwing using event functions like "weapon_fire" etc normally won't cause the low gravity throw.
kouga 12 月 3 日 下午 7:57 
@kurochama i see, thank you for clearing that up. ive been using this mod for so long that i got too familiar and overlooked something so obvious :steamhappy:

in that case, is there something i can do to my version to fix both the secret feature and low gravity bug? if i were to remove the melee miss cooldown will that also fix the secret feature?

and also im so confused as to why using Scope + Fire would cause it to be thrown in low gravity. thats so odd...
kurochama  [作者] 12 月 3 日 上午 11:30 
@kouga , if that's the effect, I think it's already mentioned on my "Notes" on the description, like: A secret feature . I just never thought that the feature still works until now :steamhappy: . So, this secret feature can be a double-edged sword, like if some special infected except charger (charger should be immune to stumble when charging) pins you when you're in the effect buff, the debris effect will be triggered & special infected will stumble & take damage from the melee.
kouga 12 月 3 日 上午 1:25 
@kurochama, im away rn so i cant make a recording but i did manage to find a way to reproduce the bug:

- spam attack key (not sure if necessary step?)
- throw melee
- pick it up
- walk to a survivor or infected
- debris particle and stun effect will suddenly spawn beneath you as soon as you touch them

for reference im using settings from my aim to throw version :steamhappy:
kouga 12 月 1 日 上午 3:36 
@kurochama,

1) i see, thats the unfortunate thing because i quite like the effect of melees spinning and not just launching in the air frozen in place. are you able to provide a fix for that by detecting if the melee has touched the ground already?

1.a) i do also notice that the position of the thrown melee in the air is one where its widest surface area faces the player & the target. meaning for some melees like the sharp ones it doesnt look like it actually lands by the sharpest side first but rather the flat side.

1.b) the tank rock particle is a little too over the top, maybe replace it with a charger wall slam particle if possible?

2) ill try to get a recording of it when im available :) thank you
kurochama  [作者] 11 月 30 日 上午 7:08 
@ kouga:
1. This usually happens on either "Low Gravity Throw" or when "Melee Spinning Throw" is enabled. "Melee Spinning Throw" makes the thrown melee keep spinning, even on the ground. You can try to disable "Melee Spinning Throw" & the strange movements/ spins on the ground should stop.
2. No idea about this, as this never happened to me with both "Melee Warp Pickup" enabled & disabled. Probably if you have a video preview to show how the bug happens, I might be able to get some clues.
kouga 11 月 30 日 上午 6:22 
its been a while @kurochama, hope you've been doing alright :steamhappy: theres two bugs ive been meaning to report for ages now that i was wondering if you might be able to address:


1) sometimes when the melees land on the floor & long after they were thrown, they will still keep moving around like theyve been possessed. its pretty funny but quite a janky sight.

2) there are times when the force of the thrown melee gets stored in the player and will "explode" as soon as you touch another survivor/infected. is this perhaps a ping issue caused by the constant think function?

id love to hear your thoughts. thanks for your time :steamhappy:
kurochama  [作者] 8 月 18 日 下午 11:42 
@Cr0w , probably there were some errors on console after you modified some scripts. It would be easier to check if you make a new discussion thread, & then copy-paste which parts of scripts you modified there. Sometimes removing some scripts may cause errors if there are some important scripts deleted by accident.
Cr0w 8 月 18 日 下午 4:04 
I wasn't sure how to explain it, but I was trying to make the world a valid target for an area of effect to occur and also remove the requirement of a button press for activation to make throwing the primary fire. I couldn't seem to remove the requirement without it resulting in it lightly throwing the weapon with no effect.
kurochama  [作者] 8 月 17 日 下午 7:34 
@ Cr0w , what alterations? You can open a discussion thread on this mod to discuss, as comments don't support format for codes.
Cr0w 8 月 17 日 下午 4:26 
I'm attempting to make a version of this with a couple alterations and I was wondering if I could discuss this with you.
Bonnie 7 月 15 日 下午 2:42 
weird that your version but not him, is not conflict melee frenzy btw
kouga 6 月 14 日 上午 8:00 
@kurochama thanks. ill reach out to you once my schedule is a bit more free
kurochama  [作者] 6 月 11 日 上午 4:32 
@Kouga , I just sent you a friend request.
kouga 6 月 10 日 下午 9:21 
@kurochama i've uploaded the aim to shoot version now, https://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=3496527153
once again, thank you for your help

as for your tips, would you mind if i sent you a friend request on either steam or discord to inquire further assistance on how to pull off each point? thank you
kurochama  [作者] 6 月 7 日 上午 1:11 
@Kouga , for each point:
1. You need to rename the melee script on the melee model names (see my "Flamethrower with GL Skin" for knife).
2. To spawn an item when empty-handed, you can use "weapon_drop" & set it only if secondary slot is empty (no weapon). I think my "Throwable Melee" already has the example for that.
2.5. I think there's a mod that gives magnum as the gun when incapped, though I'm not sure if that can solve the pistol problem.
3. You can exclude a melee from being throwable by using the model names to register the melee (see my "Knife Throwing Arts" for the way to register melee model name).
kouga 6 月 5 日 上午 12:00 
btw, i mentioned 2.5) because i plan on greatly changing the function of pistols as well in the gameplay. currently, the "Primary Slot Pistols" mod make it so you spawn with a pistol as a primary slot, which works fine and well. And with the rise of the current edit of "Throwable Melee" you helped me create, it really shows some fun potential! the only problem is that when you get incapped, you still are given the pistol as a replacement primary, whch again gives the unwanted effect of dropping your current primary weapon and spawning a pistol out of thin air. it gives off a feeling of an infinite duplication glitch which is not what im going for.

as for 3) im not sure how to tackle exactly. i think youve mentioned before that its possible to make "Throwable Melee" to leave it as an exception? but in case that isnt possible or is too much work, would destroying the weapon and giving it back as soon as it leaves your hand be a good idea? what do you think could be done?
kouga 6 月 5 日 上午 12:00 
@kurochama tbh thats giving me all the more reason to want to have survivors fists as a melee weapon xD because then you could throw your melee and instantly have it replaced with fists (therefore it wont switch to primary & no SCOPE/ZOOM mode) ...but the logistics of it really have to be thoroughly accounted for. as it stands from what we've discussed these are the points to tackle with it, let me know if there are more:

1) it needs to spawn in every map
2) but it also has to be bext except when survivors are empty handed
2.5) making the pistol not spawn as a default weapon at all
3) have the fists be unthrowable

for 1) that can be done by modifying the melee scripts in the melee directories, but im not too sure about how to pull off 2) & 2.5) just yet...
kurochama  [作者] 6 月 4 日 上午 9:54 
@Kouga , good to hear that you successfully edited it to work completely. About that ZOOM on primary, yeah, if you have a mod that allows ZOOM the moment you switch to primary after throwing melee, you'll go into SCOPE/ ZOOM mode.
kouga 6 月 4 日 上午 9:37 
now that I have the ideal functions in place I can see clearly now why my view would "scope" when I throw the melee using ZOOM. the scope actually activates as soon as the melee leaves my hands; which is also when i switch to my primaries (and theyre the ones that zoom!) funny discovery :D
kouga 6 月 4 日 上午 9:34 
@kurochama loud and clear! ill make sure to give proper credit if or when i post it! btw ive been familiarizing myself with editing the vpk files and whatnot, so your instructions really made things super clear to me!! after opening up my game to test, it works fantastic!!! exactly what ive been looking for all this time, thank you so much for the help!
kurochama  [作者] 6 月 4 日 上午 6:50 
@Kouga , it's ok as long as you put the link of the original version on the mod description.
As for editing to remove ZOOM throw mode, probably it might be slightly complicated as you'll need to remove/ change some scripts like:
1. On "item_pickup" event function, remove some parts starting from "for(local entity; entity = Entities.FindByClassname" down to the end of its brackets.
2. On "weapon_fire", change the number 8192 to 524288.
kouga 6 月 4 日 上午 4:08 
@kurochama do you allow other people to edit your mods and republish them? because if its too much work implimenting what i mentioned, would you mind instead assisting me with modifying your addon for personal use / republishing, just to replace both RELOAD + FIRE and ZOOM to just ZOOM + FIRE as the method of throwing?
kouga 6 月 3 日 上午 9:03 
@kurochama got it, im testing right now. its working!! you do such an awesome job at this :DD
and regarding the combo keys, I really still want them back tbh. couldnt you add another cfg option for it that changes the other throwing button to either 1) ZOOM or 2) ZOOM + FIRE please? just so that it would fulfill both of our preferences....it doesnt have to be a full keybind customisation feature like we've discussed before, just something that lets us pick between either options :>
kurochama  [作者] 6 月 3 日 上午 8:50 
@Kouga , I just updated, & now "Temporary Pistol on Melee Throw" also works on RELOAD + FIRE.
As for the old combo keys, ZOOM + FIRE, as you read there, they preferred ZOOM key only. The "low gravity throw" only shows up when using ZOOM key. It was a normal throw when using "ZOOM + FIRE".
kouga 6 月 3 日 上午 8:34 
@kurochama, I read it just now and I see!

-so the ZOOM key used to be ZOOM + FIRE initially, such a shame if im being honest! Id really like it if it returned to the original shortcut ZOOM + FIRE because it just works so well with your Scope with all guns addon. I mean think about it, ZOOM is the aim button, so using it universally as the button to aim both guns AND melee just makes sense!!
-I think choosing between "normal throw" or "low gravity throw" is a good choice, yes! but also another question, was the low gravity effect observed when it was still ZOOM + FIRE?
kurochama  [作者] 6 月 3 日 上午 8:21 
@Kouga , you can check some comments on the prototype version of this mod here: Throwable Melee (Prototype) . There are some discussions there that becomes the reason why I added ZOOM key. Originally it's "RELOAD + ATTACK".
It would be too many features if a feature to disable one of alternative keys to throw melee is added. I'll just let people choose whether they use "normal throw" or "low gravity throw".
kouga 6 月 3 日 上午 8:08 
@kurochama, awesome! thank you for your hard work as always :) oh and while you're at it, ive turned around on you're idea of rebinding ZOOM --> TAB + SCOPE and i think it would be a good idea. however i also wonder why there are two buttons to throw a melee in the first place? it really would be nice to be able to choose which key/s activates the throw, or atleast only limit the throwing key to RELOAD + FIRE. what do you think?
kurochama  [作者] 6 月 3 日 上午 7:26 
@Kouga , I'll add for RELOAD + SHOOT soon, as last time I only checked on the ZOOM part.
kouga 6 月 3 日 上午 7:05 
@kurochama thank you for the new feature! ive updated it and tested just now and noticed one thing, does TemporaryPistolOnMeleeThrow 0 also not work for you when throwing using RELOAD + SHOOT? Any quick fix? it seems to function as intended when using ZOOM, but I have told you before how Id much rather use the other button for this mod, as it still zooms the screen the moment I throw due to scope on all guns (i would be willing to provide a recording of that zoom behavior as well if you dont know what I mean).
kurochama  [作者] 6 月 3 日 上午 4:59 
@Kouga , I added a new feature, "Temporary Pistol On Melee Throw". You can disable this if you don't want temporary pistol after throwing melee.
kouga 6 月 2 日 下午 10:53 
@kurochama so when i threw the melee, it would switch to the Primary Weapon slot AND also give me a pistol, therefore dropping the current weapon i already had. Now I quite like the Primary Pistols, so this kind of circles back to my request of adding a feature to this mod that doesnt provide you with a pistol at all. Originally I had discussed with you about the possibility of giving the player a custom bare hands weapon after throwing the melee, and you mentioned several hurdles as to why you cant just do that. So Id like to propose one last "solution/compromise" if thats okay. How about instead of giving you bare hands or pistols, have an option in the cfg file that dictates whether or not throwing the melee would give a pistol/switch to primary slot entirely? meaning it would just produce the same effect as dropping the melee, and the secondary slot would just be empty. How does that sound?
kouga 6 月 2 日 下午 10:42 
@kurochama , so the weird behavior can be observed when using either scope/zoom or reload + attack. ive been trying to narrow down which mod it conflicts with but it was weird because this wasnt something that showed up before, so it couldnt have been any of the item drop mods i had (they also didnt use reload zoom or attack). i gave it more time and found that it really *was* the Primary Slot Pistols mod that caused the behavior. turns out my L4D2 doesnt recognize what mods are active in the game unless i do a full restart now lol. (that might be because i have 380+ mods on
kurochama  [作者] 6 月 2 日 下午 1:40 
@Kouga , it never happened to me. My primary was still there when I threw the melee. Which buttons did you use to throw? Scope/ Zoom button, or the "Reload + Attack"? Probably certain mod about item drop might cause it. You can check your mods that allow item drop by pressing either Zoom, Reload, or Attack.
kouga 6 月 2 日 上午 11:22 
me again @kurochama. im noticing some weird behavior i havent encountered before. if i throw the melee while i have a primary weapon, it will drop the primary altogether. at first i thought it was a conflict with the Primary Slot Pistols mod I had installed but it wasnt. im not entirely sure why its happening but it often gets me confused because my primary would disappear from my hand after i throw the melee in the middle of combat, and that gets me to take more damage than i should be. is the same behavior present when you test it?
kouga 5 月 16 日 上午 1:22 
its not a distraction at all. I have CTRL bound to where CAPSLOCK is, so its much easier on my pinky to reach during play. My ALT key is also where my TAB originally is... as you see I do agree because I also dont use TAB as frequently and given the layout of my keyboard I put it somewhere out of way. It would be straining for my fingers to have to reach all the way down just to throw, but i know thats a specific use case. my compromise at the moment is to rebind RELOAD to Q, so my hands can reach it much more reliably, but thats besides the point👍
kurochama  [作者] 5 月 15 日 下午 11:52 
@Kouga , won't it become a distraction during play if you press CTRL for crouching & at the same time the survivor's status & maps are displayed because of the SCORE function? I usually leave TAB alone as I almost never check it unless if I forget which map I'm in when playing custom campaigns.
Normally it should be possible to combine "ZOOM + FIRE" to throw melee, but I can't see it as an effective solution. & if what your problem is the scope feature being active after melee throw, changing to "ZOOM + FIRE" won't affect much either, as the primary gun will still zoom the moment you switch to primary gun after throwing melee.
kouga 5 月 15 日 下午 11:32 
the thing with TAB is that I personally have it bound to where the CTRL key is on the keyboard; which is more of a me-problem than anything but its definitely a factor into why id rather have SCOPE + FIRE. as for RELOAD + FIRE, that is the button ive been using as an alternative, and i rather like the lower gravity effect it has. i just wanted to ask if it were possible to update the current buttons. ✌️
kurochama  [作者] 5 月 15 日 下午 11:04 
@Kouga , instead of "SCOPE + FIRE", I think it's better to use TAB (Score) button instead as an alternative to throw melee, as this button is almost never used except only for few purposes. & actually you can also use "RELOAD + FIRE" to throw melee, but this throw is affected by gravity so it will fall to the ground earlier than when using SCOPE/ ZOOM.
kouga 5 月 15 日 下午 8:00 
im not sure if we're on the same page xD scope on all guns + throwable weapons actually work fine. there's no bug where my melee throws when i hold my primaries. the behavior im talking about is when im holding my melee and it does two things:

1) it still zooms when I hold SCOPE/ZOOM. I should clarify that I am on ScopeZoomMode 5
2) the melee throws as soon as I press SCOPE/ZOOM, but id like it to be updated to SCOPE/ZOOM + FIRE instead.

i just dont want the melee to throw immediately when I press SCOPE/ZOOM. my reasoning is just that it feels mechanically better. sorry for the confusion xD
kurochama  [作者] 5 月 15 日 下午 7:41 
@Kouga , that's really strange then, as actually I often used this together with my m203 series mods, & as those mods also use SCOPE/ ZOOM to trigger m203, so it's basically the same zoom mechanisms as "Scope On All Guns". But I never had a bug where my melee was thrown by accident when I used SCOPE/ ZOOM on my primary guns when I was trying to use m203.
kouga 5 月 15 日 下午 7:29 
okay, after further testing ive reconfirmed that scope on all guns really does zoom the instant i throw the melee weapon. but it seems that the behavior of throwing does originate from this mod. my request is to just have the SCOPE/ZOOM button be held and require FIRE to actually throw the melee (SCOPE/ZOOM + FIRE, the same behavior as RELOAD + FIRE) instead of just tapping SCOPE/ZOOM once. is that possible? :>>
kouga 5 月 15 日 下午 6:27 
1. thats odd then, im not sure whats causing the issue in my game exactly but i swear that zooming launches the melee somehow. and it does that only when im holding the melee not the gun like you said. im not on my laptop rn so i cant confirm but i will do further testing.
2. ah, i see then. its a bit impractical to have it implemented because of the limit. no worries then
kurochama  [作者] 5 月 15 日 上午 11:17 
@Kouga:
1. Melee is only thrown if you're holding melee when pressing SCOPE/ ZOOM. So if you're holding a gun, the melee won't be thrown.
2. The available buttons are actually limited, like there are only movement (w, s, a, d), crouch, walk, jump, shove, score, use, reload & scope/ zoom. So even if a feature is made, you can only change the button to either one of those I mentioned.
kouga 5 月 15 日 上午 6:48 
hey im back. i have two more (hopefully easier) suggestions for this mod. could you make it so 1) SCOPE/ZOOM is updated to SCOPE/ZOOM + FIRE? i have the Scope on all Guns mod installed, and so its a little jarring to have the melees fly immediately as soon as i zoom. 2) could you make it configurable which button to press/hold to throw?