[Solved!] Continuous shake 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.
Message
Author
User avatar
teacup
Holder of Tasty Drinks
Posts: 911
Joined: Thu Oct 15, 2009 12:25 pm
Completed: (P)lanets - the life of normalcy has ended
Projects: Circum[N]avigate
Contact:

[Solved!] Continuous shake effect?

#1 Post by teacup »

Very sorry if this has been asked before, I couldn't find it ;w;
Anyway. I know how to do the shake effect.

Code: Select all

    m2 "{size=+35}KYAAAAAA!!!{/size}"
    show c1 
    with Shake((0.5, 1.0, 0.5, 1.0), 1.0, dist=5)
    "My feet let go of the edge of the staircase and I let out a scream."
But what I'm wondering is if the screen can be shaking continuously while text goes across the screen? Because right now, I can only get the screen to shake, stop, then the text appears. So what I'm wondering is if I can get this to happen... simultaneously.
If not, that's cool. I just thought it would make it seem more realistic XD
Last edited by teacup on Tue May 31, 2011 5:23 pm, edited 1 time in total.
Image

User avatar
fioricca
Veteran
Posts: 333
Joined: Fri Feb 19, 2010 3:17 am
Completed: Rising Angels Reborn (2013), Rising Angels Fates: Allegiance (2017)
IRC Nick: souten
Contact:

Re: Continuous shake effect?

#2 Post by fioricca »


User avatar
teacup
Holder of Tasty Drinks
Posts: 911
Joined: Thu Oct 15, 2009 12:25 pm
Completed: (P)lanets - the life of normalcy has ended
Projects: Circum[N]avigate
Contact:

Re: Continuous shake effect?

#3 Post by teacup »

<.< I've already looked at that. It doesn't answer my question though (or if it does, I guess I'm just blind and I don't see it?)
Image

User avatar
Camille
Eileen-Class Veteran
Posts: 1227
Joined: Sat Apr 23, 2011 2:43 pm
Completed: Please see http://trash.moe
Projects: the head well lost
Organization: L3
Tumblr: narihira
Deviantart: crownwaltz
itch: lore
Contact:

Re: Continuous shake effect?

#4 Post by Camille »

If you apply the shake effect to the background/image itself, it should work? It would instead be

Code: Select all

show c1 at Shake((0.5, 1.0, 0.5, 1.0), 1.0, dist=5)

User avatar
Alex
Lemma-Class Veteran
Posts: 3094
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Continuous shake effect?

#5 Post by Alex »

The answer is - ATL, 'cause ATL transforms do not interupt game flow.
You can try smth like:

Code: Select all

init:
    transform my_shake:
        linear 0.1 xoffset -2 yoffset 2 
        linear 0.1 xoffset 3 yoffset -3 
        linear 0.1 xoffset 2 yoffset -2
        linear 0.1 xoffset -3 yoffset 3
        linear 0.1 xoffset 0 yoffset 0
        repeat
label start:
    scene bg at my_shake
    "Looks like BG is shaking..."
    "..."

User avatar
teacup
Holder of Tasty Drinks
Posts: 911
Joined: Thu Oct 15, 2009 12:25 pm
Completed: (P)lanets - the life of normalcy has ended
Projects: Circum[N]avigate
Contact:

Re: Continuous shake effect?

#6 Post by teacup »

@Camille
That actually did the same thing as before. I guess 'with shake' and 'at shake' are the same thing :p
@Alex
Sweet, this worked :D Thank you sir!
Image

User avatar
Camille
Eileen-Class Veteran
Posts: 1227
Joined: Sat Apr 23, 2011 2:43 pm
Completed: Please see http://trash.moe
Projects: the head well lost
Organization: L3
Tumblr: narihira
Deviantart: crownwaltz
itch: lore
Contact:

Re: Continuous shake effect?

#7 Post by Camille »

teacup wrote:@Camille
That actually did the same thing as before. I guess 'with shake' and 'at shake' are the same thing :p
@Alex
Sweet, this worked :D Thank you sir!
That's strange, because I use that exact same code in my own VN (for an explosion) and it works fine for me. ^^; I'm glad you got something to work for you, though!

017Bluefield
Regular
Posts: 93
Joined: Mon Dec 30, 2013 1:55 am
Projects: Project Bluefield - Origins
Organization: Autumn Rain
Deviantart: playerzero17
itch: autumn-rain
Contact:

