Code: Select all
default quests = [
Quest(1, "QuestName", "Running"),
Quest(2, "QuestName", "Pending"),
]
Code: Select all
default quests = [
Quest(1, "QuestName", "Running"),
Quest(2, "QuestName", "Pending"),
Quest(3, "QuestName", "Pending"),
]
So, my question is how to update this default variable when I add a new quest to the list in a future version of the game.
Players might play an older version of the game, save it, and then continue playing the newer version, but the saved data would still contain the old quest list.
I have some pseudo code, but I don't know how to implement it properly in this situation:
Code: Select all
# Check if the new quest is already in the list of default quests.
if new_quest not in default_quests:
# If the new quest is not in the list of default quests, add it to the end of the list.
default_quests.append(new_quest)
# Return the updated list of default quests.
return default_quests