Removing or Despawning (by killing them) NPCs cause remaining NPC to glitch while they walk #998

Open
GomaTerzu opened this Issue Dec 1, 2016 · 7 comments

Projects

None yet

3 participants

@GomaTerzu

I have this simple denizen script. Every NPC with the flag "Soldat" walks randomly around with the "walk" command.

But, if I kill one NPC and it despawns or if I select one NPC and remove it completely remaining NPC that are currently walking, glitch together to a norht-west positon.

This causes some of them even dropping through the ground. I recorded a small gif for that:

https://gyazo.com/f0d651a0dc55c43606599cd2c75eb082

There are no errors in the denizen debug. I talked with mcmonkey about it and he told me to post it here.

http://one.denizenscript.com/paste/38078

This also causes errors like this when citizens tries to save. Relaoding or restarting fixxes it.

http://one.denizenscript.com/paste/38079

It sometimes even visually duplicates the glitched out NPC with no armor and movement. They also can't be damaged.

https://gyazo.com/3ce5c29d083a0c5baa81c387cebd68bd

I can select those "ghosts" but when I try to remove them I get this

http://one.denizenscript.com/paste/38080

This alltogether sometimes fucks up permanently (beyond repair through restarting) and I have to stop the server and remove the NPCs manually in the config

@mcmonkey4eva
Member

Last part is fixed by #996

@fullwall
Member
fullwall commented Dec 2, 2016

The error portion should be fixed in latest build.

@fullwall
Member
fullwall commented Dec 2, 2016

Finding it hard to reproduce the bugged pathing part.

@GomaTerzu

Hey fullwall. First thing I noticed is that the errors in my log are gone. No matter if the NPC glitched out, they don't procude errors on /citizens save.

But now a new behaviour appeared. Once the NPC glitches out I check for their coordinates with a simple denizen command <npc.location> and it says the correct coordinates the NPC should normally be. But if I teleport to the NPC with /npc tp I get in a spot where all my coordinates say NaN.

https://gyazo.com/dc44d796d0fe2bb643b2542c82b1956c

If I teleport to the location the denizen tag tells me I can briefly see the npc and then it disappears.

https://gyazo.com/73bf6b9a792fd507193676c9363791d3

But I can just teleport him with /npc tphere and he works fine again (at best he should actually be at the position it tells mehe is without having to "rescue" him 😄 )

Ok now the part with reproducing my problem that got me in this whole situation. I actually forgot to just add the script after the first sentence. Sorry about that.

http://one.denizenscript.com/paste/38092

Just build a wall (so they don't run away), start the loop, create some of them (command in the paste) and kill them with a sword for example). Now you should see them glitching together. after one or two kills

@fullwall
Member
fullwall commented Dec 4, 2016 edited

Can you try disabling gravity (/npc gravity)? Also what's your Citizens config?

@GomaTerzu

This is my config
http://one.denizenscript.com/paste/38122

If I disable Gravity the denizen walk command does not work anymore and the NPC won't move anymore.

@GomaTerzu

fullwall, mcmonkey - after days of trying I finally found a way to deal with this issue via script and it was kind of simple all along. I somehow may have a clue why it happens. Your suggestion fullwall to use the gravity command brought me to this

When I made /npc gravity I noticed that some NPC still walked a few steps and even made turns. This should definitly not happen so I noticed that the walk command for evey NPC is probbaly not finished and they kind of build up a queue of not finished walk commands and this may cause the issue. I have no idea why it affects other NPC on their death or why they fall through the ground but now I made a script where I use walk more carefully and stop it even everytime before I start it again.

http://one.denizenscript.com/paste/38124

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment