Moveoutleft/right - a more realistic version?

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
crimsonnight
Veteran
Posts: 298
Joined: Fri Apr 20, 2012 4:44 am
Contact:

Moveoutleft/right - a more realistic version?

#1 Post by crimsonnight »

Hey, pretty simple question really - I'd like to replace the moveoutleft/right transition with a more realistic walk-out transition instead. So I suppose the difference would be it'd be slower and the character would bob up and down a little - has anyone created a transition like this? :)
alwaysthesamebluesky.com

tigersmurf
Regular
Posts: 79
Joined: Sun May 15, 2011 11:50 pm
Projects: From Innocence
Location: The Evergreen State
Contact:

Re: Moveoutleft/right - a more realistic version?

#2 Post by tigersmurf »

This can be easily accomplished by using ATL.

Check out this page to help get you started http://lemmasoft.renai.us/forums/viewto ... 51&t=16604

Elmiwisa
Veteran
Posts: 476
Joined: Sun Jul 21, 2013 8:08 am
Contact:

Re: Moveoutleft/right - a more realistic version?

#3 Post by Elmiwisa »

I am not sure exactly what you meant by a walking animation here, since you most likely have a rather static sprite, so it would still look unnatural either way (the legs wouldn't animate, and a walking person - unless they practiced very well - would distort the whole upper part of the body while they move too). In fact, just slide away would make thing look more realistic, simply because it does not call attention to the fact that it is not realistic.
If you insist on doing it, then from what I seen of puppet show, the make the walking effect, the puppet (equivalent to a sprite here) while being moved away slowly would also be shook up and down slightly periodically, and would be rotated around 30 degree to either side periodically with the center of rotation at the bottom.

User avatar
Donmai
Eileen-Class Veteran
Posts: 1960
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
Projects: Slumberland
Location: Brazil
Contact:

Re: Moveoutleft/right - a more realistic version?

#4 Post by Donmai »

I understand crimsonnight is referring to the fact that the movein transitions are too fast to be acceptable when we are using more realistic characters, as the movement is done in 0.5 sec (on a large screen, the sprite zooms in a funny way). We can use the move transition with a delay (http://renpy.org/wiki/renpy/doc/referen ... Transition) but I have to agree with both tigersmurf (The use of ATL may be a solution) and Elmiwisa (no need to create a complex walking animation). Just remember the character Yuuko (of Katawa Shoujo) at the Shanghai. Her sprite only moves a little down and up and in our minds we see her greeting her customers with a bow. Then, the sprites of Shizune and Misha move halfway down the screen and we understand they have sat down on their (not visible) chairs. It's the power of suggestion.

So, if we only want to suggest a character is walking into our scene, we can think about some simple ATL transforms that can replace the movein transitions, with adjustable speed:

Code: Select all

transform movein_right:
    subpixel True
    offscreenright
    easein 3.0 center #move the character to the center of the screen. We can use right, left, or offscreenleft, if the figure is only passing by...
    
transform movein_left:
    subpixel True
    offscreenleft
    easein 3.0 center #this number is the time in seconds
We can adjust the number following the easein warper to change the speed. Or use ease, easeout or linear to change the acceleration.

To use these simple transforms:

Code: Select all

show sprite at movein_left
show sprite at movein_right
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

crimsonnight
Veteran
Posts: 298
Joined: Fri Apr 20, 2012 4:44 am
Contact:

Re: Moveoutleft/right - a more realistic version?

#5 Post by crimsonnight »

Cheers Donmai, I was actually looking for a more realistic moveout as opposed to in ;p
I tried your script out though to see how it worked and to see if I could reverse it, but I get the following error when it tries to execute the command:

Code: Select all

Compiling ATL code at game/script.rpy:724
  File "game/script.rpy", line 731, in script
Exception: Expression u'center ' is not an ATL transform, and so cannot be included in an ATL interpolation.
alwaysthesamebluesky.com

User avatar
Donmai
Eileen-Class Veteran
Posts: 1960
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
Projects: Slumberland
Location: Brazil
Contact:

Re: Moveoutleft/right - a more realistic version?

#6 Post by Donmai »

crimsonnight wrote:Cheers Donmai, I was actually looking for a more realistic moveout as opposed to in ;p
Cheers. Yes, I've noticed that after posting, but I thought it would be easy for you to rewrite the code. I don't know why it didn't work for you. It runs fine on my side. The "moving out" versions would be something like this:

Code: Select all

transform moveout_right:
    subpixel True
    center #(or any screen position your sprite may be)
    easeout 3.0 offscreenright
    
transform moveout_left:
    subpixel True
    center
    easeout 3.0 offscreenleft
BTW congratulations on releasing your game! :D
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

crimsonnight
Veteran
Posts: 298
Joined: Fri Apr 20, 2012 4:44 am
Contact:

Re: Moveoutleft/right - a more realistic version?

#7 Post by crimsonnight »

Thank you, I appreciate both the code and the warm wishes :) Have you had a chance to read it yet? If not then I'll forward you a free copy as you've really helped me out a lot :)

The new code didn't crash the game, but it also doesn't seem to work, the character just disappears with no animation at all - it's ok to use with the hide command isn't it? (ie 'hide m1su_p at offscreenright')
alwaysthesamebluesky.com

User avatar
Donmai
Eileen-Class Veteran
Posts: 1960
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
Projects: Slumberland
Location: Brazil
Contact:

Re: Moveoutleft/right - a more realistic version?

#8 Post by Donmai »

Strangely enough, you would use show to hide your character

Code: Select all

show m1su_p at offscreenright
Uh-oh! That reminds me that code isn't really hiding the image. You can simply hide it after the transform.

Code: Select all

show m1su_p at offscreenright
hide m1su_p
(Or wait until someone smarter than me comes with a better solution :lol: )
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

crimsonnight
Veteran
Posts: 298
Joined: Fri Apr 20, 2012 4:44 am
Contact:

Re: Moveoutleft/right - a more realistic version?

#9 Post by crimsonnight »

Sorry my bad, the transition name isn't 'offscreenright'! It's still crashes when calling the correct transform code:

Compiling ATL code at game/script.rpy:576
File "game/script.rpy", line 844, in script
Exception: Not a displayable: <curry <class 'renpy.display.layout.Position'> () {'xpos': 0.5, 'xanchor': 'center'}>
alwaysthesamebluesky.com

User avatar
Donmai
Eileen-Class Veteran
Posts: 1960
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
Projects: Slumberland
Location: Brazil
Contact:

Re: Moveoutleft/right - a more realistic version?

#10 Post by Donmai »

Wow! I made a big mess here! Sorry (cafein excess, maybe).
I mean:

Code: Select all

show m1su_p at moveout_right
hide m1su_p
:oops:
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

crimsonnight
Veteran
Posts: 298
Joined: Fri Apr 20, 2012 4:44 am
Contact:

Re: Moveoutleft/right - a more realistic version?

#11 Post by crimsonnight »

Sorry that's what I was saying, I figured it out and put the correct command in lol, but it crashes and comes up with that error when you reach that part of the story
alwaysthesamebluesky.com

User avatar
Donmai
Eileen-Class Veteran
Posts: 1960
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
Projects: Slumberland
Location: Brazil
Contact:

Re: Moveoutleft/right - a more realistic version?

#12 Post by Donmai »

Oh, I see. Here is a quick demo I made with the code. Unzip it to your Ren'Py folder and try to run it. If the effect works, then the problem is elsewhere in your code.
Attachments
Demo Moving Out.zip
(408.72 KiB) Downloaded 97 times
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

Post Reply

Who is online

Users browsing this forum: Google [Bot], voluorem