Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: on Sun 29/02/2004 18:13:30

Title: dialogues conditional
Post by: on Sun 29/02/2004 18:13:30
hi guys...i've just started programming with ags but i can't find out if it is possible to set conditions in a dialogue; such as: i want that after the player got the "BEER" item in his inventory,if the player talks to the barman he won't show "Here's a beer" but "You already got one!".

so..
is there a way to create an if/then/else funcion in the dialogue scripting?
thanks!

Cisco
Title: Re:dialogues conditional
Post by: Proskrito on Sun 29/02/2004 18:48:57
the way i do those kind of things, (dont know if it the best one) is to write both options in the dialog editor, and have the 'you already got one' disabled from start.
Then, when you get the beer, disable 'here is a beer' and enable 'you already...'.
I think the function for disabling/enabling dialog options is 'SetDialogOption'.
Title: Re:dialogues conditional
Post by: RickJ on Sun 29/02/2004 18:53:19
Normally this kind of thing is implemented using the option-on/off command.  There is  not an if-then-else construct in the dialog script language.  However, you can use the run-script command to trigger the dialog_request() event handler function in the global script which can have if-then-else constructs and which can enable/disable dialog options using the  SetDialogOption() function.  Lookup the following in the help file:

Title: Re:dialogues conditional
Post by: on Mon 01/03/2004 00:47:04
thx guys! it worked!