I have a strange problem.
If I start a game, purchase an item, adding it to my inventory, then go back to the main menu and start a new game; the inventory from my previous game is maintained. Example: I start a game, purchase chocolates, the chocolates follow through on a new game.
However! If I save a game, and go back into the game, the chocolate is no longer in my inventory.
These are all in my declarations.rpy file.
Code: Select all
define itemArr = [0,0,0,0,0,0,0,0]
define itemIArr = ['items/item1.png', 'items/item2.png', 'items/item3.png', 'items/item4.png', 'items/item5.png', 'items/item6.png', 'items/item7.png', 'items/item8.png']
define emptyArr = ["", "", "", "", "", "", "", ""]
My function is in functions.rpy
Code: Select all
init python:
def invent():
global emptyArr
i = 0
while i < len(itemArr):
if itemArr[i] > 0:
emptyArr[i] = itemIArr[i]
i+=1
return
Code: Select all
screen inventory:
$invent()
modal True
imagemap:
ground "gui/menu/items.png"
hover "gui/menu/items_hover.png"
hotspot(999,195,40,40) clicked Hide("inventory")
hbox:
xpos 240
ypos 235
spacing 22
for x in emptyArr:
if x != "":
image x
hbox:
xpos 300
ypos 290
spacing 80
for x in itemArr:
if x !=0:
text "{b}[x]{/b}":
min_width 22
In my quick_menu, I call this with my imagemap.
Code: Select all
hotspot(1121,0,38,30) clicked Show('inventory')