Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Nine Toes on Sun 15/05/2005 22:45:00

Title: Troubles with dialog, a typical "select your conversation".
Post by: Nine Toes on Sun 15/05/2005 22:45:00
Last night, I sat down and tinkered with the dialog editor for the very first time. (Yes, it's true... I never found a use for it before.)

Just to test things out and get a feel for it, I created one topic, and in that topic, I created three options.  I figured I might also need a gui of some type (a listbox), to show the options.  Then I set the script so that when the player character interacts with an NPC, it was supposed to run the dialog.

I looked in the manual, and I understand how to make topics, and options (or "sub-topics", I keep calling them that for some reason...).  But it never actually says how to make the options selectable (via the list box).  So, I looked up a few commands having to do with dialog, but I couldn't make heads or tails of any of it.

I feel really stupid for asking this, because it looks simple, but can anyone help me out?  Maybe throw a few pointers my way, or point me to a tutorial? (I checked Terran's BFAQ, I didn't see anything that would help me on there)

~Hyde
Title: Re: Troubles with dialog, a typical "select your conversation".
Post by: Ashen on Sun 15/05/2005 23:39:23
Bare in mind I'm a dialog-ing novice myself, but AFAIK you don't actually have to do anything.

By default, the dialog options should display on a black background at the bottom of the screen when you call RunDialog(x). If you want to use a custom GUI to change the look or the placement, you just have to make a 'text window' GUI (the checkbox on the GUI window) - no listboxes, labels or other messing around needed.

Or have I misunderstood the problem, and you're trying to do something else? Like I said, I'm not too familiar with the dialog system either.
Title: Re: Troubles with dialog, a typical "select your conversation".
Post by: Nine Toes on Sun 15/05/2005 23:59:59
I kind of figured that's what should have happened, with the black box and all, but that's not what happened...

See, what I did, under the NPC's interaction editor, under "talk to character", I put this script:


cLibrarian.say("What can I do for you, young man?...");
RunDialog(0);


When I tested the game, I spoke to the NPC, and instead of listing the options at the bottom of the screen, it just made the player character and the NPC say what was listed in the script:

The script

@1
PETE: "Do you have any books on ghosts?"
LIBRARIAN: "Try the second floor, adult fiction, listed under \"G\"."
option-on 2;

@2
PETE: "More specifically, do you have any books on ghost hunting?"
LIBRARIAN: "Ghost... hunting, did you say? I'm not too sure, but you could try the second floor, adult fiction, listed under \"G\"."

@3
PETE: "Nothing, thank you."
stop


...and here's what happened...

Librarian: What can I do for you, young man?...
Pete: Do you have any books on ghosts?
Librarian: Try the second floor, adult fiction, listed under "G".
Pete: More specifically, do you have any books on ghost hunting?
Librarian: Ghost... hunting, did you say? I'm not too sure, but you could try the second floor, adult fiction, listed under "G".
Pete: Nothing, thank you.

... no selectable options, no listbox/textbox of any type, it just made the characters say those things in the order they are in the script.
Title: Re: Troubles with dialog, a typical "select your conversation".
Post by: DinghyDog on Mon 16/05/2005 00:02:54
We-ell, it's simple. Put "return" at the end of each option. Like....

@2
PETE: "More specifically, do you have any books on ghost hunting?"
LIBRARIAN: "Ghost... hunting, did you say? I'm not too sure, but you could try the second floor, adult fiction, listed under \"G\"."
return


EDIT: Also, I can't remember if you can do this.....try putting the librarian's opening line right after @S. As in...

@S
LIBRARIAN: "Blahblahblah"
return

@1
continue on with code.


It's been a while since I did any dialog coding.


-DD
Title: Re: Troubles with dialog, a typical "select your conversation".
Post by: Nine Toes on Mon 16/05/2005 00:14:43
Cool.  :)  Thank you, both of you, for your help.

I'm off to try it out.

~Hyde