Check if dialogue box is open

Is there a way (maybe a script call) to check by a conditional branch if the dialogue box is open?
if you are talking about the show text box, that is only open while the command is active - and that stops all other event commands, so there is no way the conditional branch can check that at the same time.

please give a better description on what you want, and why you want it and someone might be able to help you.
if you are talking about the show text box, that is only open while the command is active - and that stops all other event commands, so there is no way the conditional branch can check that at the same time.

please give a better description on what you want, and why you want it and someone might be able to help you.

Yes of course. I added a "Oxygen bar" In a specific dungeon. This bar appears when a switch is on and every 15 frames it decreases until 0. To do this I used a variable (100 = full bar; 0 = empty bar). If variable = 0 -> common event that processes game over. If you need other infos I followed this tutorial: (I modified something, like I dind't store the HP ecc. becouse I didn't need it).
The issue is: when the player talks to an NPC or interact with something that shows teh dialogue box the variable (so the bar) keeps decreasing.
I wanted to do a conditional branch with:
If the dialogue box is open
do nothing
else
keep decreasing the variable.

Is it more clear now?
You should be able to use $game_message.busy?
You should be able to use $game_message.busy?

I tried but nothing happens. I think the code is correct but the event not.
I write here the event (I don't post a screenshot becouse I have an Italian patch installed).

Spoiler: Common event
Parallel process - Switch oxygen on
Control variable [oxygen] = 100
Conditional branch: $game_message.busy?
Loop
Control variable [oxygen] -0
Wait 15 frames
Repeat above
else
Loop
Control variable [oxygen] -1
Wait 15 frames
Repeat above
end
I believe the problem is that you are checking $game_message.busy? outside the loop. I think that loop never actually ends, so you probably want something more like this:

Code:
Oxygen = 100
Loop
  if not $game_message.busy
    Oxygen -= 1
  end
  wait(15)
end

That way every time the loop executes one step, you check... so if the game_message got busy while you're inside the loop, it will notice the next time it wakes up (after 15 frames).

And you might want to put a conditional check into the loop that looks at whether Switch Oxygen is off and if so, breaks the loop. Otherwise, I think that loop will run until you leave the map, even if Switch Oxygen becomes off.
I believe the problem is that you are checking $game_message.busy? outside the loop. I think that loop never actually ends, so you probably want something more like this:

Code:
Oxygen = 100
Loop
  if not $game_message.busy
    Oxygen -= 1
  end
  wait(15)
end

That way every time the loop executes one step, you check... so if the game_message got busy while you're inside the loop, it will notice the next time it wakes up (after 15 frames).

And you might want to put a conditional check into the loop that looks at whether Switch Oxygen is off and if so, breaks the loop. Otherwise, I think that loop will run until you leave the map, even if Switch Oxygen becomes off.

It works fine, thank you 🙂

Original thread: https://forums.rpgmakerweb.com/threads/check-if-dialogue-box-is-open.130832/