Hi everyone.
I am trying to use a transformation for a character in battle for MZ. I watched Yanflys video and got the code for the state on this forum. I also use stella and have the states core active. I eventually want a character to change into a werewolf for a set number of turns. When I try it in a battle nothing happens. I'm still new at this too. Any help is apperciated. Heres the code and the images for states and skills:
<JS On Add State>
if (user.isActor()) {
user._prevCharName ??= user._characterName;
user._prevCharIndex ??= user._characterIndex;
user._prevFaceName ??= user._faceName;
user._prevFaceIndex ??= user._faceIndex;
user._prevBattlerName ??= user._battlerName;
const charName = "SF_Actor1";
const charIndex = 0;
const faceName = "SF_Actor1";
const faceIndex = 0;
const battlerName = "SF_Actor1_1";
user.setCharacterImage(charName, charIndex);
user.setFaceImage(faceName, faceIndex);
user.setBattlerImage(battlerName);
user.refresh();
}
</JS On Add State>
<JS On Erase State>
const charName = user._prevCharName;
const charIndex = user._prevCharIndex;
const faceName = user._prevFaceName;
const faceIndex = user._prevFaceIndex;
const battlerName = user._prevBattlerName;
user.setCharacterImage(charName, charIndex);
user.setFaceImage(faceName, faceIndex);
user.setBattlerImage(battlerName);
delete user._prevCharacterName;
delete user._prevCharacterIndex;
delete user._prevFaceName;
delete user._prevFaceIndex;
delete user._prevBattlerName;
user.refresh();
</JS On Erase State>
I am trying to use a transformation for a character in battle for MZ. I watched Yanflys video and got the code for the state on this forum. I also use stella and have the states core active. I eventually want a character to change into a werewolf for a set number of turns. When I try it in a battle nothing happens. I'm still new at this too. Any help is apperciated. Heres the code and the images for states and skills:
<JS On Add State>
if (user.isActor()) {
user._prevCharName ??= user._characterName;
user._prevCharIndex ??= user._characterIndex;
user._prevFaceName ??= user._faceName;
user._prevFaceIndex ??= user._faceIndex;
user._prevBattlerName ??= user._battlerName;
const charName = "SF_Actor1";
const charIndex = 0;
const faceName = "SF_Actor1";
const faceIndex = 0;
const battlerName = "SF_Actor1_1";
user.setCharacterImage(charName, charIndex);
user.setFaceImage(faceName, faceIndex);
user.setBattlerImage(battlerName);
user.refresh();
}
</JS On Add State>
<JS On Erase State>
const charName = user._prevCharName;
const charIndex = user._prevCharIndex;
const faceName = user._prevFaceName;
const faceIndex = user._prevFaceIndex;
const battlerName = user._prevBattlerName;
user.setCharacterImage(charName, charIndex);
user.setFaceImage(faceName, faceIndex);
user.setBattlerImage(battlerName);
delete user._prevCharacterName;
delete user._prevCharacterIndex;
delete user._prevFaceName;
delete user._prevFaceIndex;
delete user._prevBattlerName;
user.refresh();
</JS On Erase State>