makes npcs pop up angry balloons when their movements are blocked by the player

hello, sorry if my english is bad.
So I made a script in the event section which aims to make the NPC raise an angry balloon when its movement is blocked by the player. I have succeeded in making the npc raise angry balloons when his path is blocked, but there is a problem, the npc keeps popping white balloons when he moves. The balloon turns angry when it is blocked but after that it still produces an empty white balloon

the image when the angry ballon appears
Screenshot (596).png

image when the white ballon appears (problem)
Screenshot (595).png

script
Screenshot (598).png
your script basically says that as long as theyre moving, call the balloon.
is the event running that script parallel? I think it might be because its requesting that same balloon so quickly that only the first frame shows up, which is empty white for all of them. it would also explain why the angry balloon only shows up when they stop moving. because the balloon only gets enough time to play past the first frame only when they cant move

If that event is always supposed to be moving unless its blocked, try flipping the logic so that if its *not* moving request the balloon. and if it is a parallel event try adding a wait for a second or 2 so that its not firing off 60 times a second and only showing the first frame of the balloon
I did it this way to find out what happens:
Code:
◆Script:document.title = "EV0015: " + $gameMap.event(15).isMoving()
◆If:Script:!$gameMap.event(15).isMoving()
  ◆Show Balloon Icon:EV015, Anger (Wait)
  ◆
:End

This way, without having to open the console, I will know if event 15 was actually in motion, but a problem occurred, depending on the frequency of movement, the confirmation will return false at each step for a few fractions of a second. That's why the balloon happens at the wrong times.

The only way to do this right would be to have an accountant consider a tolerance measure for the "Stopped" state, but it usually comes back to this kind of thread.
it doesn't sound like isMoving() is the check you'd want to use in this case...
I'd go with something like isCollidedWithCharacters() or isMovementSucceded(). if you want to apply this to all NPCs in the game without having to add these commands to every event, rewrite one of these functions in a plugin to request the balloon whenever a movement failed or a character was collided with.
isMovementSucceded()
It worked perfectly, only one letter E was missing.
But ideally it should be done with events to wait for the animation to complete.
Code:
◆If:Script:!$gameMap.event(2).isMovementSucceeded()
  ◆Show Balloon Icon:EV002, Anger (Wait)
  ◆
:End

Original thread: https://forums.rpgmakerweb.com/threads/makes-npcs-pop-up-angry-balloons-when-their-movements-are-blocked-by-the-player.163475/