Change an Actor's face image depending on states.

RK DracoRoy

Fire Emblem RPG Gamer
Veteran
Joined
Jun 29, 2017
Messages
297
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
297
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,286
Reaction score
14,274
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,286
Reaction score
14,274
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
297
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: 5
  • Capture1.PNG
    Capture1.PNG
    132.5 KB · Views: 5
  • Capture2.PNG
    Capture2.PNG
    137.7 KB · Views: 6
  • Capture3.PNG
    Capture3.PNG
    117.2 KB · Views: 5

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
297
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 Posts

Latest Profile Posts

I've just finished organizing music files from a music Humble Bundle I purchased a while ago (putting in specific themed playlists, deleting from playlists, deciding which games they'll be used for. etc.). I'm feeling pretty confident that the sound design for my games will be up to high standards. Sound design seems to be relatively under-discussed as a topic in game development imo.
So I just got back from SeaWorld and I'm back to working on my game. I'm stuck on Shadowstar, mainly due to needing two more princesses... I have all the canon and toy princesses, plus Sunset Shimmer just for kicks. I decided not to include Cadence since this isn't in that era. But... I'm going to have to design two OCs now.
I'm completely missing on this site :kaodes: How's everybody doing lately?
3dlm3XK.jpg
I'm looking at/working through a simple game tutorial. Town, dungeon, boss; town, dungeon, boss; etc. (Thanks, Yanfly!) I'm itching to make something complex but experience (and past disappointment!) tell me to go slow and learn.

Rome certainly wasn't built in a day. 〜( ̄▽ ̄〜)
SF_People1_2 added!
index.php

Forum statistics

Threads
109,187
Messages
1,042,843
Members
141,679
Latest member
loowa
Top