TypeError: object of type 'int' has no len()[solved]

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
Doeny
Regular
Posts: 145
Joined: Wed Sep 07, 2022 8:28 pm
Contact:

TypeError: object of type 'int' has no len()[solved]

#1 Post by Doeny »

So basically I'm might be tired as hell or just dumb, but I didn't see that error accure ever earlier.
What I tried to do is simply call a screen:

Code: Select all

call screen my_room
but then that error appeared, saying "TypeError: object of type 'int' has no len()"

Do you have any ideas what could've gone wrong?
Last edited by Doeny on Sun Apr 09, 2023 9:41 pm, edited 1 time in total.

enaielei
Veteran
Posts: 293
Joined: Fri Sep 17, 2021 2:09 am
Organization: enaielei
Tumblr: enaielei
Deviantart: enaielei
Github: enaielei
Skype: enaielei
Soundcloud: enaielei
itch: enaielei
Discord: enaielei#7487
Contact:

Re: TypeError: object of type 'int' has no len()

#2 Post by enaielei »

You need to show your screen's code or the full traceback of the error.

Doeny
Regular
Posts: 145
Joined: Wed Sep 07, 2022 8:28 pm
Contact:

Re: TypeError: object of type 'int' has no len()

#3 Post by Doeny »

Here's what it looks like:

Code: Select all


I'm sorry, but an uncaught exception occurred.

While processing the outlines property of anonymous style:
  File "game/locations.rpy", line 12, in script
    call screen my_room
  File "renpy/common/000statements.rpy", line 609, in execute_call_screen
    store._return = renpy.call_screen(name, *args, **kwargs)
TypeError: object of type 'int' has no len()

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

Full traceback:
  File "game/locations.rpy", line 12, in script
    call screen my_room
  File "D:\renpy-8.0.2-sdk\renpy\ast.py", line 2232, in execute
    self.call("execute")
  File "D:\renpy-8.0.2-sdk\renpy\ast.py", line 2220, in call
    return renpy.statements.call(method, parsed, *args, **kwargs)
  File "D:\renpy-8.0.2-sdk\renpy\statements.py", line 281, in call
    return method(parsed, *args, **kwargs)
  File "renpy/common/000statements.rpy", line 609, in execute_call_screen
    store._return = renpy.call_screen(name, *args, **kwargs)
  File "D:\renpy-8.0.2-sdk\renpy\exports.py", line 3174, in call_screen
    rv = renpy.ui.interact(mouse="screen", type="screen", roll_forward=roll_forward)
  File "D:\renpy-8.0.2-sdk\renpy\ui.py", line 299, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "D:\renpy-8.0.2-sdk\renpy\display\core.py", line 3377, in interact
    repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, pause=pause, pause_start=pause_start, **kwargs) # type: ignore
  File "D:\renpy-8.0.2-sdk\renpy\display\core.py", line 3804, in interact_core
    root_widget.visit_all(lambda i : i.per_interact())
  File "D:\renpy-8.0.2-sdk\renpy\display\core.py", line 582, in visit_all
    d.visit_all(callback, seen)
  File "D:\renpy-8.0.2-sdk\renpy\display\core.py", line 582, in visit_all
    d.visit_all(callback, seen)
  File "D:\renpy-8.0.2-sdk\renpy\display\core.py", line 582, in visit_all
    d.visit_all(callback, seen)
  File "D:\renpy-8.0.2-sdk\renpy\display\screen.py", line 456, in visit_all
    self.child.visit_all(callback, seen=None)
  File "D:\renpy-8.0.2-sdk\renpy\display\core.py", line 582, in visit_all
    d.visit_all(callback, seen)
  File "D:\renpy-8.0.2-sdk\renpy\display\core.py", line 584, in visit_all
    callback(self)
  File "D:\renpy-8.0.2-sdk\renpy\display\core.py", line 3804, in <lambda>
    root_widget.visit_all(lambda i : i.per_interact())
  File "D:\renpy-8.0.2-sdk\renpy\text\text.py", line 1741, in per_interact
    if self.style.slow_abortable:
  File "gen3-static/styleclass.pxi", line 533, in renpy.styledata.styleclass.Style.slow_abortable.__get__
  File "style.pyx", line 493, in renpy.style.StyleCore._get
  File "style.pyx", line 710, in renpy.style.build_style
  File "style.pyx", line 707, in renpy.style.build_style
  File "gen3-static/style_functions.pyx", line 770, in style_functions.outlines_property
  File "D:\renpy-8.0.2-sdk\renpy\styledata\styleutil.py", line 60, in expand_outlines
    if len(i) == 2:
TypeError: object of type 'int' has no len()

Windows-10-10.0.19045 AMD64
Ren'Py 8.0.2.22081402
New Project 0.1
Sun Apr  9 01:48:17 2023

User avatar
_ticlock_
Miko-Class Veteran
Posts: 910
Joined: Mon Oct 26, 2020 5:41 pm
Contact:

Re: TypeError: object of type 'int' has no len()

#4 Post by _ticlock_ »

Doeny wrote: Sat Apr 08, 2023 10:48 pm Here's what it looks like:

Code: Select all

    if len(i) == 2:
TypeError: object of type 'int' has no len()
In your screen, `i` - is a number, not a tuple/list/dict. Possibly you overwrite variable `i` with some number at some point.

Doeny
Regular
Posts: 145
Joined: Wed Sep 07, 2022 8:28 pm
Contact:

Re: TypeError: object of type 'int' has no len()

#5 Post by Doeny »

But there are no numbers in my screen

User avatar
_ticlock_
Miko-Class Veteran
Posts: 910
Joined: Mon Oct 26, 2020 5:41 pm
Contact:

Re: TypeError: object of type 'int' has no len()

#6 Post by _ticlock_ »

Doeny wrote: Sun Apr 09, 2023 12:15 am But there are no numbers in my screen
Can you post the code of the screen that causes error?

Doeny
Regular
Posts: 145
Joined: Wed Sep 07, 2022 8:28 pm
Contact:

Re: TypeError: object of type 'int' has no len()

#7 Post by Doeny »

Can you post the code of the screen that causes error?
[/quote]

Code: Select all


label cc_shop_j:
    $ place = "cc_shop_j"
    if hour == 1:
        scene cc_shop_j_m
    elif hour == 2:
        scene cc_shop_j_d
    elif hour == 3:
        scene cc_shop_j_e
    else:
        scene cc_shop_j_n
    show screen ui
    call screen cc_shop
    return

screen cc_shop():
    if hour == 1:
        imagebutton:
            idle "shop_j_d"
            action NullAction()
        imagebutton auto ("mark_shop_%s"):
            action Jump("shop_j")
            xpos 300
            ypos 560
            focus_mask True

User avatar
_ticlock_
Miko-Class Veteran
Posts: 910
Joined: Mon Oct 26, 2020 5:41 pm
Contact:

Re: TypeError: object of type 'int' has no len()

#8 Post by _ticlock_ »

Doeny wrote: Sun Apr 09, 2023 1:28 am
I didn’t look carefully the first time I read the error. According to the error, the problem is in the screen ‘my_room’ and it seems that you incorrectly specify properly outlines.

Doeny
Regular
Posts: 145
Joined: Wed Sep 07, 2022 8:28 pm
Contact:

Re: TypeError: object of type 'int' has no len()

#9 Post by Doeny »

_ticlock_ wrote: Sun Apr 09, 2023 1:37 am
Doeny wrote: Sun Apr 09, 2023 1:28 am
I didn’t look carefully the first time I read the error. According to the error, the problem is in the screen ‘my_room’ and it seems that you incorrectly specify properly outlines.
but I literally left them empty

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2425
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: TypeError: object of type 'int' has no len()

#10 Post by Ocelot »

Doeny wrote: Sun Apr 09, 2023 2:42 am
_ticlock_ wrote: Sun Apr 09, 2023 1:37 am
Doeny wrote: Sun Apr 09, 2023 1:28 am
I didn’t look carefully the first time I read the error. According to the error, the problem is in the screen ‘my_room’ and it seems that you incorrectly specify properly outlines.
but I literally left them empty
How exactly did you "left them empty"? Post code of my_room screen.
< < insert Rick Cook quote here > >

Doeny
Regular
Posts: 145
Joined: Wed Sep 07, 2022 8:28 pm
Contact:

Re: TypeError: object of type 'int' has no len()

#11 Post by Doeny »

Ocelot wrote: Sun Apr 09, 2023 3:56 am
Doeny wrote: Sun Apr 09, 2023 2:42 am
_ticlock_ wrote: Sun Apr 09, 2023 1:37 am

I didn’t look carefully the first time I read the error. According to the error, the problem is in the screen ‘my_room’ and it seems that you incorrectly specify properly outlines.
but I literally left them empty
How exactly did you "left them empty"? Post code of my_room screen.
Ight, I messed up a bit with what changes I've applied and what I've forgotten about. Anyway, this code is a copy of the one with my_room, and it's what it currently looks like.

Doeny
Regular
Posts: 145
Joined: Wed Sep 07, 2022 8:28 pm
Contact:

Re: TypeError: object of type 'int' has no len()[solved]

#12 Post by Doeny »

_ticlock_ wrote: Sun Apr 09, 2023 1:37 am
Doeny wrote: Sun Apr 09, 2023 1:28 am
I didn’t look carefully the first time I read the error. According to the error, the problem is in the screen ‘my_room’ and it seems that you incorrectly specify properly outlines.
Honestly, I can't find anything incorrect here.
Edit: nvm, I found it.

Post Reply

Who is online

Users browsing this forum: RewindTheGame