Goal:
I need this flying state to change the sv_actor sprite sheet when applied and then change it back when removed.
I also need this to work with enemies somehow.
I'm currently using Visustella's Battle Core to support enemies with sv_actor sprites.
Background:
I'm working on a flying mechanic for side view battles.
I've created a state called "Flying" (ID 13) which affects both actors and enemies.
The visual aspect currently relies on Visustella's Visual State Effects, specifically the hover notetags.
This is working reliably, but the hover effect is intended as a placeholder.
Its not ideal mostly because the sideview sprites are animated for ground based attacks. So I'll be drawing or commissioning flying variants of each actor and enemy that's capable of flying.
References:
In July there was a post about states changing sv_actor. Kes made a great suggestion there - though it only pertains to actors and it does a little more than I'm concerned with at the moment since I'm not using portraits or faces.
Any guidance or assistance would be greatly appreciated here.
Thanks 🙂
I need this flying state to change the sv_actor sprite sheet when applied and then change it back when removed.
I also need this to work with enemies somehow.
I'm currently using Visustella's Battle Core to support enemies with sv_actor sprites.
Background:
I'm working on a flying mechanic for side view battles.
I've created a state called "Flying" (ID 13) which affects both actors and enemies.
The visual aspect currently relies on Visustella's Visual State Effects, specifically the hover notetags.
This is working reliably, but the hover effect is intended as a placeholder.
Its not ideal mostly because the sideview sprites are animated for ground based attacks. So I'll be drawing or commissioning flying variants of each actor and enemy that's capable of flying.
References:
In July there was a post about states changing sv_actor. Kes made a great suggestion there - though it only pertains to actors and it does a little more than I'm concerned with at the moment since I'm not using portraits or faces.
Code:
<JS On Add State>
if (target.isActor()) {
target._prevCharName ??= target._characterName;
target._prevCharIndex ??= target._characterIndex;
target._prevFaceName ??= target._faceName;
target._prevFaceIndex ??= target._faceIndex;
target._prevBattlerName ??= target._battlerName;
const charName = "[name of sprite sheet]";
const charIndex = [actor index, starting at 0 for player];
const faceName = "[name of the face sprite sheet]";
const faceIndex = [whereabouts on that sprite sheet it is, starting at 0];
const battlerName = "[name of new battler sheet]";
target.setCharacterImage(charName, charIndex);
target.setFaceImage(faceName, faceIndex);
target.setBattlerImage(battlerName);
target.refresh();
}
</JS On Add State>
<JS On Erase State>
const charName = target._prevCharName;
const charIndex = target._prevCharIndex;
const faceName = target._prevFaceName;
const faceIndex = target._prevFaceIndex;
const battlerName = target._prevBattlerName;
target.setCharacterImage(charName, charIndex);
target.setFaceImage(faceName, faceIndex);
target.setBattlerImage(battlerName);
delete target._prevCharacterName;
delete target._prevCharacterIndex;
delete target._prevFaceName;
delete target._prevFaceIndex;
delete target._prevBattlerName;
target.refresh();
</JS On Erase State>
Any guidance or assistance would be greatly appreciated here.
Thanks 🙂