DestroyItem

Archive of the older Feature Request Forum Posts
Locked
goldfish
New User
Posts: 5
Joined: Wed Mar 01, 2006 4:47 pm

DestroyItem

Post by goldfish »

Would it be possible to add a flag to DestroyItem, so we can choose if it runs its unequip script? Be pretty handy.
Yukiko
Distro Developer
Posts: 2826
Joined: Thu Feb 02, 2006 1:41 pm

Post by Yukiko »

This can be scripted in the DestroyScript for the item.
Marilla

Post by Marilla »

You could do something like this:

Code: Select all

var item := whatever...;
SetObjProperty(item, "#nounequip", 1);
DestroyItem(item);
Then, in the UnequipScript, simply test for the #nounequip cprop. I recommend returning 1 to allow the item to be unequipped, even if it's also being destroyed.

I also recommend you make it a #-prefixed cprop so that accidental settings of the prop don't eat up save file space. However, if you have situations where you KNOW a certain item should NEVER run an Unequipscript, you could use a permanent cprop, instead (so that you don't need to use two different ones)
Locked