I've set the option for GUIs in game settings to "be hidden", but for the first GUI that appears, I want it to be able to fade in and out which I'd do with a while loop. However, while loops block the game, thus making the GUI hidden during the while loop. Is the a function to change the behaviour when the interface is disabled?
Also, changing the behaviour in game setting to "display normally" or any other option won't work, as I'd still have to change the behaviour to "be hidden" afterwards.
Whenever you want to fade something, the best solution is to use the Tween module (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=38015.0). That should sort you out.
It's perfectly possible to display a GUI while the game is blocked. You may want to turn off the game setting to gray out GUIs when disabled, though.
Yep
I have used the Tween Module for just such events and as Snarky says: in General Settings under VISUAL set 'When player interface is disable, GUI's should' select 'Display Normally'.
Just for reference, while loops that contain a Wait() block the game visibly. To avoid that, you can use the repeatedly_execute function and a global variable.
Create one called fade_main_gui, then put this inside GlobalScript.asc / repeatedly_execute
if (fade_main_gui) { // if fade_main_gui isn't zero
int new_t = gMain.Transparency + fade_main_gui; // gMain = script name of GUI
if (new_t >= 0 && new_t <= 100) gMain.Transparency = new_t;
else fade_main_gui = 0;
}
Now you can set fade_main_gui to 1 to fade out the GUI, or -1 to fade it back in.
The Tween module does the same thing, I just thought I'd explain how stuff like this is done in general.
Thanks for your replies, guys. I'm not at my PC at the moment, but I'll set this to solved and try out the tween module later. If I've got any problems from there, I'll edit the title again.