DestroyItem
DestroyItem
Would it be possible to add a flag to DestroyItem, so we can choose if it runs its unequip script? Be pretty handy.
-
Marilla
You could do something like this:
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)
Code: Select all
var item := whatever...;
SetObjProperty(item, "#nounequip", 1);
DestroyItem(item);
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)