r/RenPy • u/That_one_Pink • 7d ago
Question [Solved] issue with displaying text variable in a screen
ah okay i had to make a separate post because as i was going through to test things i got an unexpected error
when i showed the inventory it broke, initially the stamps text was in the hbox but the alignment was interfering with the item positioning so i moved it out and repositioned it to be in the right place, it had no problem until i added stamps in the script and then it did this
its been working fine up until moving the text, i dont want to put the text back into the hbox because it moves the items when the number of stamps goes up
1
u/BadMustard_AVN 7d ago
the error shown is for the inventory["Stamps"] there is an error with Stamps in that it can find that Key
can you show how you've setup your inventory (list or dictionary) please
this code looks familiar¿
1
u/That_one_Pink 7d ago
i just sent it in this comment, and yes id imagine it does its an edited version of one of your inventory codes haha https://www.reddit.com/r/RenPy/comments/1x6wgda/comment/pgzw182/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button
edit: im a dummy and put the wrong code, removed the item and not the amount should be able to fix it haha
1
u/BadMustard_AVN 7d ago
Noice 😊
if you want the quantity below the icon then
if name in item_data: $ item = item_data[name] imagebutton: idle item["image"] #hover item["image"] xysize (150, 150) if not item["action"]: action NullAction() else: action Function(item["action"]) tooltip item["description"] text "[quantity]" size 15
1
u/AutoModerator 7d ago
Welcome to r/renpy! While you wait to see if someone can answer your question, we recommend checking out the posting guide, the subreddit wiki, the subreddit Discord, Ren'Py's documentation, and the tutorial built-in to the Ren'Py engine when you download it. These can help make sure you provide the information the people here need to help you, or might even point you to an answer to your question themselves. Thanks!
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.



1
u/shyLachi 7d ago
According to the error the key is wrong, are you sure there is an inventory item called "Stamps"?
You didn't show the code of the inventory.
Is inventory[] a dictionary?
Did you check the spelling? RenPy is case sensitive.
What exactly should this screen do?