I'd like to have something like this (simplified example):
Code: Select all
# File: 01_my_cds_parser.rpy
default my_complex_system_object = SomeComplexClass()
# define my_complex_system_object = SomeComplexClass() # Could also be "define"-d, honestly, it's going to be static state
python early:
def parse_my_cds(lexer):
# ...
def execute_my_cds(parsed_object):
my_complex_system_object.do_some_complex_stuff(parsed_object) # <-- Use the store variable here
def lint_my_cds(parsed_object):
# ...
renpy.register(
"my_cds",
parse=parse_my_cds,
execute_init=execute_my_cds, # I want to use my CDS to initialize some complex state
init_priority=10, # I thought using this would delay its execution until *after* the store was initialized, but no luck
lint=lint_my_cds
)
Code: Select all
# File: my_screen.rpy
screen my_screen:
if my_complex_system_object.flag:
...
else:
...
Code: Select all
NameError: name 'my_complex_system_object' is not defined
Code: Select all
AttributeError: 'StoreModule' object has no attribute 'my_complex_system_object'
Maybe I could create a store itself programmatically instead? Not even sure that's possible, though...
Any help would be greatly appreciated.