I'm looking for a plugin that allows you to run a common event on equip/unequip. I've seen this for other engines but haven't had any luck finding something like this for MV. I'd be really grateful for any help!
Things like treasure/etc appearing that otherwise wouldn't be visible unless the amour was equipped, I'd like to find out how to have the players sprite change to show them wearing the equipped armor, too. There's probably something for that though, I'll have to look.
@InkPotion You could use my WAY_CustomOnEquipEval Plugin. It allows you to run code when the actor equips/unequips items. https://forums.rpgmakerweb.com/inde...-addons-newest-way_customfaceimageeval.78979/ It would require the use of Lunatic Code (scriptcalls) tho. To change the graphics when the actor equips an item: Just change the test, test2, test3 to the actual filenames. Code: <Custom On Equip Eval> user._prevCharName = user._prevCharName || user._characterName; user._prevCharIndex = user._prevCharIndex || user._characterIndex; user._prevFaceName = user._prevFaceName || user._faceName; user._prevFaceIndex = user._prevFaceIndex || user._faceIndex; user._prevBattlerName = user._prevBattlerName || user._battlerName; user.setFaceImage("test", 0); user.setCharacterImage("test2", 0); user.setBattlerImage("test3"); user.refresh(); $gamePlayer.refresh(); </Custom On Equip Eval> This would reset it to the old graphics, when the actor unequips the item: Code: <Custom On Remove Equip Eval> user.setCharacterImage(user._prevCharName, user._prevCharIndex); user.setFaceImage(user._prevFaceName, user._prevFaceIndex); user.setBattlerImage(user._prevBattlerName ); user.refresh(); user._prevCharName = undefined; user._prevCharIndex = undefined; user._prevFaceName = undefined; user._prevFaceIndex = undefined; user._prevBattlerName = undefined; $gamePlayer.refresh(); </Custom On Remove Equip Eval> Do you use a switch to let the treasure appear on map? Because then you could just turn on the switch when the actor equips an item: Code: <Custom On Equip Eval> $gameSwitches.setValue(ID, true); </Custom On Equip Eval>
Thanks for the reply! It automatically put the armor in my inventory when I started the game, and runs the switches without equipping it I couldn't seem to make it work how I'd like without using common events, but thank you so much for the help regardless!
Hi. Im trying to adapt this to my game. But i get an error. Spoiler: Code <Custom On Equip Eval> user._prevFaceName = user._prevFaceName || user._faceName; user._prevFaceIndex = user._prevFaceIndex || user._faceIndex; if (user.actorId() = 2){ user.setFaceImage("A2Armadura1", 0); user.refresh(); }if (user.actorId() = 3){ user.setFaceImage("A3Armadura1", 0); user.refresh()); } $gamePlayer.refresh(); </Custom On Equip Eval> I´m trying to have different outcomes whit different actors
@Tatsumaro 1. For Comparison you need to use the == or === operator and not the =. Because the = is only for assignment. 2. On the second refresh, there's a brace too much. So it should be: Code: <Custom On Equip Eval> user._prevFaceName = user._prevFaceName || user._faceName; user._prevFaceIndex = user._prevFaceIndex || user._faceIndex; if (user.actorId() === 2){ user.setFaceImage("A2Armadura1", 0); user.refresh(); }if (user.actorId() === 3){ user.setFaceImage("A3Armadura1", 0); user.refresh(); } $gamePlayer.refresh(); </Custom On Equip Eval>
Hello waynee sorry to bother you but i'm getting a error msg whit this code. <Custom Equip Requirement Condition> if ($gameActors.actor($gameParty._targetActorId).skills().contains($dataSkills[648])){ condition = true; } else { condition = false; } </Custom Equip Requirement Condition> i'm trying to force the player to learn a skill before he can equip a weapon. <Custom Equip Requirement Condition> if ($gameActors.actor($gameParty._targetActorId).hasSkill(648)){ condition = true; } else { condition = false; } </Custom Equip Requirement Condition> same error
@Tatsumaro But that's not really related to a plugin of mine right? It's from a Yanfly plugin, isnt it? Try this. Code: <Custom Equip Requirement Condition> if (user.hasSkill(648)) { condition = true; } else { condition = false; } </Custom Equip Requirement Condition>
X) sorry you are correct, its YEP_X_EquipRequirements Lunatic Mode... i fill stupid but thanks for the help I have a problem, do you know if i can use this code in Lunatic Mode=? Spoiler: code <Custom Equip Requirement Condition> if (SceneManager._scene.constructor == Scene_Shop) { condition = true; } else { if (user.hasSkill(648)) { condition = true; } else { condition = false; } </Custom Equip Requirement Condition>
So this works great, I love it. Except one small problem I can't figure out... When I change from one weapon to the next, it uses the unequip code and makes my character hold no weapon, unless I take one weapon on and off again. How can I fix this? I am making my main character be able to use several types of weapons.. so lots of taking on and off of gear... thanks!
@Anastasiia https://raw.githubusercontent.com/waynee95/mv-plugins/master/dist/WAY_CustomOnEquipEval.js That version should fix the issue.