Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: rmonic79 on Thu 18/12/2014 21:17:48

Title: help "check for dialogues start and stop"
Post by: rmonic79 on Thu 18/12/2014 21:17:48
Hi guys, is there a way to check if the dialogue is running?
like
Code (ags) Select
if (dPlayer is running) {
                do some stuff}
or          if (dPlayer is stopped){
                do other stuff}

thank you for the answers.
Title: Re: help "check for dialogues start and stop"
Post by: Cassiebsg on Thu 18/12/2014 22:08:20
May I ask what you are trying to do?

If dialog is running and you want something to happen, then your best bet is the just add the commands inside the dialog, if you want some BG stuff going at the same time it's a bit more complex (I don't know exactly how, but do a forum search. It has been answered not too long along... this week I believe).

As for when the dialog is stopped, I normally check for a particular dialog option and to see if it has been selected, but there's about (at least) 3 different ways to check for dialog ending.
Title: Re: help "check for dialogues start and stop"
Post by: rmonic79 on Thu 18/12/2014 22:35:12
Quote from: Cassiebsg on Thu 18/12/2014 22:08:20
May I ask what you are trying to do?

If dialog is running and you want something to happen, then your best bet is the just add the commands inside the dialog, if you want some BG stuff going at the same time it's a bit more complex (I don't know exactly how, but do a forum search. It has been answered not too long along... this week I believe).

As for when the dialog is stopped, I normally check for a particular dialog option and to see if it has been selected, but there's about (at least) 3 different ways to check for dialog ending.

i would avoid to repeat for any option the same code in the dialogue
like
Code (ags) Select

// Dialog script file
@S  // Dialog startup entry point
return
@1
  cUomobar.LockView(33);
  cDonnabar.LockView(53);
Uomobar:sdfsdfs sdgfsdfsdf sdf sdfgsdfgsdfgs sdgf sdgsdgsdfgs
  cUomobar.UnlockView();
  cDonnabar.UnlockView();
stop


i'm wondering if there is a command  that lock views on start dialogue and release  them when the dialogue stops working on global dialogue and not within the single options.
Title: Re: help "check for dialogues start and stop"
Post by: Cassiebsg on Thu 18/12/2014 22:48:33
You can add the code at the start like this:

Code (ags) Select

    // Dialog script file
    @S  // Dialog startup entry point
      cUomobar.LockView(33);
      cDonnabar.LockView(53);
    return
    @1
    Uomobar:sdfsdfs sdgfsdfsdf sdf sdfgsdfgsdfgs sdgf sdgsdgsdfgs
    return
    @2 // exit option
    Uomobar: Goodbye...
      cUomobar.UnlockView();
      cDonnabar.UnlockView();
    stop


You can also do this:

Code (ags) Select

function cUomobar_Interact()
{
      cUomobar.LockView(33);
      cDonnabar.LockView(53);
      dUomobar.Start();
}


And unlock the view inside the dialog... or you can check if the exit option (2) of the dialog has been chosen and if so, then unlock the view.
I would put the code inside the dialog. But maybe someone else has a better suggestion for you. 8-)
Title: Re: help "check for dialogues start and stop"
Post by: rmonic79 on Fri 19/12/2014 01:14:32
Quote from: Cassiebsg on Thu 18/12/2014 22:48:33
You can add the code at the start like this:

Code (ags) Select

    // Dialog script file
    @S  // Dialog startup entry point
      cUomobar.LockView(33);
      cDonnabar.LockView(53);
    return
    @1
    Uomobar:sdfsdfs sdgfsdfsdf sdf sdfgsdfgsdfgs sdgf sdgsdgsdfgs
    return
    @2 // exit option
    Uomobar: Goodbye...
      cUomobar.UnlockView();
      cDonnabar.UnlockView();
    stop


You can also do this:

Code (ags) Select

function cUomobar_Interact()
{
      cUomobar.LockView(33);
      cDonnabar.LockView(53);
      dUomobar.Start();
}


And unlock the view inside the dialog... or you can check if the exit option (2) of the dialog has been chosen and if so, then unlock the view.
I would put the code inside the dialog. But maybe someone else has a better suggestion for you. 8-)

thanks :)