Two questions about dialogs [SOLVED]

Started by TheMagician, Mon 31/01/2005 10:44:33

Previous topic - Next topic

TheMagician

Hi everybody!

Question 1:

Is there a way to keep the last available dialog option from being run automatically?

Question 2:

I want to have a dialog like this:


Dialog-Topic 1                 Dialog-Topic 2

1.
2. -------------------------> 1.      \
3.                                    2.      }  When all three are completed go back
4. Good bye                    3.      /   to topic 1.


So, there are 2 topics. If you click on option 2 in topic 1 the conversation switches to dialog two (I already got this running using "goto-dialog".

However, I don't know how to code the second part: If all three options in topic 2 have been talked through at least once -> go back to dialog one.

Do I really need to set up three global variables (one for each option) and always run a script from each dialog option to check whether all three variables are "1" (meaning all three options have been selected) ?

Many thanks in advance,
Stefan

Scorpiorus

Quote from: TheMagician on Mon 31/01/2005 10:44:33Is there a way to keep the last available dialog option from being run automatically?
I think you need to have at least two options or a text parser as one of the options.
Try adding an extra option but leaving its name blank (i.e. not even spaces).

QuoteDo I really need to set up three global variables (one for each option) and always run a script from each dialog option to check whether all three variables are "1" (meaning all three options have been selected) ?
Yeah, this seems like the easiest way in case you want the options to stay.
Alternatively, you can disable an option once it's chosen and then use GetDialogOption within dialog_request to check if all options are disabled and then goto topic 1.

TheMagician

Thanks Scorpiorus!


QuoteTry adding an extra option but leaving its name blank (i.e. not even spaces).

I will give that a try.
(I think I already did and it didn't work)

QuoteYeah, this seems like the easiest way in case you want the options to stay.
Alternatively, you can disable an option once it's chosen and then use GetDialogOption within dialog_request to check if all options are disabled and then goto topic 1.

In the beginning I didn't want the options to stay after they are completed. I wanted to script it just like you suggested with "GetDialogOption within dialog_request".

Actually I still want to do it that way now.
However, there is one problem:

@S
return

@1
Ego: blabla
option-off 1
run-script 77 // checks if all three options are turned off
return

@2
EGO: blabla
option-off 2
run-script 77 // checks if all three options are turned off
return

@3
EGO: blabla
option-off 3
run-script 77 // checks if all three options are turned off
return


I always get the error "DoDialog: All options turned off" ... well I can understand that error because I disable the third option just before the "checking" script is executed.

Any ideas?

btw: one more question: I always script dialogs this way

EGO: How are you?

and I don't get any errors. However the manual and the forums always write

EGO: "How are you?"

with quotation marks. Is there a difference?

Scorpiorus

#3
Quote from: TheMagician on Mon 31/01/2005 12:28:09
QuoteTry adding an extra option but leaving its name blank (i.e. not even spaces).

I will give that a try.
(I think I already did and it didn't work)
I've just tried it and it worked fine for me. :) That's cool because...
QuoteI always get the error "DoDialog: All options turned off" ... well I can understand that error because I disable the third option just before the "checking" script is executed.

Any ideas?
...that problem can now be solved easily:

Just add an extra option (Show: yes, Say: no)

And put the following dialog script:

@S
return

@1
Ego: blabla
option-off 1
return

@2
EGO: blabla
option-off 2
return

@3
EGO: blabla
option-off 3
return

@4 // blank option
goto-previous

You see, when all options are disabled the 4th one will be chosen automatically which code is to return to topic 1.

When you try choosing option 2 in topic 1 again it still will immediately return you back.

Quotebtw: one more question: I always script dialogs this way

EGO: How are you?

and I don't get any errors. However the manual and the forums always write

EGO: "How are you?"
It doesn't matter. Just for the second case there will be a text emclosed with quotation marks.

TheMagician

Thanks Scorpiorus!

I will try it as soon as I can.

And the blank option is not clickable? If so, it is  an elegant workaround   ;D

Thanks again for helping.

Scorpiorus

No problem :)

Quote from: TheMagician on Mon 31/01/2005 14:40:30And the blank option is not clickable? If so, it isÃ,  an elegant workaroundÃ,  Ã, ;D
Yeah, that's the neatest thing! It just isn't displayed at all -- I tested it by putting another option after it.

SMF spam blocked by CleanTalk