and I followed through all of the steps of making the inventory system in my RPG game. (Big thanks to her!)
But one thing was, I was wondering how I can move an item from the inventory to equipment with just a click? In her video, =after pressing the image button of the item, it opens up a menu that has equip and discard functions. But I wanted the system to show description when I hover over the equipment, and move it to the equipment tab when I click it. I played other similar ren'py games that can do this and I really wanted to know how.
I don't want to post her whole code here, just that the big inventory is a class, mainly with "equipable" and "consumable" as subclasses, with some stats. inventory is a list, and player equipment tab is in the player class, with the part that equipping an armor changes your stats. And she uses a "selected item" variable to pass the data of the item. I don't want it to be 2 buttons in total and I don't want the icon to stay in the inventory after moving it to the equipment tab.
For now I thought of two ways: using the "selected item" variable but combine the action of the two buttons(equip and then remove from inventory) and then setting it to None at the end, it didn't really work because there are error when the "selected_item" is None. but I put the selected_item in the beginning of the button action, so I don't really know how it works.
The second one just removes the selected_item variable, and replace it with something like player.armor["chest"] (then unequip and append it to the inventory), there's no error this time, but the equipment keeps duplicating themselves, every time you click there's a new duplicate. Even hovering sometimes duplicates it in the inventory.
Then I looked into the console, and I see that the length of the inventory is stranger, I originally have 3 items in my inventory, I put 2 in my equipment, and now the length of the inventory is 3, while I can see 14 icons of the same items.
I have been working on the system for 12 hours non-stop, it seemed so easy at first but I really wanted to know about the secret behind moving a picture and then moving it back. This is my first time using python and although maybe I'm still too ambitious, I still wish to learn more about renpy and python. I'll post the associated codes if anyone wants to help! Thanks a lot~
