- Sep 6, 2021
- 740
- 1,678
I'm wearing out my keyboard looking for an answer here, but what i need is a way to change an imagebutton call, so that I can cycle through 2 or 3 animation loops.
So far, I've managed to create some simple 3 or 4 render animation loops and I've also created a camera angle imagebutton that works, so when you click it, it jumps to the second image loop. Where I am hitting a wall is trying to figure out how to make the imagebutton toggle so that i can click it to cycle through each loop. IE: Watching loop 1, button takes you to loop 2, click it again and it takes you to loop 3, then the next click cycles back to loop 1. That sort of thing.
Is there a way to use a function in the screen action part of the imagebutton, using a variable (say "cam_switch") so that when you are in Loop 1, "cam_switch" is set to 2, and when you jump to Loop 2, the variable "cam_switch" is changed to 3? Then be able to use that variable in the Action Jump part of the image button?
Here's how the loops look...
And here's the cam_angle screen
The above works fine for just jumping from loop one to loop two but when I I've tried imputing the variable directly into the Jump statement, it doesn't want to work. Says it can't find the label
I suspect I that (1) I don't know the proper syntax for using functions this way or (2) Renpy doesn't allow it used for Screen Actions. I've seen this type of image button used in other games, but I don't have any examples, atm.
Any suggestions?
So far, I've managed to create some simple 3 or 4 render animation loops and I've also created a camera angle imagebutton that works, so when you click it, it jumps to the second image loop. Where I am hitting a wall is trying to figure out how to make the imagebutton toggle so that i can click it to cycle through each loop. IE: Watching loop 1, button takes you to loop 2, click it again and it takes you to loop 3, then the next click cycles back to loop 1. That sort of thing.
Is there a way to use a function in the screen action part of the imagebutton, using a variable (say "cam_switch") so that when you are in Loop 1, "cam_switch" is set to 2, and when you jump to Loop 2, the variable "cam_switch" is changed to 3? Then be able to use that variable in the Action Jump part of the image button?
Here's how the loops look...
Python:
label sex_2_cam_1:
$ cam_switch = 2
show loop:
alpha 0.
"a0_s02_r075"
linear 1. alpha 1.
block:
"a0_s02_r075"
.5
"a0_s02_r076"
.5
"a0_s02_r077"
.5
"a0_s02_r078"
.5
"a0_s02_r077"
.5
"a0_s02_r076"
repeat
call screen cam_angle
And here's the cam_angle screen
Python:
screen cam_angle():
imagebutton:
yalign 0.05
xalign 0.95
auto ("gui/camera_%s.png")
action Jump("sex_2_cam_2")
action Jump("sex_2_cam_[cam_switch]")
I suspect I that (1) I don't know the proper syntax for using functions this way or (2) Renpy doesn't allow it used for Screen Actions. I've seen this type of image button used in other games, but I don't have any examples, atm.
Any suggestions?
Last edited: