Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Addnan on Fri 24/09/2010 18:47:14

Title: Disable entire dialog
Post by: Addnan on Fri 24/09/2010 18:47:14
I´m new to AGS and working on my first game.

I have a problem with dialog scripting.
The player gets 5 options during dialog1, all leading to dialog2 using the "goto-dialog" command.
So far it works fine.
But when my character talks to the same person again I want dialog2 to start instead of dialog1.

Hope my my bad english makes sence.


It´s probably a simple solution for this, but I couldnt find it.
Title: Re: Disable entire dialog
Post by: Dualnames on Fri 24/09/2010 18:59:08
all you need is a variable


bool talked=false;



function cCharX_Talk() {
if (talked) ddialog2.Start();
if (!talked) ddialog1.Start();
}

Title: Re: Disable entire dialog
Post by: Khris on Fri 24/09/2010 19:14:30
There's also this:
http://www.adventuregamestudio.co.uk/manual/Game.DoOnceOnly.htm

Btw, I'd write that:
function cCharX_Talk() {
  if (!talked) {
    talked = true;
    ddialog1.Start();
  }
  else ddialog2.Start();
}
Title: Re: Disable entire dialog
Post by: Dualnames on Fri 24/09/2010 19:32:31
Ah crap! I forgot to set the boolean.

function cCharX_Talk() {
  if (Game.DoOnceOnly("ifailed"))    ddialog1.Start();
    else    ddialog2.Start();
  }


That may be the best approach. Well, pretty much what Khris said. :-\
Title: Re: Disable entire dialog
Post by: Addnan on Fri 24/09/2010 19:51:20
Thanks guys!
Works perfectly now.