Special effect question: Heartbeat

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
User avatar
Xenovent
Newbie
Posts: 5
Joined: Thu Oct 08, 2009 4:25 pm
Projects: The Lion and the Lamb
Location: USA, East Coast
Contact:

Special effect question: Heartbeat

#1 Post by Xenovent »

I apologize in advance if this has already been addressed...I tried doing several searches but I couldn't come across what I was looking for. I also have a great reputation for being unable to find things right in front of my nose. :roll:

I'm looking to do an effect much like the one in "Katawa Shoujo", or also done plenty in "Fate Stay/Night", namely a "heartbeat effect," a quick reddening of the periphery of the screen, possibly with a little bit of zoom to emphasize the main character's level of duress or the intensity of the situation.

Any suggestions? And thanks in advance for any help you can give!
“The magic of Faërie is not an end in itself, its virtue is in its operations: among these are the satisfaction of certain primordial human desires. One of these desires is to survey the depths of space and time. Another is […] to hold communion with other living things.” - J.R.R. Tolkien

JinzouTamashii
Eileen-Class Veteran
Posts: 1686
Joined: Mon Sep 21, 2009 8:03 pm
Projects: E-mail me if you wanna rock the planet
Location: USA
Contact:

Re: Special effect question: Heartbeat

#2 Post by JinzouTamashii »

I'd like to know this too. But I know the visual part would involve a gradient transparent in the center and red at the edges and saved as a PNG.

But it's the code that would make it rhythmic is what I don't know. In fact, I would like a code like that for a shake effect every two seconds or so. Not after every few lines of dialogue but regularly.
Don't worry, we can get through it together. I didn't forget about you! I just got overwhelmed.
https://cherylitou.wordpress.com

User avatar
Xenovent
Newbie
Posts: 5
Joined: Thu Oct 08, 2009 4:25 pm
Projects: The Lion and the Lamb
Location: USA, East Coast
Contact:

Re: Special effect question: Heartbeat

#3 Post by Xenovent »

Thanks for your help!

I was able to get a basic effect by creating the gradient image, "heartbeat.png", and then just using

Code: Select all

int:
heartbeat = "heartbeat.png"

start: 
show heartbeat
play sound "se028.wav"
hide heartbeat with dissolve
The sound is a second long, which seems to fit perfectly into the natural transition of the .png

Good question about how to make that repetitive though...
“The magic of Faërie is not an end in itself, its virtue is in its operations: among these are the satisfaction of certain primordial human desires. One of these desires is to survey the depths of space and time. Another is […] to hold communion with other living things.” - J.R.R. Tolkien

JinzouTamashii
Eileen-Class Veteran
Posts: 1686
Joined: Mon Sep 21, 2009 8:03 pm
Projects: E-mail me if you wanna rock the planet
Location: USA
Contact:

Re: Special effect question: Heartbeat

#4 Post by JinzouTamashii »

I was more interested in the random shake/zoom effect on the BG, actually...
Don't worry, we can get through it together. I didn't forget about you! I just got overwhelmed.
https://cherylitou.wordpress.com

Alex

Re: Special effect question: Heartbeat

#5 Post by Alex »

I think, you can try <Animation> (to show several images in loop) and <play music> to loop your sound effect. Something like

Code: Select all

init:
    $ heartbeat = Animation("heart1.png", 0.2, "heart1.png", 0.2, "heart1.png", 0.2, Null(), 0.4)

label start:
    show expression heartbeat
    play music "se028.wav"
    "... ..."
    stop music
    hide heartbeat
http://www.renpy.org/wiki/renpy/doc/ref ... /Animation
http://www.renpy.org/wiki/renpy/doc/reference/Audio

JinzouTamashii
Eileen-Class Veteran
Posts: 1686
Joined: Mon Sep 21, 2009 8:03 pm
Projects: E-mail me if you wanna rock the planet
Location: USA
Contact:

Re: Special effect question: Heartbeat

#6 Post by JinzouTamashii »

show expression?

Is that 6.1?
Don't worry, we can get through it together. I didn't forget about you! I just got overwhelmed.
https://cherylitou.wordpress.com

Post Reply

Who is online

Users browsing this forum: bonnie_641