Garry's Mod
Auto Remove Stuck NPCs
107 件のコメント
Peluceus Donmian 3月19日 21時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日 13時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日 22時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日 15時56分 
Oh if only. But alas, it seems to just be a distant dream.
Coffee Man  [作成者] 2024年3月21日 15時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日 0時39分 
This is a blessing.
ZachNohKap 2024年3月6日 16時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日 0時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日 23時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日 21時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日 21時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日 21時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日 21時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日 21時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日 21時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日 17時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日 14時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日 0時43分 
BUG
Combine unloading from dropships get deleted immediatly
loklal_foxymoksi 2024年3月4日 0時37分 
nice thanks a lot dude!:p03::GDNormal::eli::p2chell::resmile::steamhappy:
nasty rat 2024年3月3日 18時37分 
Aw crap John! My leg is-

(randomly dissapears all of a sudden)
evil foll ginlan davbrer witer 2024年3月3日 15時58分 
finally those idiots won't get stuck in eachother
thex710 2024年3月3日 15時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日 19時22分 
please add support for rebels
aeiou [DFS] 2024年3月2日 18時13分 
Cool.
Dragai 2024年3月2日 17時07分 
please make it work for all npcs like nextbots
izyooil moai 2024年3月2日 15時44分 
fuck you patrick imma search up starfish recipe
N00bGsav™ 2024年3月2日 15時22分 
Patrick Why?