MZ Changing the Portrait in Dialogues depending on a variable (= Clothing system!)

Hello!

I'm using Galv's messages busts for my dialogues. But I also want to give the player the option to change the cloths of my MC and this should be represented by the busts too 🙂

My Idea was to run a common event as soon as the player changes his cloths (I already found a plugin for this). This common event will set a variable, e.g. like "#001 Clothing = 1" for a leather armor, "#001 Clothing = 2" for a plate armor etc....

Now I want to check the value of the variable #001 Clothing at the beginning of every dialogue and change the Portrait-Set depending on the variable.

E.g. like my Potrait-Set "Actor_1" contains pictures where MC wears his leather armor, my Portrait-Set "Actor_2" contains Pictures of MC wearing the plate armor etc.
Hi there!
You can use my plugin that lets you run a common event at the beginning of every dialogue:
EliMZ Message Common Event

Original thread: https://forums.rpgmakerweb.com/threads/changing-the-portrait-in-dialogues-depending-on-a-variable-clothing-system.141787/