Jibble

Author Topic: Two questions about dialogs [SOLVED]  (Read 1008 times)

Two questions about dialogs [SOLVED]
« on: 31 Jan 2005, 10:44 »
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
« Last Edit: 02 Feb 2005, 16:23 by TerranRich »

Scorpiorus

  • 100101101010b
    • Scorpiorus worked on one or more games that won an AGS Award!
    •  
    • Scorpiorus worked on one or more games that was nominated for an AGS Award!
Re: Two questions about dialogs
« Reply #1 on: 31 Jan 2005, 11:53 »
Is 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).

Quote
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) ?
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.

Re: Two questions about dialogs
« Reply #2 on: 31 Jan 2005, 12:28 »
Thanks Scorpiorus!


Quote
Try 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)

Quote
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.

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

  • 100101101010b
    • Scorpiorus worked on one or more games that won an AGS Award!
    •  
    • Scorpiorus worked on one or more games that was nominated for an AGS Award!
Re: Two questions about dialogs
« Reply #3 on: 31 Jan 2005, 13:43 »
Quote
Try 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...
Quote
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?
...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.

Quote
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?"
It doesn't matter. Just for the second case there will be a text emclosed with quotation marks.
« Last Edit: 31 Jan 2005, 13:44 by Scorpiorus »

Re: Two questions about dialogs
« Reply #4 on: 31 Jan 2005, 14:40 »
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

  • 100101101010b
    • Scorpiorus worked on one or more games that won an AGS Award!
    •  
    • Scorpiorus worked on one or more games that was nominated for an AGS Award!
Re: Two questions about dialogs
« Reply #5 on: 31 Jan 2005, 14:46 »
No problem :)

And 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.