Can Ren'Py do...?
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Can Ren'Py do...?
Hi there, I'm a new possible user/developer of Ren'Py, and I'm trying to determine if Ren'Py is suitable for my team's Ren'ai game. I'll probably add to this thread as questions come up. As much fun as writing another engine would be, there's no sense in doing that if Ren'Py does the job.
So, my first question:
Can Ren'Py do dynamic menus? For example, let's say that I have a list stored in user-state, maybe with some strings and function names, and I want to build a menu out of that list. Is that possible?
So, my first question:
Can Ren'Py do dynamic menus? For example, let's say that I have a list stored in user-state, maybe with some strings and function names, and I want to build a menu out of that list. Is that possible?
- PyTom
- Ren'Py Creator
- Posts: 16096
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Yes.
There are three ways you can do this, depending on how static the menu is, and how much programming you want to do.
The first is to use a menu with conditions on it. These conditions control which menu options are presented to the user. For example:
And so on.
The second way is to use renpy.display_menu. You should use this if the menu choices are constructed dynamically, like you seem to be proposing. So you could have:
This code will jump to the label in the second part of the tuple. If you want to do something more sophisticated, you can actually use the value of result for something.
Finally, you can use the ui functions to build your own user interface. Check out the dse demo (by running tools/run_dse.bat) to see this in action.
Could you describe your game in a little more detail? Ren'Py is focused on Visual Novels and, to a lesser extent, Dating Sims. (Mostly lesser because I haven't worked with a user who seriously wanted to make a DS.)
There are also some provisions for extension if someone wanted to integrate pygame-based minigames with Ren'Py, but those provisions aren't overly documented.
Oh, and welcome to the forum. (I've been a bit negligent in welcoming new users, recently, so welcome to everyone else who's new.)
There are three ways you can do this, depending on how static the menu is, and how much programming you want to do.
The first is to use a menu with conditions on it. These conditions control which menu options are presented to the user. For example:
Code: Select all
menu:
"Choice 1" if allow_choice_1:
jump choice_1_target
"Choice 2" if allow_choice_2:
jump choice_2_target
...
The second way is to use renpy.display_menu. You should use this if the menu choices are constructed dynamically, like you seem to be proposing. So you could have:
Code: Select all
# These choices are probably computed by python code.
$ choices = [
( "Where do you want to go?", None),
( "Go to school", "school" ),
( "Go to work", "work" ),
( "Go wild." , "wild"),
]
$ result = renpy.display_menu(choices)
jump expression result
Finally, you can use the ui functions to build your own user interface. Check out the dse demo (by running tools/run_dse.bat) to see this in action.
Could you describe your game in a little more detail? Ren'Py is focused on Visual Novels and, to a lesser extent, Dating Sims. (Mostly lesser because I haven't worked with a user who seriously wanted to make a DS.)
There are also some provisions for extension if someone wanted to integrate pygame-based minigames with Ren'Py, but those provisions aren't overly documented.
Oh, and welcome to the forum. (I've been a bit negligent in welcoming new users, recently, so welcome to everyone else who's new.)
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
Well, I don't want to go into too much detail (partly because we're still working on them ourselves, partly so we can be the "first-to-market"), but we are working on a visual novel that leans heavily towards a dating sim. We're planning on building certain extension points into the game to allow for a modular architecture.
And thanks for the warm welcome!
And thanks for the warm welcome!
I was talking about in-game menus. The display_menu() function wasn't a top-level heading, so I didn't find it when I read the documentation.monele wrote:When talking about menus, I always wonder if we're talking about the *main* menu interface (start, load, save) or in-game choices... Random thought ^^;
- PyTom
- Ren'Py Creator
- Posts: 16096
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Okashi is using a custom engine.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
-
- Eileen-Class Veteran
- Posts: 1314
- Joined: Mon Sep 19, 2005 2:15 am
- Completed: Controlled Chaos / Sum of the Parts / "that" Midna game with ZONEsama
- Projects: Sparse Series/Oddments Shop original cartoon in Pevrea; Cybernetic Duels (fighting game); Good Vibin'
- Organization: Watercolorheart Studios
- IRC Nick: BCS
- Tumblr: adminwatercolor
- Deviantart: itsmywatercolorheart
- Github: Watercolordevdev
- Skype: heartnotes
- Soundcloud: Watercollider
- itch: watercolorheart
- Location: Florida
- Contact:
Who is online
Users browsing this forum: Bing [Bot], Ocelot