Ren'Py Problem with text appearance in Ren'Py screens.

UncommonRole

Newbie
Jan 4, 2021
49
23
132
Hello, I'm creating a detective game in Ren'Py and I've created screens that contain clues. The issue is that when the player unlocks them with a function like "$ clue1 += 1", the screen defined as "if clue1 == 1:..." takes several iterations to appear.

In fact, I've noticed that if you open and close the screen twice after incrementing the variable, it works, but not the first time. It's as if you need to enter for it to update the second time.

I have tried the function "renpy.restart_interaction()" , but it doesn't do anything.

Any ideas on how to solve this so that when the variable is incremented, it immediately appears updated on the screen?

Thanks everyone!
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
12,934
21,513
1,026
Any ideas on how to solve this so that when the variable is incremented, it immediately appears updated on the screen?
Difficult to help you without knowing the code you wrote, because what you describe isn't how Ren'Py usually respond to a variable update. In regular use, it immediately react to any variable change...

You don't have permission to view the spoiler content. Log in or register now.
 

UncommonRole

Newbie
Jan 4, 2021
49
23
132
Difficult to help you without knowing the code you wrote, because what you describe isn't how Ren'Py usually respond to a variable update. In regular use, it immediately react to any variable change...

You don't have permission to view the spoiler content. Log in or register now.
Hi, thanks for replying. Here's how I've written one of the clue screens. As I mentioned, they eventually appear and work, but I've noticed that when I set the variable in the code, it doesn't appear immediately.

Code:
screen notes():
    modal True
    add "black"
    vbox:
        xalign 0.5
        yalign 0.5
        if preguntas_caso1_1 ==2:
            text "-Cynthya is rich and famous, but she gave me the address of a rundown alley. Something doesn't add up."
 

peterppp

Well-Known Member
Donor
Mar 5, 2020
1,263
2,406
386
Hi, thanks for replying. Here's how I've written one of the clue screens. As I mentioned, they eventually appear and work, but I've noticed that when I set the variable in the code, it doesn't appear immediately.

Code:
screen notes():
    modal True
    add "black"
    vbox:
        xalign 0.5
        yalign 0.5
        if preguntas_caso1_1 ==2:
            text "-Cynthya is rich and famous, but she gave me the address of a rundown alley. Something doesn't add up."
you don't show all the relevant code, like how you update the variable. if you update it from 0 to 1 then to 2 it will take two updates to get to 2. so depending on how you update the variable...

are you trying to update the variable by clicking on something outside the screen? because modal True would prevent that
 
Last edited:

UncommonRole

Newbie
Jan 4, 2021
49
23
132
you don't show all the relevant code, like how you update the variable. if you update it from 0 to 1 then to 2 it will take two updates to get to 2. so depending on how you update the variable...

are you trying to update the variable by clicking on something outside the screen? because modal True would prevent that
It always adds +1 with this code "$ clue01 +=1", but there's no textbutton or anything like that, it happens internally after the player chooses a path or succeeds in a dice roll.

And that's the problem: once the clue is activated, you open the screen from the game and it doesn't appear. But if you close it and reopen it without advancing, then it appears. In fact, I've noticed that when I do a rollback for testing and resetting the variables, the same thing happens with disappearing: the first time it still appears, but when I open it a second time, it no longer appears. It's very strange...
 

peterppp

Well-Known Member
Donor
Mar 5, 2020
1,263
2,406
386
It always adds +1 with this code "$ clue01 +=1", but there's no textbutton or anything like that, it happens internally after the player chooses a path or succeeds in a dice roll.

And that's the problem: once the clue is activated, you open the screen from the game and it doesn't appear. But if you close it and reopen it without advancing, then it appears. In fact, I've noticed that when I do a rollback for testing and resetting the variables, the same thing happens with disappearing: the first time it still appears, but when I open it a second time, it no longer appears. It's very strange...
again, you don't show the code where all this happens. one line of += 1 doesn't help us tell what the problem is.
post all the code
 

UncommonRole

Newbie
Jan 4, 2021
49
23
132
again, you don't show the code where all this happens. one line of += 1 doesn't help us tell what the problem is.
post all the code
This is a moment where the player receives 3 clues, but when it comes up in the game, it doesn't update automatically. Instead, you need to open the screen twice for everything to show up updated.

Code:
        cynthya "I'll send you a full report with all the relevant information. You can review it when you have time."
        p "Alright..."
        play sound "search.mp3"
        $ objeto_robado_disco +=2
        $ cynthya_velocidad +=1
        $ cynthya_importar +=1
        fn "Receiving information..."
        fn "and... done!"
        p "I hope it's useful and... truthful information."
        cynthya "Yes, you have it now, start doing your detective work."
        "New clues added."
And this is one of the various screens that display the clues.

Code:
screen notes():
    modal True
    add "black"
    vbox:
        xalign 0.5
        yalign 0.5
        if preguntas_caso1_1 ==2:
            text "-Cynthya is rich and famous, but she gave me the address of a rundown alley. Something doesn't add up."
        text "-Cynthya's address is: Niemira Street, number 12"
        text "-I need to find out if this is an insurance scam or if she was truly robbed."
        if cynthya_ordenadores ==1:
            text "-Cynthya seems to have a lot of old but functional equipment running at full capacity. What could she be using it for?"
        if cynthya_comida ==1:
            text "-Cynthya is dirty and disorganized, something not typical of someone famous like her."
            text "-There are takeout food scraps scattered all over the place."
        if cynthya_tecnico ==1:
            text "-There is installer equipment. Possible suspect? What was being installed?"
        if cynthya_cama ==1:
            text "-There's a bed in the room, suggesting that she might live here."
        if cynthya_cama ==2:
            text "-Cynthya says she lives in this apartment to escape prying eyes and find peace."
        if cynthya_aspecto ==1:
            text "-In the photos and videos, Cynthya doesn't have any tattoos and dresses very well."
            text "-Now, however, she looks dirty, disheveled, lacking style, and covered in tattoos."
        if cynthya_importar == 1:
            text "-What was stolen from Cynthya holds more value due to being something personal, perhaps sentimental, beyond its material worth."
 

peterppp

Well-Known Member
Donor
Mar 5, 2020
1,263
2,406
386
This is a moment where the player receives 3 clues, but when it comes up in the game, it doesn't update automatically. Instead, you need to open the screen twice for everything to show up updated.

Code:
        cynthya "I'll send you a full report with all the relevant information. You can review it when you have time."
        p "Alright..."
        play sound "search.mp3"
        $ objeto_robado_disco +=2
        $ cynthya_velocidad +=1
        $ cynthya_importar +=1
        fn "Receiving information..."
        fn "and... done!"
        p "I hope it's useful and... truthful information."
        cynthya "Yes, you have it now, start doing your detective work."
        "New clues added."
And this is one of the various screens that display the clues.

Code:
screen notes():
    modal True
    add "black"
    vbox:
        xalign 0.5
        yalign 0.5
        if preguntas_caso1_1 ==2:
            text "-Cynthya is rich and famous, but she gave me the address of a rundown alley. Something doesn't add up."
        text "-Cynthya's address is: Niemira Street, number 12"
        text "-I need to find out if this is an insurance scam or if she was truly robbed."
        if cynthya_ordenadores ==1:
            text "-Cynthya seems to have a lot of old but functional equipment running at full capacity. What could she be using it for?"
        if cynthya_comida ==1:
            text "-Cynthya is dirty and disorganized, something not typical of someone famous like her."
            text "-There are takeout food scraps scattered all over the place."
        if cynthya_tecnico ==1:
            text "-There is installer equipment. Possible suspect? What was being installed?"
        if cynthya_cama ==1:
            text "-There's a bed in the room, suggesting that she might live here."
        if cynthya_cama ==2:
            text "-Cynthya says she lives in this apartment to escape prying eyes and find peace."
        if cynthya_aspecto ==1:
            text "-In the photos and videos, Cynthya doesn't have any tattoos and dresses very well."
            text "-Now, however, she looks dirty, disheveled, lacking style, and covered in tattoos."
        if cynthya_importar == 1:
            text "-What was stolen from Cynthya holds more value due to being something personal, perhaps sentimental, beyond its material worth."
sorry, not helping me dude. that's basically the same thing you've already shown. i can't see where you call the screen or anything else. somewhere there is a problem but if you dont show how everything connects, it's hard to help

if you dont know what to show, you might be better off attaching all the relevant files here and hope someone will look at them
 
  • Like
