define chapter_tuple_1 = [ ("1. Anon meets Fang.", "chapter_1"), ("2. Fourth day of school.", "chapter_2"), ("3. Showing up at band practice.", "chapter_3"), ("4. Anon needs help during music period.", "chapter_4"), ("5. Fang and Anon cut class to talk on the roof.", "chapter_5"), ("6. Anon helps Fang find a venue for the band.", "chapter_6") ] define chapter_tuple_2 = [ ("7. Concert day.", "chapter_7"), ("8. Anon and Fang study together.", "chapter_8"), ("9. Trish ridicules Anon in front of the school.", "chapter_9"), ("10. Fang goes to Anon's apartment.", "chapter_10"), ("11. School assignment and route lock.", "chapter_11") ] define tuples_index = [ ("Chapters 1 to 6", chapter_tuple_1), ("Chapters 7 to 11", chapter_tuple_2) ] default selected_tuple = None init python: def select_chapter(): global selected_tuple, current_chapter while True: selected_tuple = renpy.display_menu(tuples_index + [("Go Back", "go_back")]) if selected_tuple == "go_back": renpy.jump("chapter_select") current_chapter = renpy.display_menu(selected_tuple + [("Go Back", "go_back")]) if current_chapter == "go_back": continue else: break set_stats() def set_stats(): global chapter_list_length, chapter_list_index, ending_route_number, is_end_reached chapter_list_length = len(chapter_list) - 1 find_chapter_in_array() renpy.call(current_chapter) def find_chapter_in_array(): global chapter_list_index, current_chapter try: chapter_list_index = chapter_list.index(current_chapter) except ValueError: chapter_list_index = -1 current_chapter = "" label chapter_select: scene black stop sound stop music menu: "Initialize scores:" "Ending 1": $ anon_score = 0 $ fang_score = 0 $ ending_route_number = 1 "Ending 2": $ anon_score = 0 $ fang_score = 4 $ ending_route_number = 2 "Ending 3": $ anon_score = 4 $ fang_score = 0 $ ending_route_number = 3 "Ending 4": $ anon_score = 4 $ fang_score = 4 $ ending_route_number = 4 "Exit to main menu": return $ lock_scores = True call initstats(anon_score, fang_score) from _call_initstats_2 $ select_chapter()