MV How can I make a characters face update based on a variable without lots of eventing

I am working on a game where the characters appearance changes based on a variable, and I've been trying to find out how I can change it without manually adding in all possible alternate faces for every text box.

I heard it is possible using Yanfly extended messages pack 1 but I would ideally want to do it for free. And someone did say somewhere that it can be done with the message core but I cannot seem to figure out how,

If a free plugin isn't possible, then I am willing to try using common events to change the faceset used in a dialogue box.

I also tried following this tutorial and tried to use the linked script call doc to check the script but I cannot get it to work

Screenshot 2026-01-22 180401.png
Screenshot 2026-01-22 180459.png
Hmm, maybe this is a good time for me to release my Text Extensions plugin. Among other things, I added a text code that modifies the face image on the fly. You could write this at the beginning of every message and it would use the face index from the variable:

Code:
\E[\V[5]]

It's not quite what I intended that to be used for, but it should work.

It would not surprise me though if Message Core has a similar function, but I don't know what it would look like if it does.
$gameMessage.setFaceImage won’t work that way. The "Show Text" command automatically overrides it right before displaying the text. If you want to use it, you need to call/show the text entirely via script, like this:

JavaScript:
$gameMessage.setFaceImage('Actor1', 0);
$gameMessage.setBackground(0);
$gameMessage.setPositionType(2);
$gameMessage.add('test');

But it will cause some issues if you try to use it with "Show Choices". Unless you're okay with choices that have no additional text.
But it will cause some issues if you try to use it with "Show Choices". Unless you're okay with choices that have no additional text.
That'll cause issues even if you don't use "Show Choices". It's missing at least a this.setWaitMode('message'), which means that if you put a regular Show Text after it, that Show Text's settings will override your manual ones. The text itself would probably flow together as well.
That'll cause issues even if you don't use "Show Choices". It's missing at least a this.setWaitMode('message'), which means that if you put a regular Show Text after it, that Show Text's settings will override your manual ones. The text itself would probably flow together as well.
Well yes, calling regular Show Text after it will of course override your settings. If you're using a script call for it, then you need to keep using script calls. But no, regular Show Text after it will not flow text together, with or without this.setWaitMode('message'). But sure it can be added just in case if yor are using script call one after another.


I think it's better to just use this little "plugin" @Galexy

Add it at the end of the existing plugin or add it as a standalone one, just make sure it's placed below any other message plugin.
Usage example: \Face[0]
Or with variable - \Face[\V[5]]
eaed9fb2e006b6faf52d58e23efa826b.png

It will set a different index for the face you choose. It needs to be added every time you call 'Show text'
Spoiler: code
JavaScript:
(function() {

    var _Window_Message_convertEscapeCharacters = Window_Message.prototype.convertEscapeCharacters;
    Window_Message.prototype.convertEscapeCharacters = function(text) {
        text = _Window_Message_convertEscapeCharacters.call(this, text);
        text = text.replace(/\x1bFACE\[(\d+)\]/gi, function(_, index) {
            $gameMessage.setFaceImage($gameMessage.faceName(), parseInt(index));
            return '';
        });
        return text;
    };

})();
then you need to keep using script calls.
If you add an this.setWaitMode('message') then it's safe to go back to regular Show Text afterwards. (I actually did this recently – using script calls to add a variable number of lines, then following it up with regular Show Text commands.)

I think it's better to just use this little "plugin"
I think you may need to add a call to this.loadMessageFace(). It would definitely be needed if you were loading a face from a different image; I'm not quite sure if it's needed here, when you're only changing the index. (Unless it's called by the base startMessage…?)

I also think it'd make more sense to process this in convertEscapeCharacters or maybe processEscapeCharacter… but if what you have works, then I guess it's fine.
I am working on a game where the characters appearance changes based on a variable, and I've been trying to find out how I can change it without manually adding in all possible alternate faces for every text box.

I heard it is possible using Yanfly extended messages pack 1 but I would ideally want to do it for free. And someone did say somewhere that it can be done with the message core but I cannot seem to figure out how,

If a free plugin isn't possible, then I am willing to try using common events to change the faceset used in a dialogue box.

I also tried following this tutorial and tried to use the linked script call doc to check the script but I cannot get it to work

View attachment 358774View attachment 358775
All you need is to run a variable at random for whatever amount of choices you have. Then create new images of each face and the character you want to change to. Then when this happens, conditional branch the image to change to what it needs to be. Not sure why others are telling you to use plugins when this is a simple thing to do.
If you add an this.setWaitMode('message') then it's safe to go back to regular Show Text afterwards. (I actually did this recently – using script calls to add a variable number of lines, then following it up with regular Show Text commands.)


I think you may need to add a call to this.loadMessageFace(). It would definitely be needed if you were loading a face from a different image; I'm not quite sure if it's needed here, when you're only changing the index. (Unless it's called by the base startMessage…?)

I also think it'd make more sense to process this in convertEscapeCharacters or maybe processEscapeCharacter… but if what you have works, then I guess it's fine.
I don't think this.loadMessageFace() is needed. It's just an index change.
But yeah, convertEscapeCharacters would be cleaner.

processEscapeCharacter is too late the text needs to reach the point where the code is set, so we'll see the old face the whole time if the code isn't at the start of the message. Unless it's necessary to change the face mid message.

I updated the code for convertEscapeCharacters

All you need is to run a variable at random for whatever amount of choices you have. Then create new images of each face and the character you want to change to. Then when this happens, conditional branch the image to change to what it needs to be. Not sure why others are telling you to use plugins when this is a simple thing to do.

Unless I'm getting the author's request wrong, that's not really what they’re asking for. The face in messages is tied to the "Show Text" command itself, so changing the face means you have to create a whole new Show Text command.
Just imagine, for example, one character with 5 different looks that can switch at any time during the game. You'd end up copy-pasting 5 time every single "Show Text" command in the game for that character just to change the portrait.

So the issue isn't really about complexity it’s just inconvenient.
Unless it's necessary to change the face mid message.
That was my intention when I did it. Your intention seems a bit different, so it's probably fine as-is. 🙂

Just imagine, for example, one character with 5 different looks that can switch at any time during the game. You'd end up copy-pasting 5 time every single "Show Text" command in the game for that character just to change the portrait.
Yeah, this is exactly what I ended up doing in one similar case in one game idea (it's barely a prototype at the moment). Fortunately there's only two possibilities (and will never be more – it was a gender selection in my case) so it's not too bad, but… I'd definitely prefer not to have to even then.
Thank you @Krimer, your little plugin worked. I managed to get the faces to change based on a variable
Not sure why others are telling you to use plugins when this is a simple thing to do.
Why do you drop this so often? It's not like the only use of plugins is to accomplish something that's impossible using events. Efficiency is a smart thing, and valuable in something like a game project.

Choosing to do something like having a page or more of conditional branches with duplicate event commands inside instead of simply using one event command with one text code inside is...silly, to use a polite word.

Also:
Then create new images of each face and the character you want to change to. Then when this happens, conditional branch the image to change to what it needs to be.
This is very unhelpful, as none of this terminology actually corresponds to event commands one would use in a situation like this. None of what the OP is asking can be solved by "creating images" - you would have to have however many conditional branches for every possible value of the variable and a distinct Show Text command with the appropriate face inside.

Original thread: https://forums.rpgmakerweb.com/threads/how-can-i-make-a-characters-face-update-based-on-a-variable-without-lots-of-eventing.182126/