Change an Actor's face image depending on states.

RK DracoRoy

Fire Emblem RPG Gamer
Veteran
Joined
Jun 29, 2017
Messages
295
Reaction score
93
First Language
English
Primarily Uses
RMMV
Is there a certain plug-in that can change an actor's face depending on certain states like during battles and in the map?

Like for example, Actor 1 has the smile portrait as the default, but changes to an unhappy face portrait when inflicted with poison or at low / critical health state. It makes no sense for the actor to stay smiling when you're inflicted with a state that brings you to a disadvantage. Is it possible that it could be done with scripting?

I know a parallel common event could manage this somewhat, but there's the likelihood that it will cause a good deal of lag in-game and I don't want to go that route.
 

RK DracoRoy

Fire Emblem RPG Gamer
Veteran
Joined
Jun 29, 2017
Messages
295
Reaction score
93
First Language
English
Primarily Uses
RMMV
Unfortunately, not. I've used it once and due to my computer, the plug-in makes the actor window cluttered. I don't think that option is in there for some reason.

I wish there was another option that involved changing the actor faces, I don't know of any others that could accomplish this.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,210
Reaction score
14,247
First Language
English
Primarily Uses
RMMV
What happens if the actor has more than one state and the states have different expressions?
 

OnslaughtSupply

Ssshhh...
Veteran
Joined
May 14, 2017
Messages
731
Reaction score
766
First Language
English
Primarily Uses
RMMV
@Shaz - I would think the state with the highest priority would be ideal for a change of image.

Yanfly's Buffs & States Core & Lunatic Code.
Look up the Actor's Transformation Tutorial.

You can change the Actor's face image, battler, & map sprite, and have it revert back. You can also do an animation upon the state being removed to let the player have a visual que.

It could be worth looking into.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,210
Reaction score
14,247
First Language
English
Primarily Uses
RMMV
And if they have the same priority?
 

RK DracoRoy

Fire Emblem RPG Gamer
Veteran
Joined
Jun 29, 2017
Messages
295
Reaction score
93
First Language
English
Primarily Uses
RMMV
@OnslaughtSupply , this is really what I was looking for. Unfortunately, I must have did something wrong.

So I put this exact script in the state "Poison", I battle tested with just Actor 1 only and when she gets inflicted with the state, her face doesn't
change and the pop-up occurs.

To be clear, "Poison" has no turn count nor does it end in battle unless Actor 1 uses an item to nullify the state, but when I give the Poison state the turn count and when the turns are over, Actor 1 turns invisible.

I'm not sure if it has something to do with the file names I put in beside the "var" sections or what. Here's the script I did based on Yanfly's script:
--------------------------------------------------------------------------------
<Custom Apply Effect>
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() === 1) {
var charName = 'RK DracoRoy - Sprite Pack 1';
var charIndex = 0;
var faceName = 'RK DracoRoy - Luna';
var faceIndex = 2;
var battlerName = 'RK DracoRoy - Luna's Battle Sprite';
} else if (user.actorId() === 2) {
var charName = 'RK DracoRoy - Sprite Pack 1';
var charIndex = 1;
var faceName = 'RK DracoRoy - Kamui';
var faceIndex = 2;
var battlerName = 'RK DracoRoy - Kamui's Battle Sprite';
} else if (user.actorId() === 3) {
var charName = 'RK DracoRoy - Sprite Pack 1';
var charIndex = 2;
var faceName = 'RK DracoRoy - Roy';
var faceIndex = 2;
var battlerName = 'RK DracoRoy - Roy's Battle Sprite';
} else if (user.actorId() === 4) {
var charName = 'RK DracoRoy - Sprite Pack 1';
var charIndex = 3;
var faceName = 'RK DracoRoy - Lilina';
var faceIndex = 2;
var battlerName = 'RK DracoRoy - Lilina's Battle Sprite';
}
user.setCharacterImage(charName, charIndex);
user.setFaceImage(faceName, faceIndex);
user.setBattlerImage(battlerName);
user.refresh();
}
</Custom Apply Effect>

<Custom Remove Effect>
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.refresh();
</Custom Remove Effect>
----------------------------------------------------------------------------
Here is the pop-up that came and just in case, here are the pictures of the files for just Actor 1. I do wonder what mistake I made that caused this pop-up to occur. Such as turning invisible when a state is over, and not changing her face.
 

Attachments

  • Capture.PNG
    Capture.PNG
    146.2 KB · Views: 4
  • Capture1.PNG
    Capture1.PNG
    132.5 KB · Views: 4
  • Capture2.PNG
    Capture2.PNG
    137.7 KB · Views: 5
  • Capture3.PNG
    Capture3.PNG
    117.2 KB · Views: 4

kwanzaabot

