[SOLVED] Slideshow-effect as a scene?

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
PhZXgames
Regular
Posts: 49
Joined: Fri Oct 14, 2016 2:12 pm
Completed: Character Creation Frame
Projects: RWBY Dawnfall
Organization: PhZX Games
Skype: live:phzxgames
Location: Minnesota, USA
Contact:

[SOLVED] Slideshow-effect as a scene?

#1 Post by PhZXgames » Thu Dec 29, 2016 3:23 pm

So I want to create something like the beginning of Pokemon Mystery Dungeon (from RRT to EoS) With the little color effect. If ya'll need more explaining, it's basically a color background, and every few moments it changes to a new color without affecting the text and/or other things on screen.

I'd assume it would have something to do with ATL, but because I'm still a "Newbie" it makes zero sense to me. Could someone explain ATL in better words than the documentation?

Thanks!
Last edited by PhZXgames on Sat Dec 31, 2016 7:28 pm, edited 1 time in total.
"Don't Explode!"
-me

User avatar
IrinaLazareva
Veteran
Posts: 399
Joined: Wed Jun 08, 2016 1:49 pm
Projects: Legacy
Organization: SunShI
Location: St.Petersburg, Russia
Contact:

Re: Slideshow-effect as a scene?

#2 Post by IrinaLazareva » Sat Dec 31, 2016 6:32 pm

something like:

Code: Select all

init:
    image sldsw:
        "#445"                       #color in HEX 
        2.9                          #pause (seconds)
        "#122" with dissolve       #dissolve (or fade) transition (not necessarily)
        2.7
        "#7f7" with fade
        1.2
        repeat
        
label start:
    scene sldsw
    "You've created a new Ren'Py game."
    "Once you add a story, pictures, and music, you can release it to the world!"

    return

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3636
Joined: Mon Dec 14, 2015 5:05 am
Location: Your monitor
Contact:

Re: [SOLVED] Slideshow-effect as a scene?

#3 Post by Imperf3kt » Sat Dec 31, 2016 10:29 pm

As a further explanation for others who may be having the same issue and aren't able to fully understand the above response:

In order to use ATL, you simply need to do two things:
Define your images
Define your ATL

Step one, defining images:
You should be familiar with this by now. If you're not... you're going to need to learn how, it is a very basic and very important skill.
Generally, at the top of script.rpy, placing

Code: Select all

image cream = "<path to file, defaulting from the 'images' directory>"
will tell renpy that cream means whatever image you directed it to.

So for example:

Code: Select all

image cream = "cream.png"
define bg black = "#000000"

label start:

    bg black
    show image cream at left
    "Wow, its some cream!"
return
This essentially tells renpy to find the file "cream.png" from the "images" directory (default directory) and show it over the top of a black background. It will also show the text "Wow, it's some cream!" inside an ADV style text box.

If you wanted renpy to show a slideshow, we need step two: ATL

ATL works the same way as images, except now you're telling renpy that you want to show multiple images, at set intervals.

Lets break down the code IrinaLazareva posted, in a more beginner-friendly way.

Code: Select all

init:
    image sldsw:
        "#445"                       #color in HEX 
        2.9                          #pause (seconds)
        "#122" with dissolve       #dissolve (or fade) transition (not necessarily)
        2.7
        "#7f7" with fade
        1.2
        repeat
        
label start:
    scene sldsw
    "You've created a new Ren'Py game."
    "Once you add a story, pictures, and music, you can release it to the world!"

    return
In this statement, image sldsw: is ATL (the : makes all the difference between ATL, and general images or colors)
By indenting (4 spaces) the next line, you tell renpy that the "block" is what will define the ATL name "sldsw" that was given it.
#445 is, as stated, the color in hex code. Change this number to change the color - look up a hex chart to get an exact color's value if you need a specific color. You could replace this with "cream" to use the cream.png from the previous code example - provided you still have image cream = "cream.png" at the top of script.rpy

2.9 is, as stated, the pause length in seconds. This is how long renpy will show the first image or color for, before showing the next.
#122 with dissolve tells renpy what to show next. It could be a color, or another image. Don't forget to define the second image so renpy knows what to use.The "with dissolve" bit is called a transform, it tells renpy that you don't want the image to simply change pictures, but rather "dissolve" the new one in. You can leave this out, or choose fade instead. Look up the transitions documentation for more examples.
2.7 is the number of seconds to show the second image for.
#7f7 with fade, is again, just a color with a fade transition. It will be displayed for 1.2 seconds, as stated by the next line.
repeat, tells renpy you want it to go back to the first image, once it finishes,and keep repeating the ATL animation. You can add a variable to this as well, to define how many times to repeat, if it should stop or other things.

After this "block", remove your indentation to continue scripting your next lines.

scene sldsw is what calls the slideshow. Without it, nothing would show. It is just telling renpy to perform the actions defined in the "image sldsw" that was just above it inside the init
sldsw can be (almost) anything. You could call it "french noodle soup" if you wanted.

Now, if a player clicks during this slideshow, it'll skip it, even if it hasn't finished playing.
If you don't want that, you can add a forced pause like so. Don't overuse this feature, it can be very annoying if used arbitrarily.

Code: Select all

show sldsw
$ renpy.pause(7.8, hard=True)
"Say cheese."
Specifically the $ renpy.pause(7.8, hard=True)
The $ tells renpy to use python instead of renpy language.
renpy.pause() inserts the pause function
7.8, hard=True tells renpy you want the pause to be 7.8 seconds long and forced, so even if somebody clicks, it won't advance until the animation has played for 7.8 seconds. The number of seconds should be no more than the length you require. In this case, the length of all pauses added up so the animation plays in full at least once before a player can continue.

If you set $ renpy.pause to False, you pretty much shouldn't even insert the line. The necessary pauses are already included in the ATL.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor
Free Android GUI - Updated occasionally
Twitter
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], minyan