[error] Not a displayable: 9.9966 (is anim.blink timer works in screen() ?)

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
User avatar
Mjhay
Regular
Posts: 61
Joined: Sat Jan 16, 2021 2:29 pm
Location: Philippines
Contact:

[error] Not a displayable: 9.9966 (is anim.blink timer works in screen() ?)

#1 Post by Mjhay »

how can i add anim.blink in my timer screen?

every question the time is 20 seconds, and if the time is in 5 sec the timer will start to blink.

but it goes to error:

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 899, in script call
    call quiz_game(q_listMC_1, 5) # calling a quiz, passing name of questions list and quiz length
  File "game/script.rpy", line 593, in script
    $ res = renpy.display_menu(b)
  File "game/script.rpy", line 593, in <module>
    $ res = renpy.display_menu(b)
  File "game/script.rpy", line 89, in execute
    screen countdown(duration=20):
  File "game/script.rpy", line 89, in execute
    screen countdown(duration=20):
  File "game/script.rpy", line 96, in execute
    if time_remaining > 20:
  File "game/script.rpy", line 103, in execute
    text str(anim.Blink(time_remaining)) align(0.5, 0.10) color "#eb6e08" size 70
Exception: Not a displayable: 9.999999999999966

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "game/script.rpy", line 899, in script call
    call quiz_game(q_listMC_1, 5) # calling a quiz, passing name of questions list and quiz length
  File "game/script.rpy", line 593, in script
    $ res = renpy.display_menu(b)
  File "C:\Users\isle\Documents\THESIS\renpy\renpy-7.3.5-sdk\renpy\ast.py", line 914, in execute
    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
  File "C:\Users\isle\Documents\THESIS\renpy\renpy-7.3.5-sdk\renpy\python.py", line 2028, in py_exec_bytecode
    exec bytecode in globals, locals
  File "game/script.rpy", line 593, in <module>
    $ res = renpy.display_menu(b)
  File "C:\Users\isle\Documents\THESIS\renpy\renpy-7.3.5-sdk\renpy\exports.py", line 1226, in display_menu
    rv = renpy.ui.interact(mouse='menu', type=type, roll_forward=roll_forward)
  File "C:\Users\isle\Documents\THESIS\renpy\renpy-7.3.5-sdk\renpy\ui.py", line 297, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "C:\Users\isle\Documents\THESIS\renpy\renpy-7.3.5-sdk\renpy\display\core.py", line 2702, in interact
    repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, **kwargs)
  File "C:\Users\isle\Documents\THESIS\renpy\renpy-7.3.5-sdk\renpy\display\core.py", line 3094, in interact_core
    root_widget.visit_all(lambda i : i.per_interact())
  File "C:\Users\isle\Documents\THESIS\renpy\renpy-7.3.5-sdk\renpy\display\core.py", line 541, in visit_all
    d.visit_all(callback, seen)
  File "C:\Users\isle\Documents\THESIS\renpy\renpy-7.3.5-sdk\renpy\display\core.py", line 541, in visit_all
    d.visit_all(callback, seen)
  File "C:\Users\isle\Documents\THESIS\renpy\renpy-7.3.5-sdk\renpy\display\core.py", line 541, in visit_all
    d.visit_all(callback, seen)
  File "C:\Users\isle\Documents\THESIS\renpy\renpy-7.3.5-sdk\renpy\display\screen.py", line 430, in visit_all
    callback(self)
  File "C:\Users\isle\Documents\THESIS\renpy\renpy-7.3.5-sdk\renpy\display\core.py", line 3094, in <lambda>
    root_widget.visit_all(lambda i : i.per_interact())
  File "C:\Users\isle\Documents\THESIS\renpy\renpy-7.3.5-sdk\renpy\display\screen.py", line 440, in per_interact
    self.update()
  File "C:\Users\isle\Documents\THESIS\renpy\renpy-7.3.5-sdk\renpy\display\screen.py", line 625, in update
    self.screen.function(**self.scope)
  File "game/script.rpy", line 89, in execute
    screen countdown(duration=20):
  File "game/script.rpy", line 89, in execute
    screen countdown(duration=20):
  File "game/script.rpy", line 96, in execute
    if time_remaining > 20:
  File "game/script.rpy", line 103, in execute
    text str(anim.Blink(time_remaining)) align(0.5, 0.10) color "#eb6e08" size 70
  File "<screen language>", line 103, in <module>
  File "C:\Users\isle\Documents\THESIS\renpy\renpy-7.3.5-sdk\renpy\display\anim.py", line 507, in __init__
    self.image = renpy.easy.displayable(image)
  File "C:\Users\isle\Documents\THESIS\renpy\renpy-7.3.5-sdk\renpy\easy.py", line 136, in displayable
    raise Exception("Not a displayable: %r" % (d,))
Exception: Not a displayable: 9.999999999999966

Windows-8-6.2.9200
Ren'Py 7.3.5.606
CSSTIME 1.0
Sat Jun 12 19:09:28 2021
this is the timer code:

Code: Select all

screen countdown(duration=20):

    default time_remaining = duration

    timer 0.1 repeat True action SetScreenVariable("time_remaining", max(time_remaining - 0.1, 0))
    bar value AnimatedValue(time_remaining, duration) xsize 200 align (0.5, 0.20)

    if time_remaining > 20:
        text str(time_remaining) align(0.5, 0.10) color "#0c0f90" size 70
    elif time_remaining > 15:
        text str(time_remaining) align(0.5, 0.10) color "#07a81e" size 70
    elif time_remaining > 10:
        text str(time_remaining) align(0.5, 0.10) color "#faf104" size 70
    elif time_remaining > 5:
        text str(anim.Blink(time_remaining)) align(0.5, 0.10) color "#eb6e08" size 70 

    elif time_remaining > 0:
      text (anim.Blink(time_remaining)) align(0.5, 0.10) color "#f00" size 70
    else:
      text (anim.Blink(time_remaining)) align(0.5, 0.10) color "#f00" size 70

    if time_remaining <= 0:
      timer 0.01 action [Return(["---", "Unaswered"]), Hide("countdown")]

User avatar
IrinaLazareva
Veteran
Posts: 399
Joined: Wed Jun 08, 2016 1:49 pm
Projects: Legacy
Organization: SunShI
Location: St.Petersburg, Russia
Contact:

Re: [error] Not a displayable: 9.9966 (is anim.blink timer works in screen() ?)

#2 Post by IrinaLazareva »

(init)

Code: Select all

transform newblink:
    .5
    linear .5 alpha .0
    .5
    linear .5 alpha 1.0
    repeat
(in timer)

Code: Select all

    elif time_remaining > 5:
        text str(time_remaining) align(0.5, 0.10) color "#eb6e08" size 70 at newblink
    else:
        text str(time_remaining) align(0.5, 0.10) color "#f00" size 70 at newblink
https://www.renpy.org/doc/html/atl.html

User avatar
Mjhay
Regular
Posts: 61
Joined: Sat Jan 16, 2021 2:29 pm
Location: Philippines
Contact:

Re: [error] Not a displayable: 9.9966 (is anim.blink timer works in screen() ?)

#3 Post by Mjhay »

IrinaLazareva wrote: Sun Jun 13, 2021 5:35 am (init)

Code: Select all

transform newblink:
    .5
    linear .5 alpha .0
    .5
    linear .5 alpha 1.0
    repeat
[/code]
thanks for this idea

i try it and it works thanks . i fix a little cuz it blinks after 2 seconds . :D

Post Reply

Who is online

Users browsing this forum: No registered users