MV Close text window on event trigger

So I have a situation in the game where the player can check certain items on the map, each time causing a message window to pop-up (e.g. stuff like 'Wow, that's a lot of books!' while checking out a book shelf (you get the gist)).

Now at the same time I have enemies following the player on the map. What I want is that when the enemies touch the player (event touch) the text window that is currently open is being closed and other stuff happens. But I haven't found out how to force the message window to close on event touch, can anyone help me out?
that would completely depend on how you get the enemies to move while the show text command is open, because by default that movement is stopped while a show text is active.
or are you using a gap window plugin for those texts?

anyway without more info on how you handle those things no one will be able to give a working suggestion.
I have them run towards the player or randomly, actually it doesn't make a difference. They always run around while the text is displayed and are not stopped. (even checked in a new project to make sure no plugin is messing it up)
OK, that changed from how the events were behaving in earlier versions.
I wonder why they changed that.

If I remember correctly there is or was a yanfly plugin that stops all event movement while a specified switch is ON - you could use that, but it would require you to add the control switch command to every event like that.

a different option would be to use the mentioned gap window from my first post - those are for background messages and never stop any other event interaction. But I don't know if that functionality was transferred to a MV plugin, so you'll have to check yourself.

other than that you would probably have to wait for someone to create a plugin that does what you described.
Hi there!

If the events are on an autonomous move route, I believe they will keep moving even with the message window opened.

What you can try to do is when the events touch the player, you flip a switch and stop the event from moving.
Have a conditional branch with the script check:
!$gameMessage.isBusy()
As soon as the message window is closed, the event contents inside the conditional branch will be played.
I can see this working, but I don't if it is a nice behavior. Because the player will get stuck while reading the message, but the event will keep moving... leaving the player unable to avoid contact.

Another solution could be to stop the event from moving when the message window is open.
If the message window is working ($gameMessage.isBusy()) then the event will not move.

Another way would be, when the event touches the player, you use that script call:
SceneManager._scene._messageWindow.terminateMessage()

But you have to test either of them. I'm with no time to elaborate on this better. Hope it gives you some light.

Original thread: https://forums.rpgmakerweb.com/threads/close-text-window-on-event-trigger.149710/