Updating label on new updates (Quest log)

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
Uy27
Regular
Posts: 29
Joined: Wed Apr 04, 2018 2:07 am
Contact:

Updating label on new updates (Quest log)

#1 Post by Uy27 »

So I am using the quest log from jw2pfd: viewtopic.php?f=51&t=25245#p310193

I got it to work.
The thing is, in my game I update it monthly and I just realized that the quests declarations are in a label.

Example:

Code: Select all

label createlog:

    python:

        quests = [ ]




########################################################               
        goals = [ ]
        stages = [ ]

        goals.append(Goal("Test1", _("test")))
        goals.append(Goal("Test2", _("test")))
        goals.append(Goal("Test3", _("test")))


        stages.append(Stage("Test1"))
        stages.append(Stage("Test2"))
        stages.append(Stage("Test3"))

        quests.append(Quest(_("The Test"),
            _("test.*{/b}"),
            _("Main"),
            goals,
            
        log = Questlog(quests, "qlog", "qkey")

        del goals
        del quests
        del stages
            stages))
Now that works fine. But if you add another quest or add to a quest. It will not work in the new updated version (old saves).
So, my question is; is there a way for the labels to update the new stuffs. Like with after_load or something?
Simply calling the createlog label will remove all the existing quests and basically resets it.

I do understand that the code is old, and the maker of the original code hasn't been active since 2017, so getting help with this is probably limited.
But if there are some smart people out there with some great tricks that may be useful I would really appreciate it.

Post Reply

Who is online

Users browsing this forum: No registered users