HPM-Plugins icon indicating copy to clipboard operation
HPM-Plugins copied to clipboard

Script Command - NPC Duplicate / Remove

Open Emistry opened this issue 6 years ago • 2 comments

Regarding https://github.com/dastgirp/HPM-Plugins/blob/master/src/plugins/npc-duplicate.c

If remove a NPC that running in a while-loop with sleep, the server will throw errors since the process are not terminated when remove the npc.

For example: if NPC A running this:

while (true) {
	showscript "ABC";
	sleep 1000;
}

then remove NPC A using the duplicateremove() , then the map-server will start throwing error for showscript.

[Error]: buildin_showscript: Script not attached. (id=0, rid=0, oid=110315097)

Emistry avatar Jun 23 '18 13:06 Emistry

some update:

this time i get a map crash when try to remove a duplicated npc by trigger npc event label that do the following: donpcevent "duplicate_npc_name#XXX::OnUpdate";

	OnUpdate:
		duplicateremove(strnpcinfo(3));
		end;

Image of Yaktocat

Any idea?

Emistry avatar Oct 21 '18 12:10 Emistry

For now, I would recommend that don't use npc to remove itself.

dastgirp avatar Oct 21 '18 14:10 dastgirp