Hi. I have a example code of dialog
@1
Smb: I wanna drink.
if (Ã'ÂEgo.HasInventory(iJuice))
Ã'ÂEgo.LoseInventory(iJuice);
stop
I want to branch out a dialog
@1
Smb: I wanna drink.
if (Ã'ÂHero.HasInventory(iVodka)) {
Ã'ÂHero.LoseInventory(iVodka);
//goto-dialog X or dialog_request
}
else
{
//goto-dialog X or dialog_request
}
stop
How can I can do it?
Another question: What are RUN_DIALOG_GOTO_PREVIOUS, RUN_DIALOG_RETURN and RUN_DIALOG_STOP_DIALOG doing?
Quote from: GoodGuy on Sat 25/03/2017 07:56:31
I want to branch out a dialog
@1
Smb: I wanna drink.
if (Ã'ÂHero.HasInventory(iVodka)) {
Ã'ÂHero.LoseInventory(iVodka);
goto-dialog X // You can just remove the indentation, since goto-dialog is a dialogue command, not a script command.
}
else
{
//goto-dialog X or dialog_request
}
stop
Another way is to simply start the other dialog:
if (Ã'ÂHero.HasInventory(iVodka)) {
Ã'ÂHero.LoseInventory(iVodka);
dVodka.Start();
return RUN_DIALOG_STOP_DIALOG;
}
Untested! But I guess this should do the trick.
Quote from: GoodGuy on Sat 25/03/2017 07:56:31Another question: What are RUN_DIALOG_GOTO_PREVIOUS, RUN_DIALOG_RETURN and RUN_DIALOG_STOP_DIALOG doing?
Instead of using a non-indented dialog command like
goto-previous you'd call "return RUN_DIALOG_GOTO_PREVIOUS;" in an indented script block.