Garry's Mod

Garry's Mod

NPC Melee Attack
Limakenori  [developer] 16 Jun, 2024 @ 12:51am
Bug Reports/Suggestions
report bugs or post suggestions here
< >
Showing 1-15 of 23 comments
bubby 16 Jun, 2024 @ 12:19pm 
can you make an option to have unarmed npcs not use melee attacks
it looks strange to have soldiers and citizens attack stuff with invisible weapons
(metrocops look alright because it looks like a punch)
Limakenori  [developer] 16 Jun, 2024 @ 12:32pm 
Originally posted by bubby:
can you make an option to have unarmed npcs not use melee attacks
it looks strange to have soldiers and citizens attack stuff with invisible weapons
(metrocops look alright because it looks like a punch)
This addon doesn't add melee attack for combines(because they already have one)
And you can easily make citizens don't use melee attack when unarmed using commands(Check description)
bubby 16 Jun, 2024 @ 4:25pm 
Originally posted by Limakenori:
Originally posted by bubby:
can you make an option to have unarmed npcs not use melee attacks
it looks strange to have soldiers and citizens attack stuff with invisible weapons
(metrocops look alright because it looks like a punch)
This addon doesn't add melee attack for combines(because they already have one)
And you can easily make citizens don't use melee attack when unarmed using commands(Check description)
im suprised i dident see that part until now 0_0
george_sam200 17 Jun, 2024 @ 2:58pm 
could you please add more animations like a kick too or something idk
Limakenori  [developer] 17 Jun, 2024 @ 8:56pm 
Originally posted by george_sam200:
could you please add more animations like a kick too or something idk
I don't like to make animation replacements, so no.
Last edited by Limakenori; 17 Jun, 2024 @ 8:56pm
Screddy 18 Jun, 2024 @ 5:56pm 
the metrocops still slap me after they die
SonicUnleashedXY 18 Jun, 2024 @ 8:01pm 
Do you have more examples of what is considered a NPC class & how to get information in the game? I assume you just copy the NPC in the spawn menu to get the name but I'm unsure if this is correct.

Bugs:
NPC can still melee when the AI is disabled or sometimes right after they've just died.

Suggestions:
Is it possible to add more than 1 animation which they can randomize to or fallback to in case there's no animation.

Some melee class weapons don't work with NPCs as they're treated like a gun. Would it be possible to have a list that is an exception to this mod not affecting those melee class weapon? This also ties back to the more than 1 animation suggestion.
Last edited by SonicUnleashedXY; 18 Jun, 2024 @ 8:04pm
Limakenori  [developer] 18 Jun, 2024 @ 8:16pm 
Originally posted by SonicUnleashedXY:
Do you have more examples of what is considered a NPC class & how to get information in the game? I assume you just copy the NPC in the spawn menu to get the name but I'm unsure if this is correct.

Bugs:
NPC can still melee when the AI is disabled or sometimes right after they've just died.

Suggestions:
Is it possible to add more than 1 animation which they can randomize to or fallback to in case there's no animation.

Some melee class weapons don't work with NPCs as they're treated like a gun. Would it be possible to have a list that is an exception to this mod not affecting those melee class weapon? This also ties back to the more than 1 animation suggestion.
1. Yep, you got it right.
2. I'll try to fix this
3. I'll add this
4. Uh, alright.
Limakenori  [developer] 18 Jun, 2024 @ 8:16pm 
Originally posted by Screddy:
the metrocops still slap me after they die
I'll try to fix this.
SonicUnleashedXY 18 Jun, 2024 @ 11:17pm 
Originally posted by Limakenori:
1. Yep, you got it right.
2. I'll try to fix this
3. I'll add this
4. Uh, alright.
Cool, thanks for the information.

To add more context to 4. I'm more using this addon to sudo solve the issue of NPC not being able to melee with the melee weapons. The HL2 melee weapons (Stun & Crowbar) included in Garry's Mod seems to work fine. It's mainly for the other weapons using a different base such as ArcCW or TFA. I'm not sure why they try to shoot it when it's melee only.

This isn't your problem to solve hence why I suggested the whitelist for melee weapons which can be used with your system.

Last thing, I did noticed you got a toggle for aggression when unarmed. Is it possible to apply this to the melee whitelisted as well?
Last edited by SonicUnleashedXY; 18 Jun, 2024 @ 11:24pm
SonicUnleashedXY 19 Jun, 2024 @ 4:30am 
The melee weapons whitelist system seems to not work. By that I mean any melee weapons will melee when near an enemy including the medkit which I removed from the whitelist. Not sure if I need to reload the game to apply changes or not.

I'm assuming this system is in place to prevent working NPC melee weapons from breaking. I've not tried using the HL2 Crowbar or Stun yet with the additional animation to see if that causes issues such as double damage via the weapon & this melee system.
Limakenori  [developer] 19 Jun, 2024 @ 4:34am 
Originally posted by SonicUnleashedXY:
The melee weapons whitelist system seems to not work. By that I mean any melee weapons will melee when near an enemy including the medkit which I removed from the whitelist. Not sure if I need to reload the game to apply changes or not.

I'm assuming this system is in place to prevent working NPC melee weapons from breaking. I've not tried using the HL2 Crowbar or Stun yet with the additional animation to see if that causes issues such as double damage via the weapon & this melee system.
Medkit isn't a melee weapon. I just put it in the white list because I didn't want the white list to be empty. Only weapons that has "melee" hold type counts as melee weapon(default weapons with this hold type are: weapon_crowbar and weapon_stunstick).
SonicUnleashedXY 19 Jun, 2024 @ 5:12am 
Originally posted by Limakenori:
Medkit isn't a melee weapon. I just put it in the white list because I didn't want the white list to be empty. Only weapons that has "melee" hold type counts as melee weapon(default weapons with this hold type are: weapon_crowbar and weapon_stunstick).
You're right, that's likely why the other melee weapons don't work as melee then. Also tested my other theory & it indeed does double damage with both stun & melee animation. Kinda cool in a way but not an issue to me.

I'm currently trying to add more than 2 animations to a NPC & it seems to only add the first one. I'm trying to add thrust & kickdoorbaton to npc_metropolice but only seems to add 1 or the other. Is the limit currently set to 2 given swing is already the default for this NPC?

Also it seems the melee system can still trigger after dying. I don't think there's a check after the time to damage to see if the user is alive before doing the damage. I had 2 NPC trade kills with 1 being a phantom hit from the other.
Last edited by SonicUnleashedXY; 19 Jun, 2024 @ 5:14am
Blargh Hurek 24 Jun, 2024 @ 2:02am 
Is it possible to add a setting to turn off npc melee for only enemies in options? Basically we can take control of it if we only want the friendly npcs to have the npc melee function. At least we don't have to deal with the combine police having to phantom hit us after death.
Limakenori  [developer] 24 Jun, 2024 @ 2:04am 
Originally posted by Blargh Hurek:
Is it possible to add a setting to turn off npc melee for only enemies in options? Basically we can take control of it if we only want the friendly npcs to have the npc melee function. At least we don't have to deal with the combine police having to phantom hit us after death.
Check commands
< >
Showing 1-15 of 23 comments
Per page: 1530 50