Switching main character and also switching message image.

FIrst question: Is there a way to assign a STRING to a variable? Like \V[1] = SAMPLE
Second question: If I would make the possibility to choose the main character, is there a way to switch the avatar in messages? Or should I make some conditional events to do this?

Thanks in advice. 🙂
FIrst question: Is there a way to assign a STRING to a variable? Like \V[1] = SAMPLE
If you mean inside of an event, use "Control Variable", and under "Operand" choose "Script". Type your string in with quotes around it (i.e., "SAMPLE").

For your second question, the most effective way I've seen is Yanfly's Message Core plugin. It allows you to show the face of a particular actor using \af[x] inside the message. You'd need to combine this with a "Change Actor Images" event that's tied to your character selection, so that for example you ensure that Actor 1's images are chosen to match the ones the player chose, and you just use \af[1] inside all the messages that need the player character's image.
Thank you!

Original thread: https://forums.rpgmakerweb.com/threads/switching-main-character-and-also-switching-message-image.76522/