So I've been playing RPG Maker MZ (My first RM) for around 4 days now, and I have the VisuMZ Plugins active. For at least the last 3 days I've been stuck because i want to change an actor's sprites when he activates a state. How it's supposed to work is: Thalassa (actor) uses a skill which grants him a state. This state works as a transformation that lasts 3 turns, then returns to normal and gives him a second state which doesn't allow him to use the transformation again in X amount of turns (This is also not working because even thought I place the ID, it gives him a different state from the one I wrote). When I test it, instead of switching the sprites as stated in the code, his battler image disappears and his face image doesn't change. After the state wears off everything returns to normal so at least that part works. I've been searching through the internet how to fix this but I've hit a brick wall.
This is the code I have on the state:
P.S. I have NO knowledge of coding in any way. What I've written I've found in different sites ^^;
This is the code I have on the state:
Code:
<JS On Add State>
if (user.isActor()) {
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;
if (user.actorId() === 0010) {
var charName = 'Thalassa';
var charIndex = 1;
var faceName = 'Thalassa';
var faceIndex = 5;
var battlerName = 'Thalassa2';
}
actor.setCharacterImage(charName, charIndex);
actor.setFaceImage(faceName, faceIndex);
actor.setBattlerImage(battlerName);
actor.refresh();
}
</JS On Add State>
<JS On Expire State>
var charName = user._prevCharName;
var charIndex = user._prevCharIndex;
var faceName = user._prevFaceName;
var faceIndex = user._prevFaceIndex;
var battlerName = user._prevBattlerName;
user.setCharacterImage(charName, charIndex);
user.setFaceImage(faceName, faceIndex);
user.setBattlerImage(battlerName);
user._priorityCharacterName = undefined;
user._priorityCharacterIndex = undefined;
user._prevFaceName = undefined;
user._prevFaceIndex = undefined;
user._priorityFaceName = undefined;
user._priorityFaceIndex = undefined;
user._prevFaceName = undefined;
user._prevFaceIndex = undefined;
user._priorityBattlerName = undefined;
user._prevBattlerName = undefined;
user.addState(0034)
</JS On Expire State>
P.S. I have NO knowledge of coding in any way. What I've written I've found in different sites ^^;