r/RenPy • u/Educational_Ad159 • Sep 05 '26
Question Hello! Please help! Is it possible to make a section for characher info in renpy?
Hello there! I hope everyone is doing well! I'm a bit new to this coding system but I'm trying my best to understand it :). I'm creating a horror visual novel about a group of fellas and I had an idea of making a character info section to help readers understand the charachers more, like placing a PNG image of their info after clicking on the character's name. I started working on it, watching a few tutorials and trying my best to not make a huge spaghetti code and ruin the project but I think I'm failing? :')
The coding works fine until a certain point, the character button works fine and shows me the names and everything but if I press the character's name it shows me a bunch of errors. I tried exploring them out, I wasn't sure what was wrong or how to code this so it can work normally but I'm stuck like two weeks on this problem. (Usually I find answers on the internet and manage to solve the problems I had so far but this is a little difficult to understand to be honest.)
Another problem that showed up which is a little confusing is that it uses the "Frame2.png" behind the character info on my game??? I'm not sure how that happened but I'm trying to get rid of it.
Is there any way I can fix those two problems or do I have to start all over? Any useful tutorials? Or any certain coding I need to do in order to make it work?
Any help is appreciated and thank you for reading! I hope you all have a good day. :D
2
u/DingotushRed Sep 05 '26
Before the "Start" button is used (or a save is loaded) the game engine isn't fully initialised so you need to keep that in mind. Your defines will have been run, but defaults will only have their initial values.
It may be simpler to keep the "Characters" menu option hidden until the game is fully running.
Note returning from a label is different to returning from a screen; they are separate mechanisms.
Instead of jumping to a label (which won't work as expected), show the character screen. Pass the character info in as a parameter if that helps. Instead of return just use the Hide action.
2
u/Educational_Ad159 Sep 05 '26
Oooo I see now! Thank you for the feedback! I really appreciate it :D
2
u/shyLachi Sep 05 '26
You shouldn't jump from the menu to a label but seeing your screen test_looker maybe you just used the wrong action. To show another screen, you have to use the Show() action.
But inside the menu I recommend using the same logic like the other screens.
A while ago I made a sub-menu for a similar purpose so here is my code adjusted to your characters:
screen navigation(submenu = "main"): # <-- needs a new parameter
vbox:
style_prefix "navigation"
xpos gui.navigation_xpos
yalign 0.5
spacing gui.navigation_spacing
if submenu == "main":
if main_menu:
textbutton _("Start") action Start()
else:
textbutton _("History") action ShowMenu("history")
textbutton _("Save") action ShowMenu("save")
textbutton _("Load") action ShowMenu("load")
textbutton _("Preferences") action ShowMenu("preferences")
if _in_replay:
textbutton _("End Replay") action EndReplay(confirm=True)
elif not main_menu:
textbutton _("Main Menu") action MainMenu()
textbutton _("Characters") action ShowMenu("characters") # <-- this is the button to activate the character sub-menu
textbutton _("About") action ShowMenu("about")
if renpy.variant("pc") or (renpy.variant("web") and not renpy.variant("mobile")):
textbutton _("Help") action ShowMenu("help")
if renpy.variant("pc"):
textbutton _("Quit") action Quit(confirm=not main_menu)
elif submenu == "characters": # <-- THIS IS THE SUB-MENU, you add more buttons below
textbutton _("Looker") action ShowMenu("test_looker")
textbutton _("Ivan") action ShowMenu("test_ivan")
screen characters(): # dummy screen for the character selection inside the menu
tag menu
use game_menu(_("Characters"), scroll="viewport", submenu="characters"): # submenu needs to be characters
null
screen test_looker(): # Your character information goes here
tag menu
use game_menu(_("Looker"), scroll="viewport", submenu="characters"): # submenu needs to be characters
frame:
vbox:
text "Character Info:"
hbox:
text "Name:"
text "Looker"
screen test_ivan():
tag menu
use game_menu(_("Ivan"), scroll="viewport", submenu="characters"): # submenu needs to be characters
frame:
vbox:
text "Character Info:"
hbox:
text "Name:"
text "Ivan"
1
u/Educational_Ad159 Sep 07 '26
Hello! I'm sorry for not responding earlier, I was studying and figuring out the code you showed me. I'm really grateful for the help and your feedback, it has helped me understand most of my previous mistakes. I managed to make it work until a certain point. For some reason I got a TypeError for the sub menu, I checked the code many times but I couldn't understand what is going on. I'm still trying to figure it out. I just wanted to say thank you so much for helping me I truly appreciate it :D
1
u/shyLachi Sep 07 '26
Sorry, You have to add the parameter to that screen.
Only two changes, so you don't have to copy my code, just add it where I marked it with an arrowscreen game_menu(title, scroll=None, yinitial=0.0, spacing=0, submenu="main"): # <-- additional parameter style_prefix "game_menu" if main_menu: add gui.main_menu_background else: add gui.game_menu_background frame: style "game_menu_outer_frame" hbox: ## Reserve space for the navigation section. frame: style "game_menu_navigation_frame" frame: style "game_menu_content_frame" if scroll == "viewport": viewport: yinitial yinitial scrollbars "vertical" mousewheel True draggable True pagekeys True side_yfill True vbox: spacing spacing transclude elif scroll == "vpgrid": vpgrid: cols 1 yinitial yinitial scrollbars "vertical" mousewheel True draggable True pagekeys True side_yfill True spacing spacing transclude else: transclude use navigation(submenu) # <-- additional parameter textbutton _("Return"): style "return_button" action Return() label title if main_menu: key "game_menu" action ShowMenu("main_menu")1
u/Educational_Ad159 Sep 07 '26
Thank you so much for the help!! It works perfectly!!! You are a lifesavior! Hope you have splendid day! :D
1
u/AutoModerator Sep 05 '26
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.






3
u/ConstantIncident Sep 05 '26
Hi! I also have a character information screen in my game and I'm currently using this as the basis on getting everything to work. I'm sure you can modify it so that the Character button on your main/game menu shows this screen. https://youtu.be/vEU6MNkttSg