[Solved] Can't call a label/screen? (TypeError: 'float' object...)

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
017Bluefield
Regular
Posts: 93
Joined: Mon Dec 30, 2013 1:55 am
Projects: Project Bluefield - Origins
Organization: Autumn Rain
Deviantart: playerzero17
itch: autumn-rain
Contact:

[Solved] Can't call a label/screen? (TypeError: 'float' object...)

#1 Post by 017Bluefield »

So I have a warnings_screen() and an engine_logo() screen, both of which appear when called. Thing is, the engine_logo() is working just fine, while warnings_screen() gives me this:

Code: Select all

I'm sorry, but an uncaught exception occurred.

While processing the align property of anonymous style:
  File "renpy/common/00start.rpy", line 224, in script call
    call _splashscreen from _call_splashscreen_1
  File "game/script.rpy", line 65, in script call
    call warnings_splash
  File "game/screens_splash_screens.rpy", line 41, in script
    with dissolve
TypeError: 'float' object has no attribute '__getitem__'

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

Full traceback:
  File "renpy/common/00start.rpy", line 224, in script call
    call _splashscreen from _call_splashscreen_1
  File "game/script.rpy", line 65, in script call
    call warnings_splash
  File "game/screens_splash_screens.rpy", line 41, in script
    with dissolve
  File "C:\Users\M______\Documents\RenPy\renpy-6.99.12.4-sdk\renpy\ast.py", line 1357, in execute
    renpy.exports.with_statement(trans, paired)
  File "C:\Users\M______\Documents\RenPy\renpy-6.99.12.4-sdk\renpy\exports.py", line 1455, in with_statement
    return renpy.game.interface.do_with(trans, paired, clear=clear)
  File "C:\Users\M______\Documents\RenPy\renpy-6.99.12.4-sdk\renpy\display\core.py", line 2217, in do_with
    clear=clear)
  File "C:\Users\M______\Documents\RenPy\renpy-6.99.12.4-sdk\renpy\display\core.py", line 2662, in interact
    repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, **kwargs)
  File "C:\Users\M______\Documents\RenPy\renpy-6.99.12.4-sdk\renpy\display\core.py", line 3049, in interact_core
    root_widget.visit_all(lambda i : i.per_interact())
  File "C:\Users\M______\Documents\RenPy\renpy-6.99.12.4-sdk\renpy\display\core.py", line 521, in visit_all
    d.visit_all(callback, seen)
  File "C:\Users\M______\Documents\RenPy\renpy-6.99.12.4-sdk\renpy\display\core.py", line 521, in visit_all
    d.visit_all(callback, seen)
  File "C:\Users\M______\Documents\RenPy\renpy-6.99.12.4-sdk\renpy\display\core.py", line 521, in visit_all
    d.visit_all(callback, seen)
  File "C:\Users\M______\Documents\RenPy\renpy-6.99.12.4-sdk\renpy\display\core.py", line 521, in visit_all
    d.visit_all(callback, seen)
  File "C:\Users\M______\Documents\RenPy\renpy-6.99.12.4-sdk\renpy\display\screen.py", line 428, in visit_all
    self.child.visit_all(callback, seen=None)
  File "C:\Users\M______\Documents\RenPy\renpy-6.99.12.4-sdk\renpy\display\core.py", line 521, in visit_all
    d.visit_all(callback, seen)
  File "C:\Users\M______\Documents\RenPy\renpy-6.99.12.4-sdk\renpy\display\core.py", line 521, in visit_all
    d.visit_all(callback, seen)
  File "C:\Users\M______\Documents\RenPy\renpy-6.99.12.4-sdk\renpy\display\core.py", line 521, in visit_all
    d.visit_all(callback, seen)
  File "C:\Users\M______\Documents\RenPy\renpy-6.99.12.4-sdk\renpy\display\core.py", line 523, in visit_all
    callback(self)
  File "C:\Users\M______\Documents\RenPy\renpy-6.99.12.4-sdk\renpy\display\core.py", line 3049, in <lambda>
    root_widget.visit_all(lambda i : i.per_interact())
  File "C:\Users\M______\Documents\RenPy\renpy-6.99.12.4-sdk\renpy\text\text.py", line 1520, in per_interact
    if self.style.slow_abortable:
  File "gen/styleclass.pxi", line 749, in renpy.styledata.styleclass.Style.slow_abortable.__get__
  File "style.pyx", line 493, in renpy.style.StyleCore._get
  File "style.pyx", line 709, in renpy.style.build_style
  File "style.pyx", line 706, in renpy.style.build_style
  File "gen/style_functions.pyx", line 1817, in style_functions.align_property
  File "include/style_common.pxi", line 30, in style_functions.index_0
    return v[0]
TypeError: 'float' object has no attribute '__getitem__'
I've already taken care of a different problem related to zorders on both screens, so it's not an "eval arg 1" issue. Am I doing something wrong with an alignment float?

Here's the file where this is happening.
Attachments
screens_splash_screens.rpy
(1.02 KiB) Downloaded 19 times
Last edited by 017Bluefield on Thu Nov 08, 2018 12:48 am, edited 1 time in total.

017Bluefield
Regular
Posts: 93
Joined: Mon Dec 30, 2013 1:55 am
Projects: Project Bluefield - Origins
Organization: Autumn Rain
Deviantart: playerzero17
itch: autumn-rain
Contact:

Re: Can't call a label/screen? (TypeError: 'float' object...)

#2 Post by 017Bluefield »

Nevermind, I think I've solved it. It might've been the manually-added text_align property in the label element. Here's the new version without that part:

Code: Select all

screen warnings_screen():
    zorder 10

    vbox:
        align (0.5,0.5)
        xsize 900

        label _("{b}WARNING{/b}:") style "warnings_screen_label":
            text_size 72

        null height 50

        text _("* Flashing lights (Epilepsy){p}* Gore{p}* Strong language{p}* Possible suggestive themes")

Post Reply

Who is online

Users browsing this forum: Bing [Bot]