Disable entire dialog

Started by Addnan, Fri 24/09/2010 18:47:14

Previous topic - Next topic

Addnan

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.

Dualnames

all you need is a variable

Code: ags

bool talked=false;


Code: ags

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

Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Khris

#2
There's also this:
http://www.adventuregamestudio.co.uk/manual/Game.DoOnceOnly.htm

Btw, I'd write that:
Code: ags
function cCharX_Talk() {
  if (!talked) {
    talked = true;
    ddialog1.Start();
  }
  else ddialog2.Start();
}

Dualnames

Ah crap! I forgot to set the boolean.
Code: ags

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


That may be the best approach. Well, pretty much what Khris said. :-\
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Addnan

Thanks guys!
Works perfectly now.

SMF spam blocked by CleanTalk