Page 1 of 1

problem with persistent data (solved)

Posted: Tue Jul 27, 2021 2:13 pm
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 :?

Re: problem with persistent data

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

Code: Select all

default persistent.concept = False

Re: problem with persistent data

Posted: Wed Jul 28, 2021 3:55 am
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

Re: problem with persistent data

Posted: Wed Jul 28, 2021 3:58 am
by Kornyart
oh wow turns out it should have been...

Code: Select all

 $ persistent.concept = False 


im..so confused but it worked anyways

Re: problem with persistent data

Posted: Wed Jul 28, 2021 4:18 am
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 

Re: problem with persistent data

Posted: Sat Aug 07, 2021 1:25 pm
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!!