MZ [SOLVED] Common Event When Message Box Opens/Closes (VisuStellaMZ Message Core)

TLDR; Is there a way to set Common Events to run when a message box is opened/closed, or a way to implement that into the VisuStellaMZ Message Core plugin using Text Code Actions/Macros?

I'm working on a dialogue system that currently looks like this:



Right now, to show each message box, there are a lot of event commands that I have to input to get this to work with my current style, so I'm looking for a method to combine all of this into code that I could input on 1-2 lines if possible, instead.

This is what my command currently looks like:
DialogueEvent.png

The Dialogue (Start) Common Event checks which character and expression are currently set, and eases in the appropriate image files (as I'm not using facesets), and the Dialogue (End) eases out and erases the images. The [dialogue] is a Macro from the VisuStella MZ Message Core to set the text color and window position.

I'm looking at using @theartofme's Ink Integration plugin so that I can externally create dialogue, but right now, this would look something like this (which is a lot of lines for one message box):
DialogueInk.png


I'm basically looking for a way to have a Common Event that runs every time the message box window opens, and one that runs every time it closes, so I can cut down on these repeated event commands every time I show a message box. So I'm wondering if this is possible to do through any plugins out there. I see that Galv made a plugin that can run Auto Common Events on scenes like loading a save file, so that was another one I was looking into, but it doesn't seem to have the functionality to execute a Common Event when a message box is opened/closed.

Would anyone have any ideas on how to run a Common Event every time that the message box opens and closes? Thanks in advance!


Edit: After some more experimentation, I got Text Code Actions in the VisuStellaMZ Message Core plugin to work at the start of the message box, though it's a little messy with text codes, and I have to use a separate message box for when the message box closes (or just manually calling the Common Event each time). So I'm still looking into if there's a way to run a Common Event on opening/closing the message box.

Here's where my event is now:
DialogueCodes.png


I was also doing some research and trying to figure out if there's a way to use the Window_Message.isOpen() and Window_Message.isClosing() methods for calling those Common Events, but still haven't had any luck with figuring out how those work in script commands.

So any advice on this would be appreciated!


EDIT 2: I ended up getting some external help with a plugin that works for what I need, so this has been resolved!
Thread closed

Original thread: https://forums.rpgmakerweb.com/threads/solved-common-event-when-message-box-opens-closes-visustellamz-message-core.138116/