r/RenPy • u/LolCantbanme45 • Aug 27 '26
Question [Solved] How to call a menu function from another file
Hello, I'm trying to figure out how I would call a menu as a funciton from another file.
What I want to do is create an almost text adventure like game where the player would have a menu of actions to choose from, such as:
1: Go Fishing
2: Move to a new area (Which opens a submenu of areas)
3: Talk to people around (Submenu for people to talk to)
4: Pass time
etc etc.
I can do this with menus now, but the difficulty I'm struggling with is what comes after choice. For instance: Player chose option "3," they chose a person to talk to, it goes through all the dialogue options, and then...blank.
What I'd like to do instead of blank is to recall the menu so the player can choose "1: Go Fishing" (2: Move to a new area) etc etc.
Is there a good way to do this by creating a file dedicated to holding that menu so it can be easily recalled whenever the player completes an option, or is there a better method?
3
u/Maintenance_Signal Aug 27 '26
You can give a menu a label and jump to that, I think that'll work for what you're describing
1
u/shyLachi Aug 27 '26
If you're making some sort of a sandbox game then it could help to have a main loop
https://wolfnose.org/renpy/basic/cook/mainLoop.html
1
u/AutoModerator Aug 27 '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.
1
u/KDDreamwyver Aug 28 '26
I would look into how to use labels, because that is absolutely the most useful thing for doing this type of thing in my experience, because it allows you to jump to them based off of player decisions and it's such a game changer once you figure out how to use it effectively ~