Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
I'm currently making a mystery visual novel. At the end of each case the player will have to answer several questions in a row to come to a conclusion on what happened. Here's a simple example of how I'm doing these bits right now.
Are you looking for a simpler solution or a more optimized one? I suppose your code is simple enough and does not require simplification.
There is a golden rule, if the code works, it's better not to touch it.
If it's about optimization. Then yes, there are ways.
For example, a menu statement already has a label. That is, the code:
A more flexible way of storing the answers would be to use a list. This could allow you make more unique bad endings or easily change the correct answer later.