[Solved] Help, the timer bar hesitates at points

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
texi
Newbie
Posts: 14
Joined: Tue May 30, 2017 3:40 pm
Contact:

[Solved] Help, the timer bar hesitates at points

#1 Post by texi »

I used the bar timer from the wiki and made some changes so it counts up instead of down and made it so that the player can't skip it. However, at certain points, the bar hesitates to move/fill (it does but pauses a little before continuing). It also does this at the same places every time.

Code: Select all

transform alpha_dissolve:
    alpha 0.0
    linear 0.5 alpha 1.0
    on hide:
        linear 0.5 alpha 0

screen countdown:
    timer 0.01 repeat True action If(time < 3, true=SetVariable('time', time + 0.01), false=[Hide('countdown'), Jump(timer_jump)])
    bar value time range timer_range xalign 0.5 yalign 0.5 xmaximum 300 at alpha_dissolve 

label start:
    scene bg room
 
    label timer_bar:
        $ time = 0
        $ timer_range = 3
        $ timer_jump = 'finished'  
        show screen countdown
        $ renpy.pause(5.5, hard=True)           
        pause              
    label finished:
        "task complete"
Last edited by texi on Thu Jun 29, 2017 5:28 am, edited 1 time in total.

philat
Eileen-Class Veteran
Posts: 1910
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: Help, the timer bar hesitates at points

#2 Post by philat »

Likely a performance issue. Performance with timers is discussed here: viewtopic.php?f=8&t=42048#p440382

There are a couple of solutions in that thread; feel free to improvise.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Majestic-12 [Bot]