Page 1 of 1

How to destroy items in a sack ?

Posted: Wed Nov 28, 2012 6:37 pm
by Xanathar
Has anyone found a way to destroy an item in a sack ?
The sack has no removeItem, and destroy() seems to leave a zombie object there which will crash the game sooner or later.

Re: How to destroy items in a sack ?

Posted: Wed Nov 28, 2012 6:48 pm
by Batty
Those great methods in the GrimQ don't do it? I'm working through them now, thanks for that.

If you move the sack using your methods couldn't you just replace the sack sans said item?

Using your methods, you could try spawning a "ghost party" in a far off square and spread the contents of the sack into a ghost champ's inventory slots. Destroy (removeItem()) the item, then reinstall the items into a sack and return to the origin.

Keep in mind I've only sent single items back & forth to the ghost party so this is 95% untested fiction. :D

edit: coffee just hit so I'm full of ideas. You could just leave the offending item in a holding square to sit in purgatory forever. It wouldn't be destroyed but would be effectively removed from the game.

Re: How to destroy items in a sack ?

Posted: Wed Nov 28, 2012 7:11 pm
by Xanathar
Those great methods in the GrimQ don't do it? I'm working through them now, thanks for that.
It's exactly to fix a bug in grimq :D
If you move the sack using your methods couldn't you just replace the sack sans said item?
In theory, yes, it's feasible and without a big effort too (just a slightly modified version of copyItem). The problem is that contents in sacks are rearranged when copying (as we can get the content and add them back, but without the exact cell because of limits of the current scripting functions offered by the game) and I was hoping for a cleaner solution (one more transparent for the player).

I'll try to implement some of this later today (better than crashing, which is what the current version does :oops:), unless someone with infinite knowledge (maybe, I don't know, living in Finland and working for some well known company making dungeon crawlers in the XXI century cough cough) has a clever trick to pull out :lol:

Thanks!

Re: How to destroy items in a sack ?

Posted: Wed Nov 28, 2012 10:19 pm
by petri
Oops, it looks like I've completely forgotten to add Item:removeItem(). Thanks!

Re: How to destroy items in a sack ?

Posted: Wed Nov 28, 2012 10:34 pm
by Xanathar
Thanks to you! :)

Re: How to destroy items in a sack ?

Posted: Wed Nov 28, 2012 11:57 pm
by Komag
wait a sec, you mean that's currently available but undocumented, or will be in the future patch? :shock: