Conditional imagebutton [SOLVED]
Posted: Tue Jan 28, 2020 8:57 am
Hi team,
It's late and I'm probably just plain missing what's glaringly obvious to everyone else, but I'm trying to make a conditional imagebutton work and it's throwing a hissyfit.
imagebutton auto "phonewatch_%s.png" action If("time <= 3", AddToSet(time, 1), Jump("sallybed")) align (0.01,0.04)
I have a variable for time ("default time = 0" in the pre-start definitions) which, if clicked, the imagebutton should add one to. Once the time variable raises to 4 and the imagebutton is clicked again, it should jump to the 'sallybed' label in the script.
When trying to run it like that, I get:
I'm sorry, but an uncaught exception occurred.
While running game code:
File "game/loc-stbedroom.rpy", line 253, in script
scene bg stbathroom with dissolve
File "renpy/common/00action_data.rpy", line 411, in get_sensitive
return self.value not in self.set
TypeError: argument of type 'int' is not iterable
Is it the "time <= 3" section or the AddToSet bit that I'm getting wrong? I thought AddTOSet was right for simply advancing a numerical counter but could be way off there...
Thanks!
It's late and I'm probably just plain missing what's glaringly obvious to everyone else, but I'm trying to make a conditional imagebutton work and it's throwing a hissyfit.
imagebutton auto "phonewatch_%s.png" action If("time <= 3", AddToSet(time, 1), Jump("sallybed")) align (0.01,0.04)
I have a variable for time ("default time = 0" in the pre-start definitions) which, if clicked, the imagebutton should add one to. Once the time variable raises to 4 and the imagebutton is clicked again, it should jump to the 'sallybed' label in the script.
When trying to run it like that, I get:
I'm sorry, but an uncaught exception occurred.
While running game code:
File "game/loc-stbedroom.rpy", line 253, in script
scene bg stbathroom with dissolve
File "renpy/common/00action_data.rpy", line 411, in get_sensitive
return self.value not in self.set
TypeError: argument of type 'int' is not iterable
Is it the "time <= 3" section or the AddToSet bit that I'm getting wrong? I thought AddTOSet was right for simply advancing a numerical counter but could be way off there...
Thanks!