Re: Continuous shake effect?

#8 Post by 017Bluefield »

Tried this...
Alex wrote: Tue May 31, 2011 2:28 pm The answer is - ATL, 'cause ATL transforms do not interupt game flow.
You can try smth like:

Code: Select all

init:
    transform my_shake:
        linear 0.1 xoffset -2 yoffset 2 
        linear 0.1 xoffset 3 yoffset -3 
        linear 0.1 xoffset 2 yoffset -2
        linear 0.1 xoffset -3 yoffset 3
        linear 0.1 xoffset 0 yoffset 0
        repeat
label start:
    scene bg at my_shake
    "Looks like BG is shaking..."
    "..."
..but it kept giving me an error that there was no "comma or end of line" at the return line.

User avatar
Alex
Lemma-Class Veteran
Posts: 3094
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: [Solved!] Continuous shake effect?

#9 Post by Alex »

Hm, show the actual code you use, 'cause this code gave me no errors.

017Bluefield
Regular
Posts: 93
Joined: Mon Dec 30, 2013 1:55 am
Projects: Project Bluefield - Origins
Organization: Autumn Rain
Deviantart: playerzero17
itch: autumn-rain
Contact:

Re: [Solved!] Continuous shake effect?

#10 Post by 017Bluefield »

Wait--I just noticed the repeat line. I thought that said return.

017Bluefield
Regular
Posts: 93
Joined: Mon Dec 30, 2013 1:55 am
Projects: Project Bluefield - Origins
Organization: Autumn Rain
Deviantart: playerzero17
itch: autumn-rain
Contact:

Re: [Solved!] Continuous shake effect?

#11 Post by 017Bluefield »

Okay, so I got it to work, even though I had to stitch an init: block onto the beginning of the script file.

So, that raises two questions:
  1. Is there a smoother way of organizing the init and the defines together if they're going to all be in the beginning of the file?
  2. How do I get the shaking to stop/last a second or so before stopping?

kivik
Miko-Class Veteran
Posts: 786
Joined: Fri Jun 24, 2016 5:58 pm
Contact:

Re: [Solved!] Continuous shake effect?

#12 Post by kivik »

1. not sure what you mean by that? You can just put them at the start of the file if you want, or at the end, long as they're outside labels. You can even create a separate .rpy file and put all your init and defines in there.

2. I don't see how pausing a second would be noticeable by your players - considering everything else will continue happening so the pause won't be perceivable.

If you meant you want it to shake, then pause for a second, before shaking again on repeat then you put a pause 1.0 above the repeat statement.

017Bluefield
Regular
Posts: 93
Joined: Mon Dec 30, 2013 1:55 am
Projects: Project Bluefield - Origins
Organization: Autumn Rain
Deviantart: playerzero17
itch: autumn-rain
Contact:

Re: [Solved!] Continuous shake effect?

#13 Post by 017Bluefield »

For 1.: Huh, I see. Maybe I'll try that. I dunno, putting in an init block just felt really clumsy, at least to me.

For 2.: Well, I was asking more about stopping the shaking, because once I called it, it wouldn't stop. Let me guess, though: I have to call scene already_shaken_room at center?

kivik
Miko-Class Veteran
Posts: 786
Joined: Fri Jun 24, 2016 5:58 pm
Contact:

Re: [Solved!] Continuous shake effect?

#14 Post by kivik »

If you want to stop the shaking, then try ditching the repeat line first (that's what makes it continuous), but you'll probably find it too short then - then you can ask it to repeat a fixed number of times - try repeat 2, repeat 5, repeat 10, until you're happy with the result :)

017Bluefield
Regular
Posts: 93
Joined: Mon Dec 30, 2013 1:55 am
Projects: Project Bluefield - Origins
Organization: Autumn Rain
Deviantart: playerzero17
itch: autumn-rain
Contact:

Re: [Solved!] Continuous shake effect?

#15 Post by 017Bluefield »

kivik wrote: Fri May 04, 2018 5:04 am If you want to stop the shaking, then try ditching the repeat line first (that's what makes it continuous), but you'll probably find it too short then - then you can ask it to repeat a fixed number of times - try repeat 2, repeat 5, repeat 10, until you're happy with the result :)
Ah, okay.

One last thing, about the empty screen behind the scene image during the shake: can I hide it by making the scene image bigger?

Post Reply

Who is online

Users browsing this forum: No registered users