If else in dialog options for return and stop

Started by barefoot, Mon 20/06/2011 10:11:51

Previous topic - Next topic

barefoot

Hi

I have a dialog with an if else.. if the condition is true then the dialog closes and returns to game as normal if it is not it then the dialog stays open.

Have tried StopDialog (); in the dialog but still shows.

barefoot

I May Not Be Perfect but I Have A Big Heart ..

monkey0506

It's kind of an obscure thing to find in the manual, but:

Quote from: ConversationsIf you want to conditionally break out of the dialog script, the special tokens RUN_DIALOG_GOTO_PREVIOUS, RUN_DIALOG_RETURN and RUN_DIALOG_STOP_DIALOG are available which you can return from inside a script block. For example:


@1
ego: "Hello. How are you?"
narrator: The man looks you in the eye.
 if (player.HasInventory(iKey)) {
   player.Say("Actually, I'd better go.");
   return RUN_DIALOG_STOP_DIALOG;
 }
otherman: "Here's a key for you."
return


barefoot

Cheers Monkey

I'll give that a whirl

:=

barefoot



I May Not Be Perfect but I Have A Big Heart ..

SMF spam blocked by CleanTalk