Move() and cubic functions

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.
Message
Author
User avatar
DaFool
Lemma-Class Veteran
Posts: 4171
Joined: Tue Aug 01, 2006 12:39 pm
Contact:

#16 Post by DaFool » Thu Aug 17, 2006 3:18 pm

Does Ren'Py support vector graphics?

User avatar
PyTom
Ren'Py Creator
Posts: 15893
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

#17 Post by PyTom » Thu Aug 17, 2006 3:32 pm

No, Ren'Py is currently limited to raster graphics. (JPG, GIF, PNG, and probably a few other minor formats that aren't worth worrying about.)
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
monele
Lemma-Class Veteran
Posts: 4101
Joined: Sat Oct 08, 2005 7:57 am
Location: France
Contact:

#18 Post by monele » Thu Aug 17, 2006 5:20 pm

Mmm... *worried eyebrow*... I tried copying MoveTransition as it is in my script (in an init, python block), renaming it MoveEaseTransition and I get this when I try to use it (show something at someplace with MoveEaseTransition(sometime)) :

Code: Select all

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

  File "renpy\bootstrap.pyo", line 96, in bootstrap
  File "renpy\main.pyo", line 233, in main
  File "renpy\main.pyo", line 158, in run
  File "renpy\execution.pyo", line 76, in run
  File "renpy\ast.pyo", line 495, in execute
  File "renpy\python.pyo", line 787, in py_eval
  File "<none>", line 1, in <expression>
  File "game/ease.rpy", line 415, in MoveEaseTransition
  File "game/ease.rpy", line 344, in merge_slide
  File "game/ease.rpy", line 315, in position
AttributeError: 'NoneType' object has no attribute 'get_placement'

The last script statement executed was on line 521 of game/script.rpy.

Ren'Py Version: Ren'Py 5.5.2b
Seems like something is not defined or it doesn't find any image to move ? Note that MoveTransition works in the same script of course.

Seems like I'll be posting the working code tomorrow when I have this cleared up ^^;. Would rather release something complete.

User avatar
monele
Lemma-Class Veteran
Posts: 4101
Joined: Sat Oct 08, 2005 7:57 am
Location: France
Contact:

#19 Post by monele » Fri Aug 18, 2006 11:47 am

*bump* ? :(

User avatar
PyTom
Ren'Py Creator
Posts: 15893
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

#20 Post by PyTom » Fri Aug 18, 2006 11:51 am

Can you send me an example script to take a look at? It's hard to tell from just the traceback alone, when I don't have important parts of the code.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
monele
Lemma-Class Veteran
Posts: 4101
Joined: Sat Oct 08, 2005 7:57 am
Location: France
Contact:

#21 Post by monele » Fri Aug 18, 2006 12:51 pm

Sent ^^

User avatar
monele
Lemma-Class Veteran
Posts: 4101
Joined: Sat Oct 08, 2005 7:57 am
Location: France
Contact:

#22 Post by monele » Fri Aug 18, 2006 1:24 pm

Follow up from your pm :

Code: Select all

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

  File "renpy\bootstrap.pyo", line 96, in bootstrap
  File "renpy\main.pyo", line 233, in main
  File "renpy\main.pyo", line 95, in run
  File "renpy\execution.pyo", line 76, in run
  File "renpy\ast.pyo", line 334, in execute
  File "renpy\python.pyo", line 763, in py_exec_bytecode
  File "game/ease.rpy", line 421, in <module>
AttributeError: 'function' object has no attribute 'curry'

The last script statement executed was on line 297 of game/ease.rpy.
and I have this :

Code: Select all

init:
    python:
        
        def _MoveEaseTransition(delay, old_widget=None, new_widget=None):
            """
            This transition attempts to find images that have changed
            position, and moves them from the old position to the new
            transition, taking delay seconds to complete the move and using
            a easing function to make the movement smoother.
        
            Images are considered to be the same if they have the same tag, in
            the same way that the tag is used to determine which image to
            replace or to hide.
        
            If you use this transition to slide an image off the side of the
            screen, remember to hide it when you are done.
            """
        
            def position(d):
        
                xpos, ypos, xanchor, yanchor = d.get_placement()
        
                if xpos is None:
                    xpos = 0
                if ypos is None:
                    ypos = 0
                if xanchor is None:
                    xanchor = 0
                if yanchor is None:
                    yanchor = 0
        
                if isinstance(xpos, float):
                    xpos = int(renpy.config.screen_width * xpos)
        
                if isinstance(ypos, float):
                    ypos = int(renpy.config.screen_height * ypos)
        
                return xpos, ypos, xanchor, yanchor
                
        
            def merge_slide(old, new):
        
                    
                # If new does not have .layers or .scene_list, then we simply
                # insert a move from the old position to the new position, if
                # a move occured.
        
                if not hasattr(new, 'layers') and not hasattr(new, 'scene_list'):
        
                    if position(old) != position(new):
        
                        return renpy.display.layout.MoveEase(position(old),
                                                         position(new),
                                                         delay,
                                                         new,
                                                         )
                    else:
                        return new
        
                # If we're in the root widget, merge the child widgets for
                # each layer.
                if new.layers:
                    assert old.layers
        
                    rv = renpy.display.layout.Fixed()
                    rv.layers = { }
        
                    for layer in renpy.config.layers:
        
                        f = new.layers[layer]
        
                        if isinstance(f, renpy.display.layout.Fixed) and f.scene_list:
                            f = merge_slide(old.layers[layer], new.layers[layer])
        
                        rv.layers[layer] = f
                        rv.add(f)
        
                    return rv
        
                # Otherwise, we recompute the scene list for the two widgets, merging
                # as appropriate.
        
                tags = { }
        
                for tag, start, anim, d in old.scene_list:
        
                    if tag is None:
                        continue
        
                    tags[tag] = d
        
                newsl = [ ]
        
                for tag, time, anim, d in new.scene_list:
        
                    if tag is None or tag not in tags:
                        newsl.append((tag, time, anim, d))
                        continue
        
                    oldpos = position(tags[tag])
                    newpos = position(d)
        
                    if oldpos == newpos:
                        newsl.append((tag, time, anim, d))
                        continue
                        
                    move = renpy.display.layout.MoveEase(position(tags[tag]),
                                                     position(d),
                                                     delay,
                                                     d,
                                                     )
        
                    newsl.append((tag, None, anim, move))
        
                rv = renpy.display.layout.Fixed()
                rv.append_scene_list(newsl)
        
                return rv
        
        
            rv = merge_slide(old_widget, new_widget)
            rv.delay = delay
        
            return rv
        #
        
        MoveEaseTransition = renpy.curry.curry(_MoveEaseTransition)
    #
    
#
Line 297 is the first "init:" line ^^;

User avatar
PyTom
Ren'Py Creator
Posts: 15893
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

#23 Post by PyTom » Fri Aug 18, 2006 1:30 pm

Sorry, it's renpy.curry, not renpy.curry.curry.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
monele
Lemma-Class Veteran
Posts: 4101
Joined: Sat Oct 08, 2005 7:57 am
Location: France
Contact:

#24 Post by monele » Fri Aug 18, 2006 1:47 pm

It is renpy.curry.curry in story.py though... strange :)..... and it's still crashing >.<...

