Hi all,
Forgive me if this is a silly question - I'm probably missing something obvious - but I haven't been able to work out an easy solution.
Is there an easy way of clicking on an character... and IF all dialogue options available at that time (except one e.g. the "Goodbye" option) have previously been exhausted, the player character can simply state something like "I've got nothing else to say to them right now". At the moment in my game, once all dialog options are exhausted the "Goodbye" option remains... so interacting with a character again (when dialog is exhausted) just results in a "Hello"..."Hello"..."Goodbye"..."Bye" sort of sequence.
Any suggestions much appreciated! Thanks :)
Shaun
You can probably do something like
int GetChoiceCount(this Dialog*) {
int choices = 0;
for (int i = 1; i <= this.OptionCount; i++) if (this.GetOptionState(i) == eOptionOn) choices++;
return choices;
}
Now you can do something like:
if (dMerchant.GetChoiceCount() > 1) dMerchant.Start();
else player.Say("I've got nothing else to say to them right now");
Thanks so much Khris - that looks incredible. I'll try it out tonight. :)
It pops up with this error when I click on a character. I'm guessing I need to tweak something, but not quite sure what?
(https://i2.paste.pics/6c3d0b4b47c63688beaf1a29eb5c050b.png)
Many thanks,
Shaun
I think choices starts at 1 not 0. Edit: dialog choices not your variable that has confusingly the same name.
Edit: use this.GetOptionState (i+1)
Thanks eri0o!! It works perfectly now :)
The inconsistent numbering can really be a pain sometimes :-\
I fixed the code in my post above.