Page 1 of 1

[CLOSED] Persistent variables reset on game launch

Posted: Thu Dec 09, 2021 2:10 am
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