Move() and cubic functions
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.
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.
- 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:
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(When was the last time you backed up your game?)
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom
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)) :
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.
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.2bSeems like I'll be posting the working code tomorrow when I have this cleared up ^^;. Would rather release something complete.
- 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:
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(When was the last time you backed up your game?)
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom
Follow up from your pm :
and I have this :
Line 297 is the first "init:" line ^^;
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.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)
#
#- 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:
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(When was the last time you backed up your game?)
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom
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 :
This line being :
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? @_@
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.Code: Select all
show test at Position(xpos=0.8, ypos=0.8) with MoveEaseTransition(2.0)- 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:
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.
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(When was the last time you backed up your game?)
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom
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...*
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
- 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:
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.
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(When was the last time you backed up your game?)
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom
- 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:
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(When was the last time you backed up your game?)
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom
Who is online
Users browsing this forum: _ticlock_
