Is it possible to know if the game is in blocking state?

Started by Sakspapir, Thu 08/02/2024 13:21:50

Previous topic - Next topic


Hi guys,

I'm wondering if there's a function/field that returns the current blocking state of the game?

I have some GUIs that might or might not be visible during gameplay. But every time the game enters blocking state (e.g. Wait(xx) or cChar.Walk(x,y,eBlock) or similar functions), I want these GUIs to be forced to have their .Visible field set to false.

My plan is to do something like this:

Code: ags
function late_repeatedly_execute_alway()
  if (theGameIsInBlockingState()) // <--- This is the function I'm looking for
    gGui1.Visible = false;
    gGui2.Visible = false;

Of course, if there's a function to achieve this already, that would be even better. I've tried looking through the documentation but couldn't find anything to suit my needs. But as my wife would say: "The fact that you can't find it, doesn't mean it's not there".

All help is greatly appreciated!

Crimson Wizard

The IsInterfaceEnabled is the closest that I might think of.

But there's also a way of automating this using "When player interface is disabled, GUI should..." setting in General Settings, one of the choices there is "Be hidden". Individual GUIs may be excluded from this by setting their PopupStyle to "Always shown". I think they still may have their Visible state toggled by a script command.


SMF spam blocked by CleanTalk