I've curried the MoveEase function too (didn't at first) and changed the call to "renpy.display.layout.MoveEase" to "MoveEase", since that'd be more logical ^^;... It compiles, runs, but then crashes with this :

Code: Select all

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

  File "renpy\bootstrap.pyo", line 96, in bootstrap
  File "renpy\main.pyo", line 233, in main
  File "renpy\main.pyo", line 158, in run
  File "renpy\execution.pyo", line 76, in run
  File "renpy\ast.pyo", line 499, in execute
  File "renpy\exports.pyo", line 701, in with
  File "renpy\display\core.pyo", line 985, in interact
  File "renpy\display\core.pyo", line 1144, in interact_core
  File "renpy\display\core.pyo", line 155, in visit_all
  File "renpy\display\core.pyo", line 1144, in <lambda>
AttributeError: 'Curry' object has no attribute 'per_interact'

The last script statement executed was on line 521 of game/script.rpy.
This line being :

Code: Select all

    show test at Position(xpos=0.8, ypos=0.8) with MoveEaseTransition(2.0)
Looking for the attribute, I find it in DynamicDisplayable... But at that point, I don't know what to conclude ô_o;... should MoveEase have such a function ? Should it somehow be defined as a child of DynamicDisplayable or something? @_@

User avatar
PyTom
Ren'Py Creator
Posts: 15893
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

#25 Post by PyTom » Fri Aug 18, 2006 2:09 pm

In MoveEaseTransition, call _MoveEase rather than MoveEase.

The confusion here is because there are two versions of Move in Ren'Py:

Move (aka, renpy.store.move) is the one you normally see, and this is a currying version of renpy.display.layout.move.Move, and is equivalent to MoveEase.

renpy.display.layout.Move is the non-currying version of Move, and is equivalent to _MoveEase.

One of these days, I need to document how to write displayables, at-functions, transitions, and the like.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
monele
Lemma-Class Veteran
Posts: 4101
Joined: Sat Oct 08, 2005 7:57 am
Location: France
Contact:

#26 Post by monele » Fri Aug 18, 2006 2:34 pm

Ok, I think I understand ^^ *tries*...

Yuhh ;o;... still the same error ;o;.. Should _MoveEaseTransition be a def or a class ? ô_o;... *joins files in case it's something stupid like a typo...*
Attachments
ease.rpy
(15.81 KiB) Downloaded 116 times
script.rpy
(28.76 KiB) Downloaded 98 times

User avatar
PyTom
Ren'Py Creator
Posts: 15893
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

#27 Post by PyTom » Fri Aug 18, 2006 2:38 pm

A def, I think.

Can you send me a working game with all of this? It's hard to debug things when I can't run the code.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
monele
Lemma-Class Veteran
Posts: 4101
Joined: Sat Oct 08, 2005 7:57 am
Location: France
Contact:

#28 Post by monele » Fri Aug 18, 2006 4:17 pm

Mm, yes. It should be around 50mb, so... should I use YouSendIt or should I attach it to a post ?

User avatar
PyTom
Ren'Py Creator
Posts: 15893
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

#29 Post by PyTom » Fri Aug 18, 2006 4:29 pm

Email is probably better, so we don't cutter the server with a large file.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
monele
Lemma-Class Veteran
Posts: 4101
Joined: Sat Oct 08, 2005 7:57 am
Location: France
Contact:

#30 Post by monele » Fri Aug 18, 2006 4:42 pm

OK, will send this in multiple e-mails (my limit is around 10mb...).

Post Reply

Who is online

Users browsing this forum: _ticlock_