MessageBox & GuiControl
by Tony Saunders · in Torque Game Builder · 11/13/2008 (4:33 am) · 2 replies
A question for advanced scripters out there....
Torquescript contains the MessageBox and the gui has the GuiControl.
However invoking these does not halt execution in the script that calls them: e.g.
function callBox(%this)
{
echo(">1");
MessageBox("title","comment","afterDoIt();");
echo(">2");
}
function afterDoIt(%this)
{
echo(">doIt()");
}
results in the following:
>1
>2
and then only when you click OK or Cancel .......
>doIt
The same thing happens when you do
Canvas.pushDialog(gui....);
the code just runs through and only halts when something invokes script again (like button presses)
This is a pain as quite often you want to embed these MessageBoxes/dialogs deep within the game logic and so I have to restructure complicated game logic to handle the code running on.
So my question is:
Is there anyway to halt the MessageBox() or Canvas.pushDialog() so that it doesn't execute the script immediately following it until the user has pop'd the dialog?
Cheers
Torquescript contains the MessageBox and the gui has the GuiControl.
However invoking these does not halt execution in the script that calls them: e.g.
function callBox(%this)
{
echo(">1");
MessageBox("title","comment","afterDoIt();");
echo(">2");
}
function afterDoIt(%this)
{
echo(">doIt()");
}
results in the following:
>1
>2
and then only when you click OK or Cancel .......
>doIt
The same thing happens when you do
Canvas.pushDialog(gui....);
the code just runs through and only halts when something invokes script again (like button presses)
This is a pain as quite often you want to embed these MessageBoxes/dialogs deep within the game logic and so I have to restructure complicated game logic to handle the code running on.
So my question is:
Is there anyway to halt the MessageBox() or Canvas.pushDialog() so that it doesn't execute the script immediately following it until the user has pop'd the dialog?
Cheers
About the author
#2
Will give it a go though.. thx
11/13/2008 (7:13 am)
Interesting. Need to mind the CPU though as TGB is already very greedy so a tight loop might send my cpu fan into overdrive!Will give it a go though.. thx
Torque Owner Brian Wilson