Save the Kingdom Good Text Adventure Game
First Choose any character, then once you equip something it shows your inventory, but how come all of them change when slotNumber can only be one thing? (Info on line 1067 in main.py)
That's way more code than I'm willing to wade through, but I'm assuming that they all change because the
player values all =
None, just like
slotNumber = None. This is the only way I can see for them to all change at once.
Figure out why
player.accessorySlot1 and all the others within
storeInventoryHelp function don't have any values and that should help you solve the problem.
@AlexSilyaev I think this may be the source of your problem. From the file
#inventory #The Rings, Amulets, Necklaces self.accessorySlot1 = None self.accessorySlot2 = None self.accessorySlot3 = None #The Weapons self.weaponSlot1 = None self.weaponSlot2 = None self.weaponSlot3 = None #The Armor self.armorSlot1 = None self.armorSlot2 = None self.armorSlot3 = None #The Potions self.potionSlot1 = None self.potionSlot2 = None self.potionSlot3 = None
All of these values are set to
None. When you get to the
if statements starting on line 1071, every single line evaluates as True, because they are all defined as
None, which matches the variable