From ce05fd5cdbbe1168720700f09890b59c8a6f5146 Mon Sep 17 00:00:00 2001 From: Iggy Date: Sun, 18 Aug 2024 22:45:14 -0300 Subject: [PATCH] Move story global variables initialization to the "initstats" label --- game/storyline.rpy | 11 ----------- game/utility.rpy | 24 ++++++++++++++---------- 2 files changed, 14 insertions(+), 21 deletions(-) diff --git a/game/storyline.rpy b/game/storyline.rpy index d7abd0a..5b43f5b 100644 --- a/game/storyline.rpy +++ b/game/storyline.rpy @@ -12,17 +12,6 @@ define ending_routes = { } -default chapter_list_length = len(chapter_list) - 1 -default chapter_list_index = 0 # Index number for the current position of the general chapters array - -# This stores the name of the label as a string -# When starting a new game, it takes the first element of the chapter_list array -default current_chapter = chapter_list[chapter_list_index] - -default ending_route_number = None -default is_end_reached = False - - init -1 python: def ending_image(): #0b0000, DCBA, flash the bits with |=, check with & diff --git a/game/utility.rpy b/game/utility.rpy index 850a522..e7a1b6d 100644 --- a/game/utility.rpy +++ b/game/utility.rpy @@ -9,6 +9,15 @@ label initstats(anon=0, fang=0): $ fangscore = fang $ wingStory = False + # Chapter related variables + $ chapter_list_length = len(chapter_list) - 1 + $ chapter_list_index = 0 # Index number for the current position of the chapter_list array + $ current_chapter = chapter_list[chapter_list_index] # Store the name of the label as a string + + # Ending related variables + $ ending_route_number = None + $ is_end_reached = False + if persistent.enable_debug_scores: $ debug_story_variables(False) $ debug_story_variables(True) @@ -28,20 +37,15 @@ init python: return 1 # Shooter - def debug_story_variables(toggle=True, use_ending_chapter=False): + def debug_story_variables(toggle=True): var_list = [ "anonscore", "fangscore", - "chapter_index", - "ending_route_number", - "ending_chapter_index" + "current_chapter", + "chapter_list_length", + "chapter_list_index", + "ending_route_number" ] - - if use_ending_chapter: - var_list.remove("chapter_index") - var_list.append("current_ending_chapter") - else: - var_list.append("current_general_chapter") for item in var_list: if toggle: