- Joined
- Jan 17, 2014
- Messages
- 67
- Reaction score
- 30
- First Language
- Spanish
- Primarily Uses
- RMMV
Out of my tests I managed to discover you just equip a null in order to unequip. Just today I noticed it's not just "a way to do so", but the default behavior MV has.
I'm making a plugin where it does something with a notetag upon equiping any kind of item as long as it has a specific notetag, and undoes it upon unequiping that piece of equipment.
I came again across changeEquip function so...
I'm only missing the how to check the actor who called changeEquip or the item that's being unequiped in order to go on. Any ideas or suggestions?
(I'm guessing it's something on the lines of "this.")
[EDIT]No, I'm sure, it's this.something. I might go out this issue by myself....
I'm making a plugin where it does something with a notetag upon equiping any kind of item as long as it has a specific notetag, and undoes it upon unequiping that piece of equipment.
I came again across changeEquip function so...
Code:
(function()
{
var saveTheOriginalChangeEquip=Game_Actor.prototype.changeEquip;
Game_Actor.prototype.changeEquip = function(slot, item)
{
if (item)
{
var match = item.note.match(/.*<notetag>.*/i);
if (match)
{
//do stuff
}
saveTheOriginalChangeEquip.call(this,slot,item); //then equip it
}
else
{
//Check the gameActor who called this
//Check the slot to unequip
//Check the item's notetag
//undo stuff
saveTheOriginalChangeEquip.call(this,slot,id); //then unequip it
}
}
})();
(I'm guessing it's something on the lines of "this.")
[EDIT]No, I'm sure, it's this.something. I might go out this issue by myself....
Last edited:
