Actor transformation help!

mrmarguu

Villager
Member
Joined
Apr 19, 2020
Messages
5
Reaction score
0
First Language
English
Primarily Uses
RMMV
Ok so I'm using Yanfly's Actor Transformation Script and my actors transform fine in battle and both stat boosts and appearance revert to normal once battle ends regardless but they keep the transformation appearance when KOed. If they are, they lose the stat boosts as planned but retain the transformed appearance until they are revived.

What I want is for the actor's appearance and stats to revert to normal as soon as or before Knockout takes effect (0 HP, instant death etc.).
I have edited the sprites in Photoshop so that the SV Actor is the normal form when lying down, but the picture of the character remains the same in the actor battle status window at the bottom of the screen (Yanfly's Battle Status Window plugin).

It's worth mentioning that I have separate stat slots for every single character as all of their transformations are unique.

This is the second time I am posting this because I have had no responses on here which leads me to believe that the forums are either dead or no one has a clue and I'm sure I'm not the first person to have this problem.
 

Soulrender

Jack Of All Trades
Veteran
Joined
Jan 12, 2019
Messages
577
Reaction score
307
First Language
Poland
Primarily Uses
RMMV
If I understand correctly you wish to revert your character before he reaches 0 HP, that is easy:
Code:
<Custom Establish Effect>
if (user._hp <= 10){
// 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();
user.recoverAll();
}
</Custom Establish Effect>
if "user" will not work, try either "target" or "this"

This is the same code from removing state that transforms player, but it will revert character
player to normal, when you recieve damage and HP is lower or equal 10.

Correct me someone if I'm wrong, but I didn't use MV for a while.
 
Last edited:

mrmarguu

Villager
Member
Joined
Apr 19, 2020
Messages
5
Reaction score
0
First Language
English
Primarily Uses
RMMV
If I understand correctly you wish to revert your character before he reaches 0 HP, that is easy:
Code:
<Custom Establish Effect>
if (user._hp <= 10){
// 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();
user.recoverAll();
}
</Custom Establish Effect>
if "user" will not work, try either "target" or "this"

This is the same code from removing state that transforms player, but it will revert character
player to normal, when you recieve damage and HP is lower or equal 10.

Correct me someone if I'm wrong, but I didn't use MV for a while.
It's not quite right however I think I can adjust the coding.

The normal form needs to occur upon KO.

I'll just change the code to hp <=0 instead.

To be sure, which notetag should I paste the code? Knockout or Transform state?
 

Soulrender

Jack Of All Trades
Veteran
Joined
Jan 12, 2019
Messages
577
Reaction score
307
First Language
Poland
Primarily Uses
RMMV
To Transform state. However in this situation I believe your player will fall and transforming won't work.
So my advice is you modify your KO State that last 1 turn and paste it in your KO state, it will look like that transformation has hidden ability that saves hero from death, I saw something like that in a movie, in Underworld II - Evolution, Michael Corvin when transformed into werewolf was stabbed on a pipe, but after some time he came back to life.
Code:
<Custom Remove Effect>
user.gainHp(user.mhp)
user.gainMp(user.mmp)
</Custom Remove Effect>
 
Last edited:

mrmarguu

Villager
Member
Joined
Apr 19, 2020
Messages
5
Reaction score
0
First Language
English
Primarily Uses
RMMV
To Transform state. However in this situation I believe your player will fall and transforming won't work.
So my advice is you modify your KO State that last 1 turn and paste it in your KO state, it will look like that transformation has hidden ability that saves hero from death, I saw something like that in a movie, in Underworld II - Evolution, Michael Corvin when transformed into werewolf was stabbed on a pipe, but after some time he came back to life.
Code:
<Custom Remove Effect>
user.gainHp(user.mhp)
user.gainMp(user.mmp)
</Custom Remove Effect>
Ah! You've just pointed out the source of my frustration. So I just need to make it so my Knockout state takes an extra turn before the actor falls?
 

Soulrender

Jack Of All Trades
Veteran
Joined
Jan 12, 2019
Messages
577
Reaction score
307
First Language
Poland
Primarily Uses
RMMV
Yes, unfourtunately I didn't meet any solution that will override that problem, also for my project there was no need to do that. I Mean no... In my example it will look that:
- Transformed player dies
- His look changes back to normal but is dead (wait 1 turn)
- Player get's back to live with 100% HP and MP
 

mrmarguu

Villager
Member
Joined
Apr 19, 2020
Messages
5
Reaction score
0
First Language
English
Primarily Uses
RMMV
Yes, unfourtunately I didn't meet any solution that will override that problem, also for my project there was no need to do that. I Mean no... In my example it will look that:
- Transformed player dies
- His look changes back to normal but is dead (wait 1 turn)
- Player get's back to live with 100% HP and MP
@Soulrender I have to thank you for your help.

I solved the problem I was having by actually pasting the same JavaScript you enter for the state notes except enter the images of your regular state actor and remove the first section that backs up the previous images.

You helped point me in the right direction and feel free to use this idea if you try something similar.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

I spoke with hudell and many programmer about the Window_BattleLog class and we all just agreed to pretend this class just doesn't exists lol
I haven't been able to solidify a cohesive plot so dropped out of a game jam but, on a fun note, I pre-ordered MZ today! :LZSwink:
So I just spent the weekend...playing my own game. The one I released last year. Yep you heard that right.
Goal for MZ? None... I'm still curious how to finish my VXA project and how it looks like when it actually finished. Which will take at least another two years. Coming late again to the party.

Forum statistics

Threads
100,657
Messages
978,136
Members
132,268
Latest member
janetjoradan
Top