Move story global variables initialization to the "initstats" label

This commit is contained in:
Iggy 2024-08-18 22:45:14 -03:00
parent 806151f430
commit ce05fd5cdb
2 changed files with 14 additions and 21 deletions

View file

@ -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: init -1 python:
def ending_image(): def ending_image():
#0b0000, DCBA, flash the bits with |=, check with & #0b0000, DCBA, flash the bits with |=, check with &

View file

@ -9,6 +9,15 @@ label initstats(anon=0, fang=0):
$ fangscore = fang $ fangscore = fang
$ wingStory = False $ 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: if persistent.enable_debug_scores:
$ debug_story_variables(False) $ debug_story_variables(False)
$ debug_story_variables(True) $ debug_story_variables(True)
@ -28,21 +37,16 @@ init python:
return 1 # Shooter return 1 # Shooter
def debug_story_variables(toggle=True, use_ending_chapter=False): def debug_story_variables(toggle=True):
var_list = [ var_list = [
"anonscore", "anonscore",
"fangscore", "fangscore",
"chapter_index", "current_chapter",
"ending_route_number", "chapter_list_length",
"ending_chapter_index" "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: for item in var_list:
if toggle: if toggle:
renpy.watch(item) renpy.watch(item)