Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Mouth for war on Sun 31/07/2005 17:25:19

Title: Help with dialogs! [SOLVED]
Post by: Mouth for war on Sun 31/07/2005 17:25:19
I'm a beginner with this program and I'm having a problem. How can you make a character you talk to say something different the next time you speak to him? First time i talk to the character dialog 2 runs, but next time i talk to him i want dialog 3 to run. Can anyone help me out there?
Title: Re: Help with dialogs!
Post by: hedgefield on Sun 31/07/2005 18:25:47
At the very top of the global script, under //Main global script file, put

SetGlobalInt(0, 0);

Then, in the characters tab, under interactions(where you've specified to run dialog 2 when you talk to him/her), select instead Run Script from the list.

In it, put:

if (GetGlobalInt(0) == 0) {
  RunDialog(2);
}
if (GetGlobalInt(0) == 1) {
  RunDialog(3);
}


Now lastly, open up Dialog 2 in the dialog editor, and at the ending response, which could be for instance:

@ Dialog Option Nr #
EGO: Goodbye!
stop


Add set-globalint 0 1 between the last spoken sentence and the stop command.

That should do the trick!
Title: Re: Help with dialogs!
Post by: Mouth for war on Sun 31/07/2005 18:37:26
hmm i get an error message when i put
SetGlobalInt(0, 0); in the main global script file
Title: Re: Help with dialogs!
Post by: Mouth for war on Sun 31/07/2005 18:56:59
I've got it working, Thanks alot man :D
Title: Re: Help with dialogs!
Post by: TerranRich on Thu 04/08/2005 18:19:06
Remember...variables are your friend. Did you read the BFAQ at all? :)