[Solved]Can persistent data be used in Ren'Py to determine whether all image buttons have been clicked on in a screen?

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
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.
Post Reply
Message
Author
User avatar
littlemissyotome888
Regular
Posts: 83
Joined: Thu Jul 19, 2018 7:32 pm
Deviantart: LMO888
itch: littlemissyotome
Contact:

[Solved]Can persistent data be used in Ren'Py to determine whether all image buttons have been clicked on in a screen?

#1 Post by littlemissyotome888 »

Hey guys,

I have a problem that I really need help with. I'm trying to implement a Hidden Object Minigame in my next Visual Novel and I've managed to create one using screen language, image buttons, if statements, and persistent data but I can't figure out how to return to the in game for the player to continue on with the story once all objects are found.

So I was wondering, since my hidden object scene isn't complex and there are only 10 items at max in the scene where the player is likely to only click on the objects once, is it possible to setup a persistent for the number of clicks made in a screen?

Or if not, is it possible to implement a code for Ren'Py to determine whether all image buttons in a screen have already been clicked on using persistent data?

So for example:

$ persistent.allobjectsclickedon = True

if persistent.allobjectsclickedon == True:
textbutton....."All Objects Found" etc.


Thanks!

-Little Missy Otome
Last edited by littlemissyotome888 on Tue Dec 07, 2021 11:01 am, edited 1 time in total.

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2402
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Can persistent data be used in Ren'Py to determine whether all image buttons have been clicked on in a screen?

#2 Post by Ocelot »

You can. But should you?

Persistent data is called that because it persists between multiple instances of the game. So if you change persistent value it remains changed for everyone. Loaded earlier save? Still changed. Started a new game? Still changed.

In short, only use persistent data for something that should be shared between all playthrough of the game.

For a simple task of determining if all objects on screen were clicked, normal variables are more than enough.
< < insert Rick Cook quote here > >

User avatar
littlemissyotome888
Regular
Posts: 83
Joined: Thu Jul 19, 2018 7:32 pm
Deviantart: LMO888
itch: littlemissyotome
Contact:

Re: Can persistent data be used in Ren'Py to determine whether all image buttons have been clicked on in a screen?

#3 Post by littlemissyotome888 »

Thank you for replying Ocelot!

I actually figured it out by setting variables instead like you mentioned so it's all good ^_^

If anyone else is struggling or wondering how I came across the information, I used 'thebullet's" beginner Hidden Object Tutorial as a guide. viewtopic.php?f=51&t=57712

I strongly advise trying out the "Puzzle Number 2" code. It seemed more straightforward to me :D

-Little Missy Otome

Post Reply

Who is online

Users browsing this forum: Dark79