I want to use menus for conversation choices - the menu will list dialogue choices, which you can select to open the appropriate text boxes and advance the conversation. So far so good, but what I'm looking for is an efficient way to handle situations where you might want the dialogue choices to disappear after being selected.
For example, an NPC has 3 pieces of information that the player *must* read, but they may choose the topics in any order they wish.
Let's say "where am I?" , "who are you?" and "what is the time?". After each question has been asked the "topic" (caption) is removed from the menu, and when all 3 choices have been selected the conversation advances.
I understand there is a way to do this using tags and if statements, but is there a better way to achieve the outcome I want using plotscripting? I don't want to bulk my game out with superfluous numbers of tags for each conversation.
Kind regards, and have a slice of cake for your troubles .
Last edited by guo on Wed May 04, 2016 9:16 am, edited 1 time in total.
Hmm... I can't think of an easier way than with tags. It could be done with globals and scripting, but that definitely won't be less work, and the only thing less cluttered about it will be the tags menu.
Maybe in the future we could have one-time-tags for menu items, just like we do for NPCs but I don't know how long that will take, so don't hold up your game waiting for it.
I agree that tags are probably best. I think the pros about using global variables is that you can keep them more organized more easily, but tags can be just as good.
I'd warn that you know ahead of time how many tags you'll be using and how you're going to organize them so you can set a series of tags (eg. from 10-19) to be recycled as conversation tags. It can get overwhelming pretty fast and it sucks when you encounter a logic error because there's a lot of info to work with.
Cheers. The way I was thinking of doing it was to have a variable increment by 1 for each choice selected, and delete menu item to remove the choice. Once the requisite number of choices has been reached an "if" statement jumps to the next part of the conversation. I can't really get my head around how to implement it well though.
I'll go with tags for now, and use KK's suggestion of reserving a set of tags for conversations as mentioned.[/code]
I would write a script which advances the conversation when enough menu items have been disabled. Trying to do that purely with tags would be nasty. The script would run as a while loop until the menu is closed, constantly checking whether to advance. You could reuse the same script for all such conversations, so you wouldn't be scripting every conversation. You could use tags to disable the menu items once they are used, or you could script that in a generic way as well, so that you only need one script.
For example you could put a hidden menu option at the end of every conversation menu (with a tag condition that is always false), which is the link to the next textbox/menu when that menu is exhausted. You could either enable that menu with the script and have the player select it, or read the data out of it and show the textbox/menu automatically. You could even make use of the extra data on that menu item to store settings like how many of the choices you need to read, rather than all of them.
Last edited by TMC on Thu May 05, 2016 6:39 am, edited 1 time in total.