I recently worked on getting dialog options to work. I also remade the dialogue system a bit to be more flexible. At first, your average piece of dialogue looked like:
['Hello!', 'I am the second message!']
where it would step through the list index by index. It got more complex with dialogue options, and it was kinda awkward overall. Now I use a dictionary that allows me to do things like jump between conversation points by name, as well as do questions more easily. Here's an example.
':start': ['Hello!', 'I am the second message!', 'QYou understand?', ':Ido', ':Idont'],
':Ido': ['Good! I am glad you understand!'],
':Idont': ['Oh, that is too bad.'],
The ':start' key is where the dialog begins. It steps through the list and displays the text associated with that key until the end, a string that has "Q" at the beginning, or a string that has a ':' at the beginning.
A string with a "Q" at the beginning indicates a question. The NPC crops out the first "Q" when sending the text to be displayed, of course. The next strings are the labels to jump to if you respond with YES (the first option, one index further), or NO (the second option, two indices further).
Labels have a ":" at the beginning. You can jump to a label by using a string with the name of the label in the text. So, I can do things like repeat loops. For example, something like:
':start':["QWill you save our village?", ":SURE", ":NOPE"],
':SURE':['Hurray! Here's a sword!"],
':NOPE':['Oh, no, bro! Are you sure?', ':start'],
Should give a continuous loop if you reply with no. I can also change the script depending on the number of times you talk or interact with an NPC, which is nice, too. I might make a video about it soon, though I just outlined it pretty well, I think.
Also, I fixed the text to work better in a window, so that full-screen mode and window resizing should be nicer.
EDIT: Oh, yeah, also I made a cartoon about coding. You can check it out on my YouTube channel here
if you want to. :D