problem with persistent data (solved)

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
Kornyart
Newbie
Posts: 20
Joined: Mon Jan 25, 2021 1:18 pm
Completed: Mindworks: The Great Division
Projects: Mindworks: the great division
itch: Kornyart
Contact:

problem with persistent data (solved)

#1 Post by Kornyart »

so im creating a concept art screen that eventually unlocks at some point
this is the code i used for its button:

Code: Select all

 label _("Concept Sketches:")
            vbox: 
                yalign 0.5
                spacing 20
                imagebutton idle "Co (2).png" hover "Co (3).png" action [ ShowMenu("concepts"), SensitiveIf(persistent.concept) ] insensitive "Co (1).png"
############################
screen concepts():

    tag menu
    
    use game_menu(_("Extras"), scroll="viewport"):

        style_prefix "Extras"

        vbox:
 
            label _("{b}Concept Art{/b}")
            
            image ("C (1).png")
            image ("C (2).png")   #####i added these images as quick samples so dont mind them
the button appeared as planned, so this part is okay
in the beginning of my script file i added these:

Code: Select all

default concept = False
then i added this at some point of the game

Code: Select all

 $ persistent.concept = True 
makes sense right?
For some reason the persistent data statement is not unlocking my button at all. I used the exact same code for my other buttons and they worked perfectly but apparently my concept art button is completely cursed and its not working at all

I have no idea why its acting this way, i even checked my spelling and indentation several times but there were no problems with them :?
Last edited by Kornyart on Sat Aug 07, 2021 1:25 pm, edited 1 time in total.

User avatar
hell_oh_world
Miko-Class Veteran
Posts: 777
Joined: Fri Jul 12, 2019 5:21 am
Contact:

Re: problem with persistent data

#2 Post by hell_oh_world »

should be...

Code: Select all

default persistent.concept = False

User avatar
Kornyart
Newbie
Posts: 20
Joined: Mon Jan 25, 2021 1:18 pm
Completed: Mindworks: The Great Division
Projects: Mindworks: the great division
itch: Kornyart
Contact:

Re: problem with persistent data

#3 Post by Kornyart »

hell_oh_world wrote: Tue Jul 27, 2021 3:22 pm should be...

Code: Select all

default persistent.concept = False
that didnt really work, its still locked. its weird because ive been using the same code for all my buttons and they work perfectly except for this one

User avatar
Kornyart
Newbie
Posts: 20
Joined: Mon Jan 25, 2021 1:18 pm
Completed: Mindworks: The Great Division
Projects: Mindworks: the great division
itch: Kornyart
Contact:

Re: problem with persistent data

#4 Post by Kornyart »

oh wow turns out it should have been...

Code: Select all

 $ persistent.concept = False 


im..so confused but it worked anyways

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3785
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: problem with persistent data

#5 Post by Imperf3kt »

Your issue was that you forgot to add persistent. to the front of your variable when defining / creating it.

The variable you defined:
Kornyart wrote: Tue Jul 27, 2021 2:13 pm

Code: Select all

default concept = False
The variable you tried to adjust/use:
Kornyart wrote: Tue Jul 27, 2021 2:13 pm

Code: Select all

 $ persistent.concept = True 
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
Kornyart
Newbie
Posts: 20
Joined: Mon Jan 25, 2021 1:18 pm
Completed: Mindworks: The Great Division
Projects: Mindworks: the great division
itch: Kornyart
Contact:

Re: problem with persistent data

#6 Post by Kornyart »

Imperf3kt wrote: Wed Jul 28, 2021 4:18 am Your issue was that you forgot to add persistent. to the front of your variable when defining / creating it.

The variable you defined:
Kornyart wrote: Tue Jul 27, 2021 2:13 pm

Code: Select all

default concept = False
The variable you tried to adjust/use:
Kornyart wrote: Tue Jul 27, 2021 2:13 pm

Code: Select all

 $ persistent.concept = True 
yes that worked perfectly thanks!!

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot]