Ren'Py Can someone help me with inventory? (SOLVED)

Dimss99

Newbie
Jun 12, 2018
15
13
Thank you for entering thread!

I start to learn with ren'py just 2 months ago, and I start with simple things, watch huge bunch of tutorial on youtube, and make some mini-games. Then I have some sort of problem I found solution in different forum, tutorials etc. But with inventory I have difficulties, most tutorials make simple text inventory, but I want to make something like in "Sumertime Saga".

I'm bad with python, so most code I'm making with Ren'py.

So here what I got:

You don't have permission to view the spoiler content. Log in or register now.

Its look's like:
You don't have permission to view the spoiler content. Log in or register now.

I'm spending two days trying different things and searching information in web, but didn't find, nothing. I hope f95 community can help me with that.

Really appreciate any help.
 

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,576
2,204
I haven't looked at your code.

But as a starting point, this thread was discussing inventories recently.
https://f95zone.to/threads/inventory-items-stackable.114983/

Perhaps the discussion there will shed some light on the parts you're struggling with.

As an aside, most inventories are based on Python objects like Lists and Dictionaries. I wrote an introduction to those a while ago. Perhaps that might help too.
https://f95zone.to/threads/newbie-introduction-to-lists-dictionaries-and-classes-in-renpy.75925/

If I can find time, I'll look at your actual code later.
 
  • Like
Reactions: Dimss99

Dimss99

Newbie
Jun 12, 2018
15
13
I haven't looked at your code.

But as a starting point, this thread was discussing inventories recently.
https://f95zone.to/threads/inventory-items-stackable.114983/

Perhaps the discussion there will shed some light on the parts you're struggling with.

As an aside, most inventories are based on Python objects like Lists and Dictionaries. I wrote an introduction to those a while ago. Perhaps that might help too.
https://f95zone.to/threads/newbie-introduction-to-lists-dictionaries-and-classes-in-renpy.75925/

If I can find time, I'll look at your actual code later.
Thanks for the answer,I will check those threads
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,302
15,172
Python:
screen inventory1:
[...]      
        for item in inventory:
            #imagebutton idle "[item[image]]" action [Hide("Inventory1"), Return(None)] ### For some reasen "imagebutton" not working properly
            textbutton "{image=[item[image]]}" action Show("discription_screen")#,SetVariable("item_discription_var","[item[discription]]"), #Function (show_discription,item) # That doesn't work as well :(
            #$ item_discription_var = "[item[discription]]" Iam just trying different stuff...
*sigh*

The imagebutton do not works because text interpolation apply to textual element and, as its name say, an imagebutton is an visual element.

Python:
screen inventory1:
[...]      
        for item in inventory:
            imagebutton:
                idle item["image"]
                # if above don't works, then
                #idle ( "{}".format( item["image"] ) )
                # /Return/ already hide the screen.
                action Return(None)
                tooltip item["description"]

[...]
    $ tooltip = GetToolTip()
    if tooltip:
        text "[tooltip]" xpos 100 ypos 100
 
  • Like
Reactions: Dimss99

Dimss99

Newbie
Jun 12, 2018
15
13
*sigh*

The imagebutton do not works because text interpolation apply to textual element and, as its name say, an imagebutton is an visual element.

Python:
screen inventory1:
[...]  
        for item in inventory:
            imagebutton:
                idle item["image"]
                # if above don't works, then
                #idle ( "{}".format( item["image"] ) )
                # /Return/ already hide the screen.
                action Return(None)
                tooltip item["description"]

[...]
    $ tooltip = GetToolTip()
    if tooltip:
        text "[tooltip]" xpos 100 ypos 100
Omg, thank-you, that's working!
The most sad part is what I already used "tooltip" to describe things in "world map" +_+
The only thing there are one mistake in:
Python:
$ tooltip = GetToolTip()
it's worked
Python:
$ tooltip = GetTooltip()
I really appreciate your help!
Thank-you! :)
 
Last edited:

Dimss99

Newbie
Jun 12, 2018
15
13
Omg, thank-you, that's working!
The most sad part is what I already used "tooltip" to describe things in "world map" +_+
The only thing there are one mistake in:
Python:
$ tooltip = GetToolTip()
it's worked
Python:
$ tooltip = GetTooltip()
I really appreciate your help!
Thank-you! :)
Maybe you can help me with one more thing..?
Can i add information from "item" to "action"..?
For example
Python:
       idle item["image"]
       hover item["image_hover"].
       action Show("inventory_loop_["item[name]"]") # something like that
       tooltip item["description"]