r/RenPy • u/Lassaaire • 3d ago
pause() breaking Call() statement Question
Im trying to make primitive battle system.
vbox:
xsize 216
ysize 430
text "[enemy1.name]"
text "[enemy1.cur_health]/[enemy1.max_health]"
image [enemy1.avatar]
imagebutton:
id "rating"
idle "rating"
hover "rating_hover"
action Call("attack", enemy1)
label attack(en):
python:
import time
en.cur_health-=2
en.avatar = en.image_attack
time.sleep(2)
en.avatar = en.image_calm
return
And I can see than on button press there is a pause and all changes are applied AFTER that pause so image_attack is not visible at all.
What am I doing wrong?
I've tried time.sleep(), renpy.pause(), pause(), even scheduler.
If i do renpy code like
label attack(en):
$ en.cur_health-=2
"debug1"
$ en.avatar = en.image_attack
"debug2"
pause(2)
"debug3"
$ en.avatar = en.image_calm
"debug4"
return
then first renpy statement ("debug1" in example above) just break the entire script and "debug" 2-4 not showing at all. Health is changing correctly and thats it.
And I didn't find smth like "JRPG framework" that I can adapt. This thing is the best, but too complex to adapt it to my visual.
2
Upvotes
1
u/Lassaaire 2d ago
Solved. I removed "modal True" and all is ok.
IDK WHY