I have a minigame where the protag brings 2 goods from one person to another, with a time limit.
At first, I don't have any problem, but when the 2nd times of the same minigame starts, the goods from the last minigame which haven't been delivered is still saved in the inventory, so my question is, how to remove that?
I'm not using python, I'm just using if and turn around script using renpy, basicallly, my codes is something like this :
Code: Select all
goods = ["table","chair","cup","glass","plate","fan"] around 5 or 7 object is inside
This variable will be used to describe which object that the client want to have by presented it on the game screen using :
$ achoice = renpy.random.choice(goods)
if achoice == "table":
show table at Position(xpos=xx, ypos=yy)
$ goods.remove("table")
====
carry = [ ] limited to 2 object
This variable will be used to describe the object that protag carries, limited to 2 object and start with []
====
ordergoods = ["table","chair","cup","glass","plate","fan"]
This variable will be used when protag wants to take an object from the supplier, he will be asking for an object which the supplier will open a menu with the list of goods. Protag can choose from that menu, and will be removed after the protag takes one object.
====
The scenario start when the time already reach it's limit, but protag still carry either one or two object in his hands. This gives no problem when the minigame won't be called again, but the problem arise when the minigame start again. First, I use either
$ carry.remove(ordergoods)
or
$ carry = [ ]
or by describing the object one by one
if carry("chair"):
$ carry.remove("chair") and such
but they aren't working. When I use $ carry = [ ] and check the stored variable using Shift + D, the variable $ carry is indeed become empty ( showing [ ] ), but when I click the client, the object still there! I still can give the object from before, and resulted in traceback because there aren't any object to remove.