Garry's Mod

Garry's Mod

Auto Remove Stuck NPCs
107 条留言
Peluceus Donmian 3 月 19 日 下午 9:55 
Yeah it's a great mod for use with ZINW but it does conflict with Zippy's Active Ragdoll mod. It's a shame because with ZINW this is an incredibly important mod but I also like to be incentivized to double tap
Hatshepherd 2024 年 12 月 13 日 上午 5:44 
I agree
Gorigo 2024 年 11 月 14 日 上午 6:28 
theres should be option to check if entity cant move
小卡齐娜3095 2024 年 8 月 9 日 上午 3:31 
How this will works on a custom npc ???
Clefable_Recon ʕ º ᴥ ºʔ 2024 年 7 月 17 日 下午 1:05 
Would be nice alternative option to teleport any friendly ally warp next to you, and add Resistance to the option pool
ZachNohKap 2024 年 3 月 30 日 下午 10:15 
@Winn thank you king!
Winn 2024 年 3 月 30 日 上午 10:26 
Conflicts with Zippy's Active Ragdoll mod, they are detected as stuck when they ragdoll and are instantly deleted.
MrGermandeutsch 2024 年 3 月 21 日 下午 3:56 
Oh if only. But alas, it seems to just be a distant dream.
Coffee Man  [作者] 2024 年 3 月 21 日 下午 3:54 
If only you'd have been specifically warned about that specific side effect in the description or something, am I right?
tactical dude 2024 年 3 月 21 日 下午 12:24 
Sadly it takes away some or even most of the npcs on the hl2 maps.
MrGermandeutsch 2024 年 3 月 7 日 上午 12:39 
This is a blessing.
ZachNohKap 2024 年 3 月 6 日 下午 4:02 
Dude. You literally have a catgirl as your pfp.
Ben_19M 2024 年 3 月 6 日 上午 10:06 
youre rather drab, mr mud
My Name is Mud 2024 年 3 月 6 日 上午 10:05 
and i dress in blue yes navy blue
Ben_19M 2024 年 3 月 6 日 上午 9:38 
is this the most boring sonsabitch ive ever seen?
Tixerx 2024 年 3 月 6 日 上午 6:36 
Hello mud
My Name is Mud 2024 年 3 月 6 日 上午 6:26 
my name is mud
[FR] Lea 2024 年 3 月 6 日 上午 12:01 
Sorry for the formatting, the [code] tag is not supported in comments, I didn't know that, we lost the indentation. I sent you an invitation if you would like to discuss more, it will be with pleasure, I have a lot to learn ^^ Thank you
[FR] Lea 2024 年 3 月 5 日 下午 11:56 
@Coffee Man Thank you for this info !!
This code checks if the position of an npc has changed during 10s otherwise deletes it
[code]
local monitoredNPCs = {
"npc_zombie",
"npc_fastzombie",
"npc_poisonzombie",
"npc_zombine"
}

hook.Add("OnEntityCreated", "CheckStuckNPCs", function(_ent)
if GetConVar("a_cleanstucknpc"):GetBool() then
if IsValid(_ent) and _ent:IsNPC() then
if table.HasValue(monitoredNPCs, _ent:GetClass()) then
timer.Simple(1, function()
local _startpos = _ent:GetPos()
timer.Create(
tostring(_ent), 10, 0, function()
if IsValid(_ent) then
local _currentpos = _ent:GetPos()
if (_currentpos == _startpos) then
_ent:Remove()
timer.Remove(tostring(_ent))
else
_startpos = _currentpos
end
end
end
)
end
)
end
end
end
end)[/code]
Coffee Man  [作者] 2024 年 3 月 5 日 下午 9:44 
@dvpweb

The structure of a trace in Gmod's Wiki uses start: https://wiki.facepunch.com/gmod/Structures/Trace

You can see a code example here as well: https://wiki.facepunch.com/gmod/util.TraceLine
Coffee Man  [作者] 2024 年 3 月 5 日 下午 9:41 
@Doxhot
You're spawning wholeass dropships randomly in sandbox maps that can land and deploy soldiers xd? For that particular case, you'd need a solid 10 seconds before the NPC checks out ok. But the timer I put for the removal check is there to both make sure the NPC is initialized properly and to allow a quick cleanup if you're constantly spawning NPCs in close proximity to you as well.

