stopping actions.

Started by guv, Sun 16/08/2009 00:26:47

Previous topic - Next topic

guv

i want everything to stop before the player types in a name... heres what i have in room 1 script.

{
  gGui1.Visible = true;
  Display("BUMTOWN: THE BUMS UNITE!.");
  Display("SCRIPTS, SPRITES, AND EVERYTHING BUT THE VOICES, BY PAUL MCGOVERN.");
Display("So you have been kicked out of your flat because of lack of money.");
cjohnny.Say("well...yeah, but only because Cash wouldn't give me my money.");
Display("well prehaps he would have payed you if you weren't so gangsta, hm?");
cjohnny.Say("I wouldn't have got any money off him if i wasn't so 'gangsta'.");
Display("THAT IS IRRELIVANT.");
Display("go, go and collect your money, and meet your fortune.");
}

and in globalscript.

{
if (TextBox1.Text == "") {
  Display("But how do you expect to get a Bumtown citizenship if you do not have a name!?");
  return;
}
playername = TextBox1.Text;
gGui1.Visible = false;
}
any help appreciated

RickJ

From the manual...
Quote
PauseGame ()

Stops the engine processing character movement and animation, and other game features. This has the same effect on the game as happens when a script-only interface is popped up. The processing will not resume until you call the UnPauseGame function.

Edit the GUI containing the textbox.  Set the Visibility property to "Pause game when shown".

guv

i added pausegame() in room 1 script and unpausegame() in globalscript under the ok button command, but the dialog still continues when the player clicks?

globalscript.

function Button1_OnClick(GUIControl *control, MouseButton button)
{
if (TextBox1.Text == "") {
  Display("But how do you expect to get a Bumtown citizenship if you do not have a name!?");
  return;
}
playername = TextBox1.Text;
gGui1.Visible = false;
UnPauseGame();
}

room1 script.

function room_FirstLoad()
{
  gGui1.Visible = true;
  PauseGame();
  Display("BUMTOWN: THE BUMS UNITE!.");

Khris

Immediately after the dialog, set the gui containing the textbox to visible.
Don't use the Pause/Unpause commands, just do what RickJ suggested below the quote.

This causes the game to pause automatically as soon as the GUI is set to visible.

guv

thanks, the dialogs still continued even when i set it to that option, so i changed it so it doesn't appear till after the opening dialog had finished. thanks anyway, i appreciate the help.

SMF spam blocked by CleanTalk