Reactions: anne O'nymous

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
12,934
21,513
1,026
Code:
[...]
Ok, I took your code, just commenting the line playing the sound, and adding one to show the screen right after the variable changes (plus the textbutton to close the screen), leading to this:
Python:
define cynthya = Character( "cynthya" )
define p = Character( "player" )
define fn = Character( "fn" )
default objeto_robado_disco = 0
default cynthya_velocidad = 0
default cynthya_importar = 0
default preguntas_caso1_1 = 0
default cynthya_ordenadores = 0
default cynthya_comida = 0
default cynthya_tecnico = 0
default cynthya_cama = 0
default cynthya_aspecto = 0

screen notes():

    modal True
    add "black"

    vbox:
        xalign 0.5
        yalign 0.5
        if preguntas_caso1_1 ==2:
            text "-Cynthya is rich and famous, but she gave me the address of a rundown alley. Something doesn't add up."
        text "-Cynthya's address is: Niemira Street, number 12"
        text "-I need to find out if this is an insurance scam or if she was truly robbed."
        if cynthya_ordenadores ==1:
            text "-Cynthya seems to have a lot of old but functional equipment running at full capacity. What could she be using it for?"
        if cynthya_comida ==1:
            text "-Cynthya is dirty and disorganized, something not typical of someone famous like her."
            text "-There are takeout food scraps scattered all over the place."
        if cynthya_tecnico ==1:
            text "-There is installer equipment. Possible suspect? What was being installed?"
        if cynthya_cama ==1:
            text "-There's a bed in the room, suggesting that she might live here."
        if cynthya_cama ==2:
            text "-Cynthya says she lives in this apartment to escape prying eyes and find peace."
        if cynthya_aspecto ==1:
            text "-In the photos and videos, Cynthya doesn't have any tattoos and dresses very well."
            text "-Now, however, she looks dirty, disheveled, lacking style, and covered in tattoos."
        if cynthya_importar == 1:
            text "-What was stolen from Cynthya holds more value due to being something personal, perhaps sentimental, beyond its material worth."

    textbutton "close" action Return()


label start:

    cynthya "I'll send you a full report with all the relevant information. You can review it when you have time."
    p "Alright..."
    #play sound "search.mp3"
    $ objeto_robado_disco +=2
    $ cynthya_velocidad +=1
    $ cynthya_importar +=1
    show screen notes
    fn "Receiving information..."
    fn "and... done!"
    p "I hope it's useful and... truthful information."
    cynthya "Yes, you have it now, start doing your detective work."
    "New clues added."
And, as expected, the screen correctly display the hint line corresponding to "cynthya_importar", right from the opening.
I usually use Ren'Py 7.5.3 for my tests, but for this one I also tried with the more recent versions 8.3.0 and 7.7.1, that also works as expected, immediately handling the change in the variable.

So there's something else that you haven't shown, that is responsible for this delay, but I don't really see what it can be.
My initial guess goes for a context issue, but I don't really see how it could interfere here, unless it's the label itself that is ran into a lower context.


By the way, you describe it as "a moment where the player receives 3 clues" but, while there's 3 variables updated in the label, there's only one that correspond to a clue in the screen you shown. But I take this as an irrelevant detail, assuming that the two other clues are among a part of the screen that you haven't copied in your post.
 
  • Like
Reactions: UncommonRole

UncommonRole

Newbie
Jan 4, 2021
49
23
132
sorry, not helping me dude. that's basically the same thing you've already shown. i can't see where you call the screen or anything else. somewhere there is a problem but if you dont show how everything connects, it's hard to help

if you dont know what to show, you might be better off attaching all the relevant files here and hope someone will look at them
At the beginning of the game, I call the UI screen and it remains visible for the rest of the game. I'll also share the code for that screen. I don't know if this will help you see the issue better.

Code:
show screen UI
    "From now on, you will always have the menu button in the top left corner, which allows you to view your stats and review the definitions of everything. In addition to being able to follow the clues of your investigations."

Code:
screen UI():
    frame:
        textbutton "{u}{size=+1}Menu{/size}{/u}":
            xpos 0 ypos 0
            action Show( "Menu" )
