[Solved] AttributeError: type object 'Player' has no attribute 'equipment'
Posted: Thu Sep 08, 2022 5:38 pm
So I'm trying to make an equipment screen, but for some reason I'm heading an error which main part you can see below:
File "renpy/common/000statements.rpy", line 609, in execute_call_screen
store._return = renpy.call_screen(name, *args, **kwargs)
File "game/inventory.rpy", line 10, in execute
screen inventory():
File "game/inventory.rpy", line 10, in execute
screen inventory():
File "game/inventory.rpy", line 13, in execute
hbox:
File "game/inventory.rpy", line 14, in execute
vbox:
File "game/inventory.rpy", line 30, in execute
frame:
File "game/inventory.rpy", line 32, in execute
if pc.equipment["head"] != None:
File "game/inventory.rpy", line 32, in <module>
if pc.equipment["head"] != None:
AttributeError: type object 'Player' has no attribute 'equipment'
The problem is I've got no idea what could posiibly go wrong, since I fell like tested every solution i could think of, and current state of it's main code looks like that:
init python:
class Player:
def __init__(self):
self.equipment = {"head": None, "chest": None, "boost": None, "legs": None, "neck": None, "ring": None, "shield": None, "tat": None, "weapon": None}
Can somebody tell me what's wrong about it?
File "renpy/common/000statements.rpy", line 609, in execute_call_screen
store._return = renpy.call_screen(name, *args, **kwargs)
File "game/inventory.rpy", line 10, in execute
screen inventory():
File "game/inventory.rpy", line 10, in execute
screen inventory():
File "game/inventory.rpy", line 13, in execute
hbox:
File "game/inventory.rpy", line 14, in execute
vbox:
File "game/inventory.rpy", line 30, in execute
frame:
File "game/inventory.rpy", line 32, in execute
if pc.equipment["head"] != None:
File "game/inventory.rpy", line 32, in <module>
if pc.equipment["head"] != None:
AttributeError: type object 'Player' has no attribute 'equipment'
The problem is I've got no idea what could posiibly go wrong, since I fell like tested every solution i could think of, and current state of it's main code looks like that:
init python:
class Player:
def __init__(self):
self.equipment = {"head": None, "chest": None, "boost": None, "legs": None, "neck": None, "ring": None, "shield": None, "tat": None, "weapon": None}
Can somebody tell me what's wrong about it?