One thing I need to be able to do frequently in the game I am creating is turn off options for topics from OTHER topics. i.e. the player picks a specific option in Topic 1, and that leads him to Topic 2. In Topic 2 he picks another option, and this one (a) sends him back to Topic 1 and (b) turns off the option leading to Topic 2 so that it is no longer available.
Can anyone help me? If you are still confused by what I mean, here's an example:
Jack can say "Hi", "Bye", or "Give me that money." The last of these options results in the other person saying, "Why should I?", and Jack can then choose "Because I said so," or "Never mind, I don't want it." Picking the first option results in Jack being given the money and takes him back to the first conversation menu, but now it only says "Hi" and "Bye", without the Money-demanding option.
You might be able to do:
goto-dialog x
option-off x
but I'm not sure if it will work, it might just ignore the option-off or do it for the current dialog.
If that doesn't work, use run-script x
then in the global script:
function dialog_request(int parameter){
if(parameter==x){ //same x as in run-script
SetDialogOption(int topic, int option, int newstate);
}
}
goto-dialog then option-off doesn't actually work that way.
I'd suggest
function dialog_request (int parm) {
SetDialogOption (parm / 100, (parm % 100) / 10, parm % 10);
}
This way you can do stuff like
run-script 4251
which will work on Dialog 42, and set its option #5 to state #1 (which is, enabled).
run-script 4250
would turn it off again. Etc.
Thanks for the help guys, I will go apply this right away!