Ren'Py imagebutton that doesn't stop advancing the dialogue?

recreation

pure evil!
Respected User
Game Developer
Jun 10, 2018
6,250
22,138
I have an imagebutton to swap scenes (clicked jump), but I want to show dialogue while this button is shown. Any ideas?
 

recreation

pure evil!
Respected User
Game Developer
Jun 10, 2018
6,250
22,138
Similiar question, so I put it here again:
I want to swap background images on the fly within a dialogue on button click, but without restarting the conversation every time.
Seems simple with ConditionSwitch() and:
Python:
screen k_bj_view:
    if pov == True:
        textbutton _("change view") action SetVariable("pov", "False")
    else:
        textbutton _("change view") action SetVariable("pov", "True")
but as soon as both has been clicked once, the button is without function.
Am I doing something wrong here?
 

the66

beware, the germans are cumming
Modder
Respected User
Donor
Jan 27, 2017
7,581
23,470
SetVariable expects the variable name as string. correct. but the value has to be the value, not a string of the value.
if pov is either True or False, i would just use:
Python:
screen k_bj_view:
    textbutton _("change view") action ToggleVariable("pov")
 
  • Like
Reactions: recreation

recreation

pure evil!
Respected User
Game Developer
Jun 10, 2018
6,250
22,138
Hmm, I tried it but the only thing that "toggles" is the button, it's either active or inactive, but the image won't change.

Python:
define pov = True
screen k_bj_view:
    textbutton _("change view") action ToggleVariable("pov") yalign .01 xalign .99
image k_bj = ConditionSwitch(
    "pov == 'False'", Movie(play="anim/k_bj2.webm"),
    "True", Movie(play="anim/k_bj.webm"))

label bla:
    show screen k_bj_view
    "some dialogue"
 

the66

beware, the germans are cumming
Modder
Respected User
Donor
Jan 27, 2017
7,581
23,470
Hmm, I tried it but the only thing that "toggles" is the button, it's either active or inactive, but the image won't change.

Python:
define pov = True

screen k_bj_view:
    textbutton _("change view") action ToggleVariable("pov") yalign .01 xalign .99

image k_bj = ConditionSwitch(
    "pov == 'False'", Movie(play="anim/k_bj2.webm"),
    "True", Movie(play="anim/k_bj.webm"))

label bla:
    show screen k_bj_view
    "some dialogue"
try
Python:
define pov = True
screen k_bj_view:
    textbutton _("change view") action ToggleVariable("pov") yalign .01 xalign .99
image k_bj = ConditionSwitch(
    "pov is False", Movie(play="anim/k_bj2.webm"),
    "True", Movie(play="anim/k_bj.webm"))

label bla:
    show screen k_bj_view
    show k_bj # you actually have to show your image!
    "some dialogue"
 
  • Like
Reactions: recreation

recreation

pure evil!
Respected User
Game Developer
Jun 10, 2018
6,250
22,138
show k_bj # you actually have to show your image!
Yes, I forgot to include that part here in the post, but it's in the code^^
"pov is False", Movie(play="anim/k_bj2.webm"),
"pov == 'False'", Movie(play="anim/k_bj2.webm"),
Ah, the ' ' was the problem.
I didn't realize it at first, but it's obviously the same reason why it didn't work in SetVariable, it's can't be a string.
Thanks again :)
 
  • Like
Reactions: the66