@dvpweb
You can modify it, fork it, publish your version, whatever, I let anyone do that. But you still didn't explain why should start be changed with startpos. NPCs disappearing is probably due to how that specific spawner works. I may update this release and change the timer to something like 2 or 3 seconds to hopefully add a little bit more compatibility in general.
[FR] Lea 2024 年 3 月 5 日 下午 9:27 
@Coffee Man Yes sorry, I realized afterwards that my dev was becoming a little off topic my request is more linked to another addon and what's more I put my messages in FR without translating them. In fact, start does not work, you use endpos and logically I told myself that it was startpos to use in the query and indeed, it works better.
UCEY 2024 年 3 月 5 日 下午 9:23 
I never play campaign maps, but that's fair. I like to avoid generic auto-summoning methods if I can
[FR] Lea 2024 年 3 月 5 日 下午 9:21 
This is exactly what I modified for the Simple Horde Mode addon, I put at least 10 seconds between each npc position test otherwise, they disappear shortly after being created. I will see about publishing the script
Coffee Man  [作者] 2024 年 3 月 5 日 下午 9:17 
@Doxhot
Even if you increase the timer to prevent that specific case from happening, the addon is still going to significantly break a lot of other cases if used in a campaign map. You can have a timer up to 15 seconds and a lot of NPCs in campaign maps will still be removed when they shouldn't because of how they're initially placed. Thats why I'm stating in the description to avoid using the addon when playing in campaign maps entirely. You should mainly use it when you fill sandbox maps with randomly spawning NPCs.

@dvpweb
You've deleted and reposted your comment like 50 times. Why should start be changed with startpos exactly?
UCEY 2024 年 3 月 5 日 下午 5:44 
Is there any way to change the time until they're removed? This doesn't play well with the functional dropships addon and deletes people before they deploy properly
[FR] Lea 2024 年 3 月 5 日 下午 2:54 
I think we should replace "start" with "startpos"
For your information, I readapted the code for this addon
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/comments/2939410311
[FR] Lea 2024 年 3 月 5 日 上午 7:50 
Apparently, the list is in \steamapps\workshop\content\4000\3170702564\3170702564_via_crowbar.gma
Autumnis 2024 年 3 月 5 日 上午 5:15 
alrighty. i don't use em, was just curious.
Coffee Man  [作者] 2024 年 3 月 5 日 上午 5:05 
I use the Hassassin's AI in my game, I don't use hgrunts (yet). If they're not commonly used NPCs by the players or I don't use them myself, they won't be included to keep the addon as optimized as possible.

If you happen to use 'em, refer to the Limitations Tab in the description.
Autumnis 2024 年 3 月 5 日 上午 5:02 
if you're gonna count the assassins then why not the hgrunts?
Coffee Man  [作者] 2024 年 3 月 5 日 上午 1:40 
Yes, the black ops assassins from HLS. It's there to add compatibility with one of my other addons.

Hunters and other huge NPCs are pretty buggy if included in the allowed list, they end up getting removed often even in cases when they shouldn't.
Aperture Science Prototype XR7 2024 年 3 月 4 日 上午 11:47 
couple questions:
- what's monster_human_assassin? the HL1 black ops?
- what about hunters? they're pretty damn huge and have a much greater tendency to get stuck in hallways than the average combine soldier
TZS 2024 年 3 月 4 日 上午 11:41 
I'm really surprised it took this many years to finally be a mod like this here. This is gonna be one of those nice qol mods.
Awakened NPC. 2024 年 3 月 4 日 上午 11:15 
@Ernie the giant chicken bro really thought @Pyroshark got offended by a your mom joke even though he is obviously joking.
Raylen 2024 年 3 月 4 日 上午 7:42 
bro really got offended by a mom joke
Coffee Man  [作者] 2024 年 3 月 4 日 上午 3:48 
Ok.

Your dad.
Jäger 2024 年 3 月 4 日 上午 3:32 
"your mom, etc." Take that back :(
bUh8 2024 年 3 月 4 日 上午 12:43 
BUG
Combine unloading from dropships get deleted immediatly
loklal_foxymoksi 2024 年 3 月 4 日 上午 12:37 
nice thanks a lot dude!:p03::GDNormal::eli::p2chell::resmile::steamhappy:
nasty rat 2024 年 3 月 3 日 下午 6:37 
Aw crap John! My leg is-

(randomly dissapears all of a sudden)
evil foll ginlan davbrer witer 2024 年 3 月 3 日 下午 3:58 
finally those idiots won't get stuck in eachother
thex710 2024 年 3 月 3 日 下午 3:52 
OK, I messed around with the script and managed to make it so ANY npc(SNPCs and Nextbots) can get removed, no need to add them to a list. Still a bit buggy though.
Cêcedilha 2024 年 3 月 3 日 上午 11:30 
why are we only getting this now???
AgentBuddPennCentral 2024 年 3 月 3 日 上午 9:50 
does it support SNPCS?
Rizz Monkey 2024 年 3 月 2 日 下午 7:22 
please add support for rebels
aeiou [DFS] 2024 年 3 月 2 日 下午 6:13 
Cool.
Dragai 2024 年 3 月 2 日 下午 5:07 
please make it work for all npcs like nextbots
izyooil moai 2024 年 3 月 2 日 下午 3:44 
fuck you patrick imma search up starfish recipe
N00bGsav™ 2024 年 3 月 2 日 下午 3:22 
Patrick Why?