TypeError:object of type 'ATLTransform' 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
User avatar
Luxliev
Veteran
Posts: 242
Joined: Sat Feb 07, 2015 11:01 am
Soundcloud: Luxliev
Contact:

TypeError:object of type 'ATLTransform' has no len()[SOLVED]

#1 Post by Luxliev » Tue Jul 21, 2015 6:44 am

I wanted to check code from renpy cookbook:
http://www.renpy.org/wiki/renpy/doc/coo ... y_movement

And I keep getting same error. What does this error message mean? Simple and complex form gives me same error.

Code used:

Code: Select all

init python:
    import math

    rho = 5.0
    mu = 15.0
    scale_factor = 1.0 - math.exp(-rho) * math.cos(mu)

    def springy_time_warp(x):
        return (1.0 - math.exp(-rho * x) * math.cos(mu * x)) / scale_factor

define e = Character('Eileen', color="#c8ffc8")

image eileen happy = "eileen happy.png"

# The game starts here.
label start:

    e "You've created a new Ren'Py game."

    show eileen happy at Move(offscreenleft, center, 1.0, time_warp = springy_time_warp)
    
    e "Once you add a story, pictures, and music, you can release it to the world!"

    return
Error message:

I'm sorry, but an uncaught exception occurred.

While running game code:
File "game/script.rpy", line 20, in script
show eileen happy at Move(offscreenleft, center, 1.0, time_warp = springy_time_warp)
TypeError: object of type 'ATLTransform' has no len()

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