screen Menu():
    frame:
        xpadding 20
        ypadding 1
        xalign 0.5
        yalign 0.3
        vbox:
            textbutton "{size=+5}Clues{/size}" action Show("clues"), Hide("Menu") 
            textbutton "{size=+5}Stats{/size}" action Show("Stats")
            textbutton "{size=+5}Attributes description{/size}" action Show("attributes_description")
            textbutton "{size=+5}Skills description{/size}" action Show("skills_description")
            textbutton "{size=+5}Implants description{/size}" action Show("implants_description"), Hide("Menu")
            textbutton "{size=+5}Cheats{/size}" action Show("cheats"), Hide("Menu")

    frame:
        xalign 0.5 yalign 0.6
        hbox:
            textbutton "{u}{size=+6}Close{/size}{/u}" action Hide("Menu")
By the way, you describe it as "a moment where the player receives 3 clues" but, while there's 3 variables updated in the label, there's only one that correspond to a clue in the screen you shown. But I take this as an irrelevant detail, assuming that the two other clues are among a part of the screen that you haven't copied in your post.
Yes, the clues are spread across several screens even though they are received at the same time. As I said, it works because they eventually appear, but not immediately. It's a minor issue, really, but I'd like it to work properly, and if you say it works for you... well, I don't know what else to look for. I've already shared everything related to the code here :unsure:

Anyway, thank you very much for responding.
 

peterppp

Well-Known Member
Donor
Mar 5, 2020
1,263
2,406
386
At the beginning of the game, I call the UI screen and it remains visible for the rest of the game. I'll also share the code for that screen. I don't know if this will help you see the issue better.

Code:
show screen UI
    "From now on, you will always have the menu button in the top left corner, which allows you to view your stats and review the definitions of everything. In addition to being able to follow the clues of your investigations."

Code:
screen UI():
    frame:
        textbutton "{u}{size=+1}Menu{/size}{/u}":
            xpos 0 ypos 0
            action Show( "Menu" )
screen Menu():
    frame:
        xpadding 20
        ypadding 1
        xalign 0.5
        yalign 0.3
        vbox:
            textbutton "{size=+5}Clues{/size}" action Show("clues"), Hide("Menu")
            textbutton "{size=+5}Stats{/size}" action Show("Stats")
            textbutton "{size=+5}Attributes description{/size}" action Show("attributes_description")
            textbutton "{size=+5}Skills description{/size}" action Show("skills_description")
            textbutton "{size=+5}Implants description{/size}" action Show("implants_description"), Hide("Menu")
            textbutton "{size=+5}Cheats{/size}" action Show("cheats"), Hide("Menu")

    frame:
        xalign 0.5 yalign 0.6
        hbox:
            textbutton "{u}{size=+6}Close{/size}{/u}" action Hide("Menu")


Yes, the clues are spread across several screens even though they are received at the same time. As I said, it works because they eventually appear, but not immediately. It's a minor issue, really, but I'd like it to work properly, and if you say it works for you... well, I don't know what else to look for. I've already shared everything related to the code here :unsure:

Anyway, thank you very much for responding.
where do you call the notes screen? did you rename it to clues? if that's the case, this is the code i ended up with:
Python:
define cynthya = Character( "cynthya" )
define p = Character( "player" )
define fn = Character( "fn" )
default objeto_robado_disco = 0
default cynthya_velocidad = 0
default cynthya_importar = 0
default preguntas_caso1_1 = 0
default cynthya_ordenadores = 0
default cynthya_comida = 0
default cynthya_tecnico = 0
default cynthya_cama = 0
default cynthya_aspecto = 0

screen clues():
    modal True
    add "black"
    vbox:
        xalign 0.5
        yalign 0.5
        if preguntas_caso1_1 ==2:
            text "-Cynthya is rich and famous, but she gave me the address of a rundown alley. Something doesn't add up."
        text "-Cynthya's address is: Niemira Street, number 12"
        text "-I need to find out if this is an insurance scam or if she was truly robbed."
        if cynthya_ordenadores ==1:
            text "-Cynthya seems to have a lot of old but functional equipment running at full capacity. What could she be using it for?"
        if cynthya_comida ==1:
            text "-Cynthya is dirty and disorganized, something not typical of someone famous like her."
            text "-There are takeout food scraps scattered all over the place."
        if cynthya_tecnico ==1:
            text "-There is installer equipment. Possible suspect? What was being installed?"
        if cynthya_cama ==1:
            text "-There's a bed in the room, suggesting that she might live here."
        if cynthya_cama ==2:
            text "-Cynthya says she lives in this apartment to escape prying eyes and find peace."
        if cynthya_aspecto ==1:
            text "-In the photos and videos, Cynthya doesn't have any tattoos and dresses very well."
            text "-Now, however, she looks dirty, disheveled, lacking style, and covered in tattoos."
        if cynthya_importar == 1:
            text "-What was stolen from Cynthya holds more value due to being something personal, perhaps sentimental, beyond its material worth."
    frame:
        xalign 0.5 yalign 0.6
        hbox:
            textbutton "{u}{size=+6}Close{/size}{/u}" action Hide("clues")