Veteran
Veteran
Joined
Apr 6, 2012
Messages
72
Reaction score
14
First Language
English
Primarily Uses
I'm doing something very similar, with SumRndmDde's busts and icons menu.
What I did, was grab a script by Felski, over on Reddit (attached below) that modifies SumRndmDde's script to allow busts based on class, instead of just actors.

Then, I just use the following common event (class(1) is "Dead", btw). Then I attach a notetag to the "Dead" state that points to the bust I want to use.
Code:
If: Script: ($gameParty.members()[0].isStateAffected(1))
Script: $gameParty.members()[0].changeClass(1);
End
If: Script: ($gameParty.members()[1].isStateAffected(1))
Script: $gameParty.members()[1].changeClass(1);
End
If: Script: ($gameParty.members()[2].isStateAffected(1))
Script: $gameParty.members()[2].changeClass(1);
End
If: Script: ($gameParty.members()[3].isStateAffected(1))
Script: $gameParty.members()[3].changeClass(1);
End

As it's based on party members instead of individual actors, and as it only requires one state, it's a fairly lightweight event (no checking for all 10+ actors, for instance). It could probably do with some optimisation, but it does the job I need it to do.

You could probably adjust it based on your needs, but it might do the trick.

I should also point out I'm using SoulPour777's Equip Class Change plugin, so changing my actors back to another class is no problem here. My "Dead" status also disallows equipment from being equipped.
 

Attachments

  • SRD_AltMenuScreen_BustIcons_ClassAddin.js
    1.5 KB · Views: 0

RK DracoRoy

Fire Emblem RPG Gamer
Veteran
Joined
Jun 29, 2017
Messages
295
Reaction score
93
First Language
English
Primarily Uses
RMMV
I was able to solve my own problem, during the battle testing. All I wanted was to just change the actor faces, nothing more. So I used a much more simplified script that changed actor faces with no problem, when inflicted with a certain state.
----------------------------------------------------------------------------
<Custom Apply Effect>
if (user.isActor()) {
user._prevFaceName = user._prevFaceName || user._faceName;
user._prevFaceIndex = user._prevFaceIndex || user._faceIndex;
if (user.actorId() === 1) {
var faceName = 'RK DracoRoy - Luna';
var faceIndex = 2;
} else if (user.actorId() === 2) {
var faceName = 'RK DracoRoy - Kamui';
var faceIndex = 2;
}
user.setFaceImage(faceName, faceIndex);
user.refresh();
}
</Custom Apply Effect>

<Custom Remove Effect>
if (user.isActor()) {
user._prevFaceName = user._prevFaceName || user._faceName;
user._prevFaceIndex = user._prevFaceIndex || user._faceIndex;
if (user.actorId() === 1) {
var faceName = 'RK DracoRoy - Luna';
var faceIndex = 0;
} else if (user.actorId() === 2) {
var faceName = 'RK DracoRoy - Kamui';
var faceIndex = 0;
}
user.setFaceImage(faceName, faceIndex);
user.refresh();
}
</Custom Remove Effect>
--------------------------------------------------------------------------------

Only one problem remaining is the lack of Auto Passive State support with Yanfly's script on changing actors depending on states. And I am using Yanfly's Auto Passive States plug-in. http://yanfly.moe/2015/10/17/yep-13-auto-passive-states/

Like for example, Actor 1 has low health and critical health as passive states. Actor 1 should have a changed face when the auto passive state is executed in battle. And as I said before, it's going to feel very off for Actor 1 to be smiling when you're in a state like low or critical health.

Because of Lunatic Mode, would it be possible to put any actor face change scripts on the Custom Passive Condition notetag? Or something? It would be appreciated.
 

Latest Threads

Latest Profile Posts

>be me with a separate game for testing
>NPC doesn't stay in new position after leaving the map
>looking for tutorials, nothing useful
>checks plugin of save even location and installs it
>testing the game

"Oh... IT'S WORKING, IT'S ACTUALLY WORKING!!"
My current peak of boss design.
energy drinks have made this week SUPER productive so far lol. I finished one of my overworld maps, along with 2 other maps and a way to traverse to said overworld map.
i am absolutely DRAGGING MYSELF RIGHT NOW, i bought a commission ($35) back in october, got the art back, it was great, only to NOW realize i never DOWNLOADED it to my computer, and the site i used auto-deletes uploads after 3 months. Now i'm panicking cuz she closed all her commissions on that site & deleted her IG and Facebook, luckily I found her g-mail but who knows if she'll respond :kaocry: pray for me ya'll
Sigh...I can do everything I need for this game but make actual sprites and tile maps for it. Guess I'll look into hiring someone for that

Forum statistics

Threads
109,030
Messages
1,041,370
Members
141,503
Latest member
tiro1
Top