scripting Problem with Dialog box MODULE

Started by , Wed 13/12/2006 01:58:46

Previous topic - Next topic

Siahofmars

hi i have just started to use this program about a week ago, and i know nothing about scripting except from what i understand from the manual but it doesnt help me by what i can understand about whats going on in the script in this module... see what i want is:i walk to a spot, or something happens with an object or character that triggers me to die... i got that part down, but after the death animation happens i want a screen to come up similar to space quest that has a voice like "would u like to load the game or quit" with a little pixture in the box or something... with the options Yes and No, and when they pick yes it brings up the load game screen and when they pick no it quits the game. what should i do i got the script module in dialog box1.1 from ssh

this is what his script does..

// Main script for module 'DialogBox'

function game_start () {
  gDialogbox.Visible=false;
  gDialogbox.Centre();
}
 
function DialogBox(String caption) {
  goDialogCaption.Text=caption;
  gDialogbox.Visible=true;
  int guidisable=GetGameOption(OPT_WHENGUIDISABLED);
  SetGameOption(OPT_WHENGUIDISABLED, 2); // Unchanged
  //mouse.UseModeGraphic(eModePointer);
  GUIControl *gc;
  // Wait for any previous clicks to clear...
   while (mouse.IsButtonDown(eMouseLeft)) {
      Wait(1);
      mouse.UseModeGraphic(eModePointer);
   }
   // Now wait until OK or Cancel are clicked
  while (gc!=goDialogOK && gc!=goDialogCancel) {
      while (!mouse.IsButtonDown(eMouseLeft)) {
         Wait(1);
         mouse.UseModeGraphic(eModePointer);
      }

    GUIControl *pressed=GUIControl.GetAtScreenXY(mouse.x, mouse.y);
    int ng;
      if ((pressed==goDialogOK || pressed==goDialogCancel) && pressed.AsButton.PushedGraphic>0) {
        ng=pressed.AsButton.NormalGraphic;
        pressed.AsButton.NormalGraphic=pressed.AsButton.PushedGraphic;
      } else pressed=null;
      while (mouse.IsButtonDown(eMouseLeft)) {
         Wait(1);
         mouse.UseModeGraphic(eModePointer);
      }

      if (pressed!=null) pressed.AsButton.NormalGraphic=ng;
      mouse.Update();
    gc=GUIControl.GetAtScreenXY(mouse.x, mouse.y);
   }
  gDialogbox.Visible=false;
  SetGameOption(OPT_WHENGUIDISABLED, guidisable); 
  Wait(1);
  mouse.UseDefaultGraphic();
  return (gc==goDialogOK);
}

export DialogBox;

how would i set that up so i can change the gui buttons in the gui that came with it, to what i want them to do?

this would help me understand everything else script wise i beleive by alot, cause ive been sitting here for like 6 hours trying to figure this one thing out.. and its probably something simple... plz help
and i just wanted to say, i love AGS :)! regardless of my lost hours.. its fun to learn, and thats why im here.
when replying to this message keep in mind i have never scripted anything b4,
so make it as understandable as possible if u could thanks.. appreciates :)!


SSH

Just change the GUI to make the buttons say what you want, add another button and put a picture in it, and then call DialogBox("Would you like to load the game or quit?");

It might be best to ask these questions in the Module's own thread.
12


SMF spam blocked by CleanTalk