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.
Now I want to try something different. I'd like to have a persistent menu at the top of the screen that shows available rooms the player can go to and, upon clicking a room, the player is brought there and the menu remains. I've gone down the rabit hole for Ren'Py documentation but can't get anything to work properly. I attempted with imagebuttons, imagemaps, textbuttons but I can't get anything to work properly. Are there any tutorials or walkthroughs out there specific to something like this? Everything I find refers to separate menu screens. I can't find anything about persistent, on-screen menus.
Any tips or documentation that anyone could supply would be much appreciated.
First of all, I'd avoid the term "persistent" because persistent means something very specific in Renpy - it's to do with persistent variable / information that persists across play sessions. So it'd risk confusing the topic of conversation if you use it.
Secondly, menu is also a specific term in Renpy as well XD! Specifically the game menu, so best to avoid using that term as well unless that's what you're referring to.
What you're describing is kind of called a "HUD" - heads up display, though there's probably a better term that others can give you.
Now, whilst you're new to Renpy and Python: how experienced are you with programming in general? I ask because room navigation isn't something that Renpy has out of the box and you'd have to code all of that from scratch - so I wanted to make sure you exercise some caution before jumping that far into the deep end with no experience. If you have experience and are comfortable with creating a navigation system in your head already, then it shouldn't be a problem at all
The way Renpy shows these addition elements in the game: buttons, clickable stuff, is through Screens. But there's something else you need to be aware of - interactions. Renpy basically will constantly move forward and eat up your CPU processes if until it hits an interaction or game end, this confused the hell out of me when I first started.
So if you were to make a screen, and then show the screen and do nothing else - the game will just end as soon as it starts:
Code: Select all
screen test: text "Hello world" label start: show screen test
Code: Select all
call screen test
And that's what show screen is for: showing a screen means it's always available even during dialogues - so you can click on the little button whilst someone is talking on screen.
There's only one problem: you mentioned your button is going to let people navigate around rooms in your game, so if you show the button during conversations, your player could in theory escape to another room mid-scene.
So, you need to think carefully about how to approach your HUD / UI. You can either use show screen and disable the button (through a variable and the If() action https://www.renpy.org/doc/html/screen_actions.html#If), or call the screen after a scene with dialogues is over.
I suspect you're actually interested in the second scenario - it's what I use in my game. Just a heads up, you'd need to put the call screen statement inside a loop so that it'll keep showing until you've finished the "navigation" portion of the game loop by triggering another scene.
Hope the above makes some sort of sense, if not, I'll try and link more resources.
I kept seeing people refer to "Screens" but didn't understand how they were implemented or how they behave. Thanks so much for clearing this up for me. I'm at work right now but intend to play around with this further tonight.
Users browsing this forum: No registered users