This could mostly be an issue of simply not knowing what the arguments are, but I am currently attempting to implement D&D 5E's WildShape as a mechanic the player can use. To accomplish this, I am using Yanfly's Battle Engine Core, Buff's and States Core, and SumRndmDde's Skill Extender.
The Skill itself has a custom cost, and the Skill Extendor allows the player to select the creature for the Actor to transform into.
The actual transformation is done using the code presented by one of Yanfly's Tips and Tricks, the shortened version being used here:
This code effectively is applied to a State that is assigned to an actor, which changes the images used while the state is in effect. When the state wears off, the images return to normal.
However, for my purposes, I need to have the actor change Class as well to match with their transformation. While this can be initially changed when the State is applied with a common event in the Skill's traits, I do not know how to change the Class back when the State is no longer applied. This would optimally keep the levels the same between changes. I suspect it would simply be a matter of either activating a Common Event in the Custom Remove Effect section or having the Class be archived above. I am afraid I just don't know what the arguments for doing so would be, or if I simply just have my theory wrong.
While not the main issue, I also hope to apply at least two other attributes to the skill:
Saving the Actors current health, so if their transformed state is removed by death/etc, they revert back to the condition they were in before.
Ideally, the ability to have the Actor break the state using a skill, both inside and out of battle. I admitidly probably wont be using this attribute for a current project, but I think this could aid in potential puzzlemaking down the line.
Appologies again for the long post, I'm afraid I'm not too good with Javascript yet and only get so much time to work on my game. Any help would be appreciated honestly.
The Skill itself has a custom cost, and the Skill Extendor allows the player to select the creature for the Actor to transform into.
The actual transformation is done using the code presented by one of Yanfly's Tips and Tricks, the shortened version being used here:
<Custom Apply Effect>
// Check if user is an actor.
if (user.isActor()) {
// Archive the previous settings.
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;
// Check if the actor ID is 1.
if (user.actorId() === 30) {
// The filename of the character graphic without the file extension.
var charName = '$Nature';
// The index of the character graphic used.
var charIndex = 2;
// The filename of the face graphic without the file extension.
var faceName = 'Nature';
// The index of of the face graphic used.
var faceIndex = 2;
// The filename of the battler graphic without the file extension.
var battlerName = 'Great Owl';
}
// Changes the character image to the setting applied from above.
user.setCharacterImage(charName, charIndex);
// Changes the face image to the setting applied from above.
user.setFaceImage(faceName, faceIndex);
// Changes the battler image from the setting applied from above.
user.setBattlerImage(battlerName);
// Refreshes the user's appearance.
user.refresh();
}
</Custom Apply Effect>
<Custom Remove Effect>
// Retrieve archived settings.
var charName = user._prevCharName;
var charIndex = user._prevCharIndex;
var faceName = user._prevFaceName;
var faceIndex = user._prevFaceIndex;
var battlerName = user._prevBattlerName;
// Changes the character image to the archived setting.
user.setCharacterImage(charName, charIndex);
// Changes the face image to the archived setting.
user.setFaceImage(faceName, faceIndex);
// Changes the battler image from the archived setting.
user.setBattlerImage(battlerName);
// Clear archived data.
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;
// Refreshes the user's appearance.
user.refresh();
</Custom Remove Effect>
This code effectively is applied to a State that is assigned to an actor, which changes the images used while the state is in effect. When the state wears off, the images return to normal.
However, for my purposes, I need to have the actor change Class as well to match with their transformation. While this can be initially changed when the State is applied with a common event in the Skill's traits, I do not know how to change the Class back when the State is no longer applied. This would optimally keep the levels the same between changes. I suspect it would simply be a matter of either activating a Common Event in the Custom Remove Effect section or having the Class be archived above. I am afraid I just don't know what the arguments for doing so would be, or if I simply just have my theory wrong.
While not the main issue, I also hope to apply at least two other attributes to the skill:
Saving the Actors current health, so if their transformed state is removed by death/etc, they revert back to the condition they were in before.
Ideally, the ability to have the Actor break the state using a skill, both inside and out of battle. I admitidly probably wont be using this attribute for a current project, but I think this could aid in potential puzzlemaking down the line.
Appologies again for the long post, I'm afraid I'm not too good with Javascript yet and only get so much time to work on my game. Any help would be appreciated honestly.