Troubles with dialog, a typical "select your conversation".

Started by Nine Toes, Sun 15/05/2005 22:45:00

Previous topic - Next topic

Nine Toes

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
Watch, I just killed this topic...

Ashen

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.
I know what you're thinking ... Don't think that.

Nine Toes

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:

Code: ags

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
Code: ags

@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.
Watch, I just killed this topic...

DinghyDog

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
It's yer owld pal Dinghy Dog!!

Nine Toes

Cool.  :)  Thank you, both of you, for your help.

I'm off to try it out.

~Hyde
Watch, I just killed this topic...

SMF spam blocked by CleanTalk