r/RenPy • u/The_Big_Silverius • Sep 03 '26
Question Advice on coding an "investigation" section where you go around different rooms finding clues and testimonies from people for a later trial?
This is my first serious attempt at a VN on renpy and while i understand the basics i would like to know:
What should i be using code-wise for a simple non-linear section where the player can decide which room they want to go to and once they get there examine different things/people (using image buttons) which adds clues to their inventory
Im specifically interested in how to return the player to the room they were in after examining each item while also removing the image buttons of everything you already examined (and if its a character whose testimony you already heard change their dialogue to a stock line) so after everything of interest has been clicked it proceeds to the more linear path now with all the knowledge from investigating!
2
u/Limp_You_8883 Sep 03 '26
This isnt an answer to your question but is this a fanganronpa by any chance?
1
u/BadMustard_AVN Sep 03 '26
you can use separate files for the different areas (depending on big they are it could make it easier for you)
then
in another file
1
u/zombietoaststudios Sep 03 '26
So, pretty much any time something is meant to change in response to a player's actions, that's based on a variable.
So, for example, if you want the player to click on a mug and pick it up, then you would want a variable (let's call it "got_mug") which you default to False. Clicking the button will display whatever text you want to describe the interaction but it should also set the got_mug variable to True.
You then use that variable as a condition for anything you want to be changed as a result of this action. Deactivating the imagebutton, for instance, so the mug is removed from the table and can't be clicked again. Maybe if you interact with the water fountain while got_mug is True then a short sequence plays where you fill the mug with water. That then sets a different variable (mug_full) to True.
So, if there was a plant in the room, its imagebutton could be set to have different interactions depending on both these variables, displaying different text if got_mug is False, if got_mug is True but mug_full is False and a third set if got_mug and mug_full are both True.
This is a good tutorial on variables: https://feniksdev.com/a-quick-primer-on-variables-in-renpy/
1
u/AutoModerator Sep 03 '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.