[CLOSED] Persistent variables reset on game launch

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.
Post Reply
Message
Author
DragoonHP
Miko-Class Veteran
Posts: 758
Joined: Tue Jun 22, 2010 12:54 am
Completed: Christmas
IRC Nick: DragoonHP
Location: Zion Island, Solario
Contact:

[CLOSED] Persistent variables reset on game launch

#1 Post by DragoonHP »

So I'm having this weird problem where my persistent variables are not being saved. Every time I relaunch the game, all these persistent variables are set again.

Code: Select all

    if persistent.test == None:
        persistent.test = True
        print "test"

    if persistent.multiple_id == None:
        print "here"
        persistent.multiple_id = False

    if not persistent.submitted_form:
        persistent.submitted_form = False

    if not persistent.set_volumes:
        print "Volume"
        persistent.set_volumes = True
        _preferences.volumes['music'] = 0.25

    if persistent.game_ids == None:
        print "Game ID"
        print persistent.game_ids
        persistent.game_ids = ["a"]
        print persistent.game_ids
Anyone has any idea why it's happening?

EDIT: Persistent on a new game works perfectly.
EDIT #2: Found the issue. I was saving an unpickle-able class in persistent which caused the persistent to be re generated

Post Reply

Who is online

Users browsing this forum: Google [Bot]