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.
all you need is a variable
bool talked=false;
function cCharX_Talk() {
if (talked) ddialog2.Start();
if (!talked) ddialog1.Start();
}
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();
}
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. :-\
Thanks guys!
Works perfectly now.