I'm working on a text-based RPG in Python, but I'm stuck on NPCs. I need something that's kind of like a tree. For example:
Bot: hello there.
1. Hi, what's your name?
2. Hi, Where do you live?
> 2
Player: Where do you live?
Bot: That's a creepy question. Why do you ask?
1. I was just curious.
2. Never mind.
3. Hide yo kids, hide yo wife
> 1
Player: I was just curious.
Bot: Okay.
1. Do you like cheese?
2. Bye.
> 1
Player: Do you like cheese?
Bot: Yes! I LOVE cheese.
Each choice you make would branch off to other choices, A.K.A. if the user had answered '1' for the first question the bot would answer "My name is Bob. What's yours?"
My game is designed in a way where a level editor would not be an impossible prospect (every place you can visit is stored as a key in a dictionary, then a tuple containing everything in it [I have a shop class, an enemy class, a 'portal' class, and soon an NPC class]). So I'd like this created in a way so I can hold it all in a variable that my NPC class has stored (not a bunch of 'if' statements)
Just to clarify, I am NOT asking for someone to write code for me, I am just unsure about how to approach the problem.
Shortened description of exactly what I need:
The tree-like structure that begins with one string with some strings that 'branch off' from it
Each one of those strings has more 'branches'
The difference from this and a tuple of tuples is that there needs to be a string where they branch off rather than an immediate split.