A shimmying effect

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:

A shimmying effect

#1 Post by crimsonnight » Sun Dec 18, 2016 6:00 pm

Hey guys,

I have a scene in my novel where someone's trying to shimmy through a small hole - it's quite an intense scene so it'd be great if there was an effect I could use with it. I have been chatting with TheSHAD0W in the IRC, and we have gotten close with a modified hpunch transition (applied to 'layer master'):

Code: Select all

define shimmy = Move((50, 0), (-50, 0), 1.5, bounce=True, repeat=True, delay=None)
To make it more realistic though, I need to add a random pause in between the 'Move's - does anyone know how I can do this? It would also be nice if it smoothly moved the screen to the left instead of instantly jumping there when the effect is called.

We also tried an ATL statement:

Code: Select all

    show layer master:
        align (0.5,0.5)
     
        ease 1.5 xpos 0.45
        ease 1.5 xpos 0.55
        ease 1.5 xpos 0.45
        ease 1.5 xpos 0.55
        ease 1.5 xpos 0.45
        ease 1.5 xpos 0.55
        ease 1.5 xpos 0.45
        ease 1.5 xpos 0.55
        ease 1.5 xpos 0.45
        ease 1.5 xpos 0.5
     
        pause 50
     
        ease 1.5 xpos 0.45
        ease 1.5 xpos 0.55
        ease 1.5 xpos 0.45
        ease 1.5 xpos 0.55
        ease 1.5 xpos 0.45
        ease 1.5 xpos 0.55
        ease 1.5 xpos 0.45
        ease 1.5 xpos 0.55
        ease 1.5 xpos 0.45
        ease 1.5 xpos 0.5
     
        pause 10
     
        ease 1.5 xpos 0.45
        ease 1.5 xpos 0.55
        ease 1.5 xpos 0.45
        ease 1.5 xpos 0.55
        ease 1.5 xpos 0.45
        ease 1.5 xpos 0.55
        ease 1.5 xpos 0.45
        ease 1.5 xpos 0.55
        ease 1.5 xpos 0.45
        ease 1.5 xpos 0.5
     
        pause 5
     
        ease 1.5 xpos 0.45
        ease 1.5 xpos 0.55
        ease 1.5 xpos 0.45
        ease 1.5 xpos 0.55
        ease 1.5 xpos 0.45
        ease 1.5 xpos 0.55
        ease 1.5 xpos 0.45
        ease 1.5 xpos 0.55
        ease 1.5 xpos 0.45
        ease 1.5 xpos 0.5
     
        pause 10
     
        repeat
But there are a few problems with this - it doesn't seem to be repeating (action only performed 4 times), the pauses seem to be ignored, and it's a little choppy. The modified hpunch is functioning closer to the desired effect at this time.

If anyone can help me perfect the code it'd be greatly appreciated :)
alwaysthesamebluesky.com

User avatar
Kia
Eileen-Class Veteran
Posts: 1011
Joined: Fri Aug 01, 2014 7:49 am
Deviantart: KiaAzad
Discord: Kia#6810
Contact:

Re: A shimmying effect

#2 Post by Kia » Tue Dec 20, 2016 1:46 pm

try: pause renpy.random.randint(1,10)
check the documentation for random, I'm not sure if I wrote that correctly

Post Reply

Who is online

Users browsing this forum: No registered users