How can i "make it rain" in renpy??? [SOLVED]

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
mrptv
Newbie
Posts: 7
Joined: Sat May 01, 2010 10:24 am
Contact:

How can i "make it rain" in renpy??? [SOLVED]

#1 Post by mrptv »

Could you help me to create a code which can make it rain in the game :?: I try to chance the snow-falling code but it is a huge mistake. Please help me :!: :!:
Thanks very much
Last edited by mrptv on Mon Jul 12, 2010 10:29 am, edited 1 time in total.

User avatar
Aleema
Lemma-Class Veteran
Posts: 2677
Joined: Fri May 23, 2008 2:11 pm
Organization: happyB
Tumblr: happybackwards
Contact:

Re: How can i "make it rain" in renpy???

#2 Post by Aleema »

Some would argue that you should use a full-size animation with rain effects drawn per frame. I use the SnowBlossom generator, but it uses a lot of system resources when it's on screen (because it needs a LOT of particles to look like realistic rain). I'm not sure what other options there are, but I guess you could do it with ATL, too ... Just gotta pick one and go with it.

mrptv
Newbie
Posts: 7
Joined: Sat May 01, 2010 10:24 am
Contact:

Re: How can i "make it rain" in renpy???

#3 Post by mrptv »

Thanks for your advice and could you show me how to. i use snowblossom generator and it look like rock is falling from the sky

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

Re: How can i "make it rain" in renpy???

#4 Post by Alex »

I think, everything depends on what "kind" of rain you need for your game.
I am not an artist, so just IMHO...
If you need more cartoonish rain - you could use "SnowBlossom", just set the amount of raindrops about 50 or 70 and increase its speed to 500 - 700. Also, to make your rain more natural, you can make several layers of rain with different size of raindrops (the far rain falls - the smaller every drop), different speed and amount. You can play with the shape of raindrops - apart of snowflakes, which falls slower and looks like small balls, we see rain as "lines" of water, so make them long and narrow.
If you need more natural rain - its better to draw it fullscreen size (lines of rain and transparent space between them) and then show it over your background. If you want to make it move, then draw several not-so-different "rains" and make an animation.
http://www.renpy.org/wiki/Animation
or use ATL for it

Code: Select all

init:
    image rain:
        "rain1.png"
        0.3
        "rain3.png"
        0.3
        "rain2.png"
        0.3
        repeat
label start:
    scene black
    show rain
    "It`s raining..."

Jake
Support Hero
Posts: 3826
Joined: Sat Jun 17, 2006 7:28 pm
Contact:

Re: How can i "make it rain" in renpy???

#5 Post by Jake »

If I did something like this with SnowBlossom I'd be very tempted to try putting together a few large graphics with multiple differently-sized-and-spaced rain streaks (lines, as Alex says) on and move those around with the SnowBlossom code.

A technique you often see in animation is to have a few frames of lots-of-lines that get drawn over the whole screen all the time, and then just animate a few frames of the whitish fuzz of splashes of rain hitting the tops of things. You could probably do the same thing in Ren'Py if you wanted to have a really thorough effect, by having a few full-screen rain-lines which you quickly dissolve or just animate between (can be done in an ATL image) and then an alternate version of each character sprite with the splahes over their shoulders, top of head, etc (again, an ATL animation)... then you don't have to mess around with SnowBlossom at all. For extra bonus points you could do a full-screen animation for each BG with the splashes for that as well, but it'll be the characters it'll be most noticeable on (they're closest to the points of view) so that's the more important bit.
Server error: user 'Jake' not found

mrptv
Newbie
Posts: 7
Joined: Sat May 01, 2010 10:24 am
Contact:

Re: How can i "make it rain" in renpy???

#6 Post by mrptv »

Alex wrote:I think, everything depends on what "kind" of rain you need for your game.
I am not an artist, so just IMHO...
If you need more cartoonish rain - you could use "SnowBlossom", just set the amount of raindrops about 50 or 70 and increase its speed to 500 - 700. Also, to make your rain more natural, you can make several layers of rain with different size of raindrops (the far rain falls - the smaller every drop), different speed and amount. You can play with the shape of raindrops - apart of snowflakes, which falls slower and looks like small balls, we see rain as "lines" of water, so make them long and narrow.
If you need more natural rain - its better to draw it fullscreen size (lines of rain and transparent space between them) and then show it over your background. If you want to make it move, then draw several not-so-different "rains" and make an animation.
http://www.renpy.org/wiki/Animation
or use ATL for it

Code: Select all

init:
    image rain:
        "rain1.png"
        0.3
        "rain3.png"
        0.3
        "rain2.png"
        0.3
        repeat
label start:
    scene black
    show rain
    "It`s raining..."
Thanks. I try it and i ... failed. But this help me
http://neondragonart.com/dp/tutorials/rain.htm
I just use the background with rain layer to it. But then i bump in to trouble ... again. I really want to add some lighting but then how can i make it show randomly while playing

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

Re: How can i "make it rain" in renpy???

#7 Post by Alex »

Just an example...

Code: Select all

init:
    image rev_lightning = im.Flip("lightning.png", horizontal=True)

    image rain:
  
        "rain1.png"
        0.2
        "rain3.png"
        0.2
        "rain2.png"
        0.2
        repeat
        
    image lightning:
        choice:        #weight of choice is 1
            "lightning.png"
            alpha  0.0
            0.5                 # show nothing for 0.5 seconds
        
        choice 0.1:   #weight of choice is 0.1
            "lightning.png"
            alpha  0.0
            linear 0.3 alpha  1.0
            linear 0.3 alpha  0.0
            
        choice 0.1:
            "rev_lightning"
            alpha  0.0
            linear 0.3 alpha  1.0
            linear 0.3 alpha  0.0
            
        repeat

label start:
    scene black
    show lightning
    show rain
    "It`s raining now..."
    "and you have 20%-chance to see lightning splash every 0.5 seconds"
    "(10% - lightning and 10% - reversed lightning)"
    "wait a bit..."
    "..."
Attachments
lightning.png
lightning.png (10.4 KiB) Viewed 8676 times
rain3.png
rain3.png (7.46 KiB) Viewed 8676 times
rain2.png
rain2.png (6.05 KiB) Viewed 8676 times
rain1.png
rain1.png (5.91 KiB) Viewed 8676 times

mrptv
Newbie
Posts: 7
Joined: Sat May 01, 2010 10:24 am
Contact:

Re: How can i "make it rain" in renpy???

#8 Post by mrptv »

Thanks so much for your help. i am so happy :mrgreen:

Post Reply

Who is online

Users browsing this forum: Google [Bot]