Code: Select all
I'm sorry, but an uncaught exception occurred.
While running game code:
File "game/reusable.rpy", line 110, in script
python:
File "game/reusable.rpy", line 119, in <module>
questlist.RemoveQuest(1)
File "game/quests.rpy", line 21, in RemoveQuest
if o.Id == id:
AttributeError: 'Quest' object has no attribute 'Id'
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "game/reusable.rpy", line 110, in script
python:
File "C:\Users\joscr\OneDrive\Documents\renpy-8.1.1-sdk\renpy\ast.py", line 1138, in execute
renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
File "C:\Users\joscr\OneDrive\Documents\renpy-8.1.1-sdk\renpy\python.py", line 1122, in py_exec_bytecode
exec(bytecode, globals, locals)
File "game/reusable.rpy", line 119, in <module>
questlist.RemoveQuest(1)
File "game/quests.rpy", line 21, in RemoveQuest
if o.Id == id:
AttributeError: 'Quest' object has no attribute 'Id'
Windows-10-10.0.22621 AMD64
Ren'Py 8.1.1.23060707
Rockwood 0.18v "Startup[WIP]"
Thu Jul 20 20:56:54 2023
Code: Select all
init python:
class Quest ():
def __init__(self, name, description, Id, available = False, started = False, completed = False):
self.name = name
self.description = description
self.available = available
self.started = started
self.completed = completed
self.Id = Id
class QuestList ():
def __init__(self):
self.quests = []
def AddQuest(self, quest):
self.quests.append(quest)
def RemoveQuest(self, id):
for i, o in enumerate(self.quests):
if o.Id == id:
self.quests[i].completed = True
self.quests[i].available = False
else:
n('did not work')
#QuestList
default quest_01 = Quest("Use Bathroom Keys", "Diana is trying to use the bathroom and I have the keys to open the door.", 1, True, True, False)
default quest_02 = Quest("Talk to Diana", "Diana seems to want to talk, You should out what she wants.", 2, True, False, False)
default questlist = QuestList()