Full traceback:
File "game/script.rpy", line 20, in script
show eileen happy at Move(offscreenleft, center, 1.0, time_warp = springy_time_warp)
File "D:\Python\Ren'py\renpy\ast.py", line 1040, in execute
show_imspec(self.imspec, atl=getattr(self, "atl", None))
File "D:\Python\Ren'py\renpy\ast.py", line 1012, in show_imspec
atl=atl)
File "D:\Python\Ren'py\renpy\exports.py", line 540, in show
img = i(img)
File "D:\Python\Ren'py\renpy\curry.py", line 38, in __call__
**dict(self.kwargs.items() + kwargs.items()))
File "D:\Python\Ren'py\renpy\display\motion.py", line 1197, in Move
return Motion(Interpolate(startpos, endpos),
File "D:\Python\Ren'py\renpy\display\motion.py", line 1104, in __init__
if len(start) != len(end):
TypeError: object of type 'ATLTransform' has no len()

Windows-8-6.2.9200
Ren'Py 6.99.4.467
sadas 0.0
Last edited by Luxliev on Fri Jul 24, 2015 1:02 pm, edited 1 time in total.
Newest classical cover: Advance Wars - Sami Theme: https://www.youtube.com/watch?v=657Jt7hJRVc

Forum with my music: http://luxliev.proboards.com/

User avatar
mobychan
Veteran
Posts: 275
Joined: Fri Apr 24, 2015 6:31 am
Projects: The Chosen - Sakura Pink & Gentian Blue
Organization: Foresoft
Location: Germany
Contact:

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

#2 Post by mobychan » Tue Jul 21, 2015 7:05 am

Maybe that code is obsolete?
you should use this documentation:
http://www.renpy.org/doc/html/

It's the one that's being updated^^

And I think it should be
show eileen happy at Move(offscreenleft, center, 1.0, time_warp = springy_time_warp())
with brackets behind springy_time_warp

User avatar
Luxliev
Veteran
Posts: 242
Joined: Sat Feb 07, 2015 11:01 am
Soundcloud: Luxliev
Contact:

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

#3 Post by Luxliev » Tue Jul 21, 2015 7:46 am

Nope. That's probably not it. When I've added brackets it asked me for argument and when I added number in brackets it gave me again same error:
TypeError: object of type 'ATLTransform' has no len()
Newest classical cover: Advance Wars - Sami Theme: https://www.youtube.com/watch?v=657Jt7hJRVc

Forum with my music: http://luxliev.proboards.com/

User avatar
SinnyROM
Regular
Posts: 166
Joined: Mon Jul 08, 2013 12:25 am
Projects: Blue Birth
Organization: Cosmic Static Games
Contact:

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

#4 Post by SinnyROM » Tue Jul 21, 2015 8:29 am

I tried to find more information on Move() but only found it in the old wiki documentation: http://www.renpy.org/wiki/Move
It states that it is deprecated and may not work properly with ATL. Since ATL statements are made with the keyword at, as here, it looks like there will always be a conflict. I would agree with mobychan and read through the new documentation instead.

User avatar
nyaatrap
Crawling Chaos
Posts: 1824
Joined: Mon Feb 13, 2012 5:37 am
Location: Kimashi Tower, Japan
Contact:

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

#5 Post by nyaatrap » Tue Jul 21, 2015 9:36 am

offscreenleft, center are Transform objects. I think they were Position objects when that's code is written.

User avatar
Luxliev
Veteran
Posts: 242
Joined: Sat Feb 07, 2015 11:01 am
Soundcloud: Luxliev
Contact:

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

#6 Post by Luxliev » Wed Jul 22, 2015 4:56 am

So the best way to check this cookbook effect is to install older version of Ren'py if so which version I should be looking for?
Newest classical cover: Advance Wars - Sami Theme: https://www.youtube.com/watch?v=657Jt7hJRVc

Forum with my music: http://luxliev.proboards.com/

User avatar
trooper6
Lemma-Class Veteran
Posts: 3712
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

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

#7 Post by trooper6 » Wed Jul 22, 2015 8:39 am

The wiki was outdated when I first started using Renpy...and that was 4 years ago.
You would be better off just making the transition with modern ATL.
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

User avatar
Luxliev
Veteran
Posts: 242
Joined: Sat Feb 07, 2015 11:01 am
Soundcloud: Luxliev
Contact:

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

#8 Post by Luxliev » Thu Jul 23, 2015 4:09 am

Oh don't get me wrong I'm using ATL but I'm really curious how this will work and look like. That's why I'm asking for Ren'py version I should run this on. All Cookbook material is really interesting and useful so I just didn't want to left out any of the examples.
Newest classical cover: Advance Wars - Sami Theme: https://www.youtube.com/watch?v=657Jt7hJRVc

Forum with my music: http://luxliev.proboards.com/

User avatar
nyaatrap
Crawling Chaos
Posts: 1824
Joined: Mon Feb 13, 2012 5:37 am
Location: Kimashi Tower, Japan
Contact:

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

#9 Post by nyaatrap » Thu Jul 23, 2015 6:21 am

Why not try simple tuple like (.5,.5) instead of center?

User avatar
Luxliev
Veteran
Posts: 242
Joined: Sat Feb 07, 2015 11:01 am
Soundcloud: Luxliev
Contact:

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

#10 Post by Luxliev » Thu Jul 23, 2015 2:29 pm

Unfortunately same error message. What's interesting this code is supposedly from Ren'Py 6.6.3 so not that long ago. I'll download appropriate version and see if it works.
Newest classical cover: Advance Wars - Sami Theme: https://www.youtube.com/watch?v=657Jt7hJRVc

Forum with my music: http://luxliev.proboards.com/

User avatar
trooper6
Lemma-Class Veteran
Posts: 3712
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

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

#11 Post by trooper6 » Thu Jul 23, 2015 4:06 pm

Ren'Py 6.6.3 is, I believe, from over 7 years ago...so a very long time ago indeed!

Anyhow, I got your code to work so:
show agentx angry at Move((-1.0, 1.0), (0.5, 1.0), 5.0, time_warp=springy_time_warp, xanchor="center", yanchor="bottom")

But...the bounces are horizontal, not vertical and they don't look great.
If you want a walking sort of bounce...I think it would be better to just go with saguaro's parallel code that moves a character vertically and horizontally at the same time.
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

User avatar
Luxliev
Veteran
Posts: 242
Joined: Sat Feb 07, 2015 11:01 am
Soundcloud: Luxliev
Contact:

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

#12 Post by Luxliev » Fri Jul 24, 2015 6:42 am

Woah you're right I thought 6.6.3 wasn't so long ago. I implemented your solution and it works perfectly while simple form of this code doesn't look great as you noticed, its complex version is pretty good I really like easy ease animation it gives. For anyone interested I created Ren'py project with 6 examples and code ready to implement. It's basically actual Ren'py version of this Cookbook page:

http://www.renpy.org/wiki/renpy/doc/coo ... y_movement

Thanks for help!
Attachments
Springy movement.zip
(628 KiB) Downloaded 15 times
Newest classical cover: Advance Wars - Sami Theme: https://www.youtube.com/watch?v=657Jt7hJRVc

Forum with my music: http://luxliev.proboards.com/

Post Reply

Who is online

Users browsing this forum: Ocelot