Help with scripting Text that shows different Face Images

I've been trying to write a Script that would show the correct Face Image based on the value of two variables inside a text message.


$gameMessage.setFaceImage('1_1_F_Body0_Faces_Edited',$gameVariables.value(104));

$gameMessage.setBackground(0);

$gameMessage.setPositionType(2);

$gameMessage.add("Choose your Discipline.\n\nPress the Escape Key to view second page");


Is there a way I can change the file name '1_1_F_Body0_Faces_Edited' based on the value of a variable? Ideally something like this:

Control Variables : #0103 A.1_Face_Name = "1_1_M_Body0_Faces_Edited"

Script : $gameMessage.setFaceImage('$gameVariables.value(103)',$gameVariables.value(104));


Another problem I encountered is when I follow the scripted text with a Show Choices Event Command the text vanishes before the choices show up. So I would have to figure out a way to prevent that from happening as well to make this work.
the string needs t6o be stored inside the variable, and no string declaration around the code
The following would work in your case:

$gameMessage.setFaceImage($gameVariables.value(103),$gameVariables.value(104));
the string needs t6o be stored inside the variable, and no string declaration around the code
The following would work in your case:

$gameMessage.setFaceImage($gameVariables.value(103),$gameVariables.value(104));

Thank you. That part is working now so I really appreciate the help.

Do you or anyone else know how to write the Scripted Text to where it behaves the same way as my unscripted text message does when followed by the Show Choices Event command?

Unscripted Event:

Show Picture : #11, Class_Select1A_Edited, Upper Left (0,0), (100%, 100%), 255, Normal
Text : None, 1_1_M_Body0_Faces_Edited(0), Window, Bottom
\>Choose your Discipline.

\>Press the Escape Key to view second page.
Show Choices : Priest, Witch, Warrior, Knight, Monk, Ninja (Window, Right, #1, -)
When Priest

When Witch

When Warrior

When Knight

When Monk

When Cancel

Forum_Help_1e.png



Scripted Event:

Show Picture : #11, Class_Select1A_Edited, Upper Left (0,0), (100%, 100%), 255, Normal
Script :
$gameMessage.setFaceImage($gameVariables.value(103),$gameVariables.value(104));
$gameMessage.setBackground(0);
$gameMessage.setPositionType(2);
$gameMessage.add("Choose your Discipline.\n\nPress the Escape Key to view second page");

Show Choices : Priest, Witch, Warrior, Knight, Monk, Ninja (Window, Right, #1, -)
When Priest

When Witch

When Warrior

When Knight

When Monk

When Cancel

Forum_Help_1f.png


And then when I hit enter the text message goes away and the choices appear:

Forum_Help_1g.png


I would like for the text message to stay visible while the choices are on screen. I might be missing some kind of code that tells the scripted text not to wait for input, but that's just a guess and I don't know how to write such a command into the script. \^ didn't work and I still have a lot to learn on how to translate normal text functions into script.
Show choices doesn't work that way.

The code for the show choices command checks the previous command in the event. If that previous command is a show text, then (and only then) the engine will keepthe older text window.

It would take some extensive changes in the engine itself to allow the show choices command to identify a scripted show text.

I think you better scrap the entire idea and use what everyone else uses for changing faces.

There are messaging type plugins that add more textcodes to control the output of the show text command, and part of that is usually a text code to change the face to the face of a numbered actor or of the actor in a numbered party position or so on.
Install one of those plugins, use the text code inside show text to change the message and the show choices will work as intended.
Show choices doesn't work that way.

The code for the show choices command checks the previous command in the event. If that previous command is a show text, then (and only then) the engine will keepthe older text window.

It would take some extensive changes in the engine itself to allow the show choices command to identify a scripted show text.

I think you better scrap the entire idea and use what everyone else uses for changing faces.

There are messaging type plugins that add more textcodes to control the output of the show text command, and part of that is usually a text code to change the face to the face of a numbered actor or of the actor in a numbered party position or so on.
Install one of those plugins, use the text code inside show text to change the message and the show choices will work as intended.

I see. I used to use Shaz's MoreEscapeCodes2 plugin to do this, but I had a crashing issue while using MV I was unable to resolve. So now I'm trying to salvage the project by rebuilding it on MZ and I was unable to find an updated version of the plugin for the newer engine.

I found a plugin called GabeMZ_MessagePlus that looked promising, but I'm having some difficulty using it.

#Edited

Zia_ showed me what I was doing wrong with the Plugin, and it's working now and does what I need it too. Can mark this thread as solved. Thanks again for all the help.

Original thread: https://forums.rpgmakerweb.com/threads/help-with-scripting-text-that-shows-different-face-images.174789/