Item Type Spawners

If Wishes were UOX Coders, we'd be done by now ;P Post your wishes/suggestions for UOX3 changes/improvements here.
Post Reply
dragon slayer
UOX3 Guru
Posts: 776
Joined: Thu Dec 21, 2006 7:37 am
Has thanked: 4 times
Been thanked: 26 times

Item Type Spawners

Post by dragon slayer »

I have noticed if you remove a spawner for item or npc they will stay in the world but the spawner is gone.

I was thinking if we did 'remove on any spawner type item or npc it would remove the item and npcs that is still attached to it as well. would make cleaning up events a little easier.
These users thanked the author dragon slayer for the post:
Humility
Humility
UOX3 Neophyte
Posts: 28
Joined: Mon Nov 21, 2016 7:51 am
Has thanked: 4 times
Been thanked: 5 times

Post by Humility »

I had that issue with the loot chest on hirelings, well, sort of.
I solved it with the 'yeetus self deleetus' script. Mine uses a timer formy application, but coupling a timer with a tag, you could store a reference to the spawner item and when the spawner becomes null, the spawned deco and event items slated for deletion will clean themselves up.

Code: Select all

function onTimer(timerObj, timerID) {// yeetus self deleetus
	if (timerID == 1) {
		var parentObj = CalcItemFromSer(parseInt(timerObj.GetTag(mySpawner)));
		if (!parentObj){
			timerObj.Delete();
		}
	}
	return false;
}
Post Reply