I've gotten some ideas searching through the help and the forums as to what is going on, but I can't get this to work.
Here is what I'm doing.Ã, I set a timer and when the timer goes off, which I check in repeat_execute (not the always version) then I run another function.Ã, The first thing it does is turn off the GUI that may be showing then do other stuff.
But, the GUI is NOT turning off.Ã, My guess from reading other threads is that it has to do with Gui.visible = false is one of those things that don't take affect until after the current script is done running...
here's my RE
#sectionstart repeatedly_executeÃ, // DO NOT EDIT OR REMOVE THIS LINE
function repeatedly_execute() {
Ã, // put anything you want to happen every game cycle here
Ã, if (!time_test)
Ã, Ã, return;
Ã, time_tick++;
Ã, if (time_tick > time_max)
Ã, Ã, ActionPerformed(atFail, "", null, -1, null, null);
Ã, Ã,Â
}
Here's the direct function in question
function ActionPerformed(ScriptActionType action, String dialog, Region* regionWalked, int actionDone, Character* invOnChar, InventoryItem* invItem)
{
Ã, gMyinv.Visible = false;
Ã, bool itemPassed = (DidItemPass(action, dialog, regionWalked, actionDone, invOnChar, invItem) == 0);
Ã, if (itemPassed)
Ã, {
Ã, Ã, RunItem();
Ã, }
Ã, else
Ã, {
Ã, Ã, Display(Script[_line].directorYell);
Ã, Ã, RestartGame();
Ã, }
}
So, how do I get the GUI to hide when I want it to?
thank you
Is the GUI a popup modal? In that case the game's paused when the GUI is visible, so repeatedly_execute() won't be run.
If that's teh case, either move the code to _always, or change the GUI's mode to "always".
Doing a Wait(1); after the Visible command will make the screen update if Gilbot's suggestion doesn't help
The wait(1) is all I needed.
Sorry about the delayed reply. I knew the function was getting called because I put a display before and after.....
thank you