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 trying to change the autosave functionality so that it saves at the beginning of each label instead of saving right before each choice.
I thought the best way to do this would be through a label callback function, but it doesn't seem to work.
init python:
def labelCallback(name,abnormal):
ignored_labels = ["route_menu","splashscreen","main_menu","exit_label","main_menu_screen","save_screen"]
if not name.startswith("_") and name not in ignored_labels:
renpy.force_autosave()
config.label_callback = labelCallback
still it only autosaves right before a choice. What am I doing wrong?
trailsiderice wrote: ↑Tue Feb 27, 2024 1:54 am
I tried that too, unfortunately that also doesn't work.
Put something inside the function to determine if it is called to begin with, like a renpy.notify() statement!
Huh, strangely after trying this, it's suddenly working, even though the only thing I changed was adding the renpy.notify statement. And it continues to work even after removing it.
Not sure what prevented it from working before, maybe it simply needed to recompile or something. In any case, thanks for your help!