screen UI():
    frame:
        textbutton "{u}{size=+1}Menu{/size}{/u}":
            xpos 0 ypos 0
            action Show( "Menu" )
screen Menu():
    frame:
        xpadding 20
        ypadding 1
        xalign 0.5
        yalign 0.3
        vbox:
            textbutton "{size=+5}Clues{/size}" action Show("clues"), Hide("Menu")
            textbutton "{size=+5}Stats{/size}" action Show("Stats")
            textbutton "{size=+5}Attributes description{/size}" action Show("attributes_description")
            textbutton "{size=+5}Skills description{/size}" action Show("skills_description")
            textbutton "{size=+5}Implants description{/size}" action Show("implants_description"), Hide("Menu")
            textbutton "{size=+5}Cheats{/size}" action Show("cheats"), Hide("Menu")

    frame:
        xalign 0.5 yalign 0.6
        hbox:
            textbutton "{u}{size=+6}Close{/size}{/u}" action Hide("Menu")

label start:
    show screen UI
    "From now on, you will always have the menu button in the top left corner, which allows you to view your stats and review the definitions of everything. In addition to being able to follow the clues of your investigations."

    cynthya "I'll send you a full report with all the relevant information. You can review it when you have time."
    p "Alright..."
    #play sound "search.mp3"
    $ objeto_robado_disco +=2
    $ cynthya_velocidad +=1
    $ cynthya_importar +=1
    fn "Receiving information..."
    fn "and... done!"
    p "I hope it's useful and... truthful information."
    cynthya "Yes, you have it now, start doing your detective work."
    "New clues added."
everything seems to work ok. opening the clues screen, i first see no clues. then after "receiving information" i see the clue for cynthya_importar == 1
clue.png
is this where it doesn't work for you?
 
  • Like
Reactions: UncommonRole

UncommonRole

Newbie
Jan 4, 2021
49
23
132
where do you call the notes screen?
The "Notes" screen is inside the "Clues" screen, as shown below. It does work, but it is not instantaneous. I need to open the screen twice for the new clue to appear each time there is a change. Even when I do a rollback and it should disappear, it still appears until I open it a second time.

Code:
screen clues():
    frame:
        xalign 0.5
        yalign 0.3
        vbox:
            if case1 == True:
                textbutton "{size=+2}Cynthya Vals Profile{/size}" action Show("cynthya_vals_profile"), Hide("clues")
                if info_cynthya == True:
                    textbutton "{size=+2}Article about Cynthya's arrest{/size}" action Show("cynthya_vals_arrested"), Hide("clues")
                textbutton "{size=+2}The day of the robbery{/size}" action Show("cynthya_day_robbery"), Hide("clues")
                textbutton "{size=+2}Notes{/size}" action Show("notes"), Hide("clues")
           
            else:
                text "{size=+20}No leads yet{/size}"
    frame:
        xalign 0.5 yalign 0.75
        hbox:
            textbutton "{u}{size=+6}Close{/size}{/u}" action Hide("clues")
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
12,934
21,513
1,026
It's a minor issue, really,
There's no such things as "minor issues", only symptoms of bugs or design flaws.


[...] and if you say it works for you... well, I don't know what else to look for.
It's not just that it works for me, the code you shown should normally works for everyone, including you.

I've past long minutes looking at your code, and I really fail to see anything that could possibly lead to the behavior you experience. Yet, there's something, somewhere, that make your code behave that way, and as I implied above, it's more important than you think.

As it currently (not) works for you, the change in the variables isn't immediately propagated to the screen... There's high chance that it don't just impact screens, what mean that save files can possibly have a wrong value, depending when they are made. And starting there, nothing guaranty that the value will be corrected like they are with the screen, after opening them twice.

Now, as I said, I have no clue regarding what the cause can be. So, the first thing you should do is to start a new project, and use it to test the code gave by peterppp or mine. If it still don't works, then it's Ren'Py the cause, pass to a more recent version (or the previous one if you use the last one), it should solve the issue.
But if it works, it mean that something else in your code is causing that delay, and you should really find what it can be.
 

peterppp

Well-Known Member
Donor
Mar 5, 2020
1,263
2,406
386
The "Notes" screen is inside the "Clues" screen, as shown below. It does work, but it is not instantaneous. I need to open the screen twice for the new clue to appear each time there is a change. Even when I do a rollback and it should disappear, it still appears until I open it a second time.

Code:
screen clues():
    frame:
        xalign 0.5
        yalign 0.3
        vbox:
            if case1 == True:
                textbutton "{size=+2}Cynthya Vals Profile{/size}" action Show("cynthya_vals_profile"), Hide("clues")
                if info_cynthya == True:
                    textbutton "{size=+2}Article about Cynthya's arrest{/size}" action Show("cynthya_vals_arrested"), Hide("clues")
                textbutton "{size=+2}The day of the robbery{/size}" action Show("cynthya_day_robbery"), Hide("clues")
                textbutton "{size=+2}Notes{/size}" action Show("notes"), Hide("clues")
          
            else:
                text "{size=+20}No leads yet{/size}"
    frame:
        xalign 0.5 yalign 0.75
        hbox:
            textbutton "{u}{size=+6}Close{/size}{/u}" action Hide("clues")
ok, new code with everything you've shown, with clues updating at once as it should
Python:
define cynthya = Character( "cynthya" )
define p = Character( "player" )
define fn = Character( "fn" )
default objeto_robado_disco = 0
default cynthya_velocidad = 0
default cynthya_importar = 0
default preguntas_caso1_1 = 0
default cynthya_ordenadores = 0
default cynthya_comida = 0
default cynthya_tecnico = 0
default cynthya_cama = 0
default cynthya_aspecto = 0
default case1 = False
default info_cynthya = False

screen notes():
    modal True
    add "black"
    vbox:
        xalign 0.5
        yalign 0.5
        if preguntas_caso1_1 ==2:
            text "-Cynthya is rich and famous, but she gave me the address of a rundown alley. Something doesn't add up."
        text "-Cynthya's address is: Niemira Street, number 12"
        text "-I need to find out if this is an insurance scam or if she was truly robbed."
        if cynthya_ordenadores ==1:
            text "-Cynthya seems to have a lot of old but functional equipment running at full capacity. What could she be using it for?"
        if cynthya_comida ==1:
            text "-Cynthya is dirty and disorganized, something not typical of someone famous like her."
            text "-There are takeout food scraps scattered all over the place."
        if cynthya_tecnico ==1:
            text "-There is installer equipment. Possible suspect? What was being installed?"
        if cynthya_cama ==1:
            text "-There's a bed in the room, suggesting that she might live here."
        if cynthya_cama ==2:
            text "-Cynthya says she lives in this apartment to escape prying eyes and find peace."
        if cynthya_aspecto ==1:
            text "-In the photos and videos, Cynthya doesn't have any tattoos and dresses very well."
            text "-Now, however, she looks dirty, disheveled, lacking style, and covered in tattoos."
        if cynthya_importar == 1:
            text "-What was stolen from Cynthya holds more value due to being something personal, perhaps sentimental, beyond its material worth."
    frame:
        xalign 0.5 yalign 0.6
        hbox:
            textbutton "{u}{size=+6}Close{/size}{/u}" action Hide("notes")
    

screen clues():
    frame:
        xalign 0.5
        yalign 0.3
        vbox:
            if case1 == True:
                textbutton "{size=+2}Cynthya Vals Profile{/size}" action Show("cynthya_vals_profile"), Hide("clues")
                if info_cynthya == True:
                    textbutton "{size=+2}Article about Cynthya's arrest{/size}" action Show("cynthya_vals_arrested"), Hide("clues")
                textbutton "{size=+2}The day of the robbery{/size}" action Show("cynthya_day_robbery"), Hide("clues")
                textbutton "{size=+2}Notes{/size}" action Show("notes"), Hide("clues")
          
            else:
                text "{size=+20}No leads yet{/size}"
    frame:
        xalign 0.5 yalign 0.75
        hbox:
            textbutton "{u}{size=+6}Close{/size}{/u}" action Hide("clues")

screen UI():
    frame:
        textbutton "{u}{size=+1}Menu{/size}{/u}":
            xpos 0 ypos 0
            action Show( "Menu" )
screen Menu():
    frame:
        xpadding 20
        ypadding 1
        xalign 0.5
        yalign 0.3
        vbox:
            textbutton "{size=+5}Clues{/size}" action Show("clues"), Hide("Menu")
            textbutton "{size=+5}Stats{/size}" action Show("Stats")
            textbutton "{size=+5}Attributes description{/size}" action Show("attributes_description")
            textbutton "{size=+5}Skills description{/size}" action Show("skills_description")
            textbutton "{size=+5}Implants description{/size}" action Show("implants_description"), Hide("Menu")
            textbutton "{size=+5}Cheats{/size}" action Show("cheats"), Hide("Menu")

    frame:
        xalign 0.5 yalign 0.6
        hbox:
            textbutton "{u}{size=+6}Close{/size}{/u}" action Hide("Menu")

label start:
    show screen UI
    "From now on, you will always have the menu button in the top left corner, which allows you to view your stats and review the definitions of everything. In addition to being able to follow the clues of your investigations."
    $ case1 = True
    cynthya "I'll send you a full report with all the relevant information. You can review it when you have time."
    p "Alright..."
    #play sound "search.mp3"
    $ objeto_robado_disco +=2
    $ cynthya_velocidad +=1
    $ cynthya_importar +=1
    fn "Receiving information..."
    fn "and... done!"
    p "I hope it's useful and... truthful information."
    cynthya "Yes, you have it now, start doing your detective work."
    "New clues added."
you should do what anne suggested and copy this code into a new project and see if it works.
anne is the expert. my experience with renpy is limited and i can only help finding the bug from code you show or supply, i can't guess. it might be time to supply ALL the code if you want help instead of showing one piece after another hoping the bug is there
 
  • Like
Reactions: UncommonRole

UncommonRole

Newbie
Jan 4, 2021
49
23
132
Alright, I'll try it out tomorrow to see if it works in a new project. I hadn't thought of ruling out an issue with Ren'py itself. I'll let you know how it goes. Thanks a lot for the help :whistle:
 

UncommonRole

Newbie
Jan 4, 2021
49
23
132
peterppp anne O'nymous

I've already solved the problem. I used the code you gave me, and it worked perfectly, so it was an issue with my code. After trying several things, I noticed a difference between your code and mine: instead of using "default" to define the variable, I was using "define". I changed it to "default", like yours, and now it updates immediately, as it should.

Obviously, this must be a beginner's mistake. What is the difference between using both functions? By default, I learned to use "define" whenever I create a new variable. Should I change all my variables to "default" to avoid issues in the future?

In any case, thank you very much, it works perfectly now :giggle:
 
  • Yay, update!
Reactions: peterppp

peterppp

Well-Known Member
Donor
Mar 5, 2020
1,263
2,406
386
peterppp anne O'nymous

I've already solved the problem. I used the code you gave me, and it worked perfectly, so it was an issue with my code. After trying several things, I noticed a difference between your code and mine: instead of using "default" to define the variable, I was using "define". I changed it to "default", like yours, and now it updates immediately, as it should.

Obviously, this must be a beginner's mistake. What is the difference between using both functions? By default, I learned to use "define" whenever I create a new variable. Should I change all my variables to "default" to avoid issues in the future?

In any case, thank you very much, it works perfectly now :giggle:
that is a beginner's mistake indeed. so much so that more experienced users often forget that this mistake can be made, and so when it happens, it's often a head scratcher until someone finds or thinks of the error ;)

define is basically a constant. use it for things that will not change.

default is for variables... values that can vary
 
  • Like
Reactions: UncommonRole

UncommonRole

Newbie
Jan 4, 2021
49
23
132
that is a beginner's mistake indeed. so much so that more experienced users often forget that this mistake can be made, and so when it happens, it's often a head scratcher until someone finds or thinks of the error ;)

define is basically a constant. use it for things that will not change.

default is for variables... values that can vary
Oh my... I have about 170 variables in the game that should be "default" instead of "define"... lucky that I realized in time. I'll take note of this; in the end, I've learned something important.

Many, many thanks! o_O
 
  • Like
Reactions: peterppp

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
12,934
21,513
1,026
  • Like
Reactions: UncommonRole