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.
Completed: Eight Sweets, The Heart of Tales, [redacted] Life, Must Love Jaws, A Tune at the End of the World, Three Guys That Paint, The Journey of Ignorance, Portal 2.5.
start:
scene black
with Pause(0.2)
hide black
show transblack5
show forest behind transblack5
with Pause(0.2)
hide transblack5
show transblack4
with Pause(0.2)
hide transblack4
show transblack3
with Pause(0.2)
hide transblack3
show transblack2
with Pause(0.2)
hide transblack2
show transblack1
with Pause(0.2)
hide transblack1
#This shows a black screen for a second:
show black
with Pause(0.2)
show transblack1
with Pause(0.2)
hide transblack1
show transblack2
with Pause(0.2)
hide transblack2
show transblack3
with Pause(0.2)
hide transblack3
show transblack4
with Pause(0.2)
hide transblack4
show transblack5
with Pause(0.2)
scene forest
How do I properly define this so that I can use this same animation as a transition so I can using this multiple times throughout the visual novel?
This is how I want it to appear in the script.rpy file:
Completed: Eight Sweets, The Heart of Tales, [redacted] Life, Must Love Jaws, A Tune at the End of the World, Three Guys That Paint, The Journey of Ignorance, Portal 2.5.
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
Completed: Eight Sweets, The Heart of Tales, [redacted] Life, Must Love Jaws, A Tune at the End of the World, Three Guys That Paint, The Journey of Ignorance, Portal 2.5.
I've tried this, but the problem I have now is that the transition replaces the backgrounds with the .png files, instead of placing the .png files on top of the scenes. Any advice?
Oh, you can use the loop and linear stuff (sorry I'm not super good at this code) This is code I used to make text fade in and out, but maybe you can toy with it a bit. you would use the at so
show image at custom_transform #but the name of your transform lol
I'm pretty sure you could design what you're saying if you mess with the blocks and parallels, you can apply multiple transforms into a callable block maybe? (since you mentioned multiple images) I think you can add images to the block I'm just not 100% sure on the way you would, but the links I posted will probably have more
transform text_effect:
parallel: #The parallel statement is used to define a set of ATL blocks to execute in parallel.
block:
alpha .2 #you can use alpha 0 to 1.0 to fade images in and out
linear 1.0 alpha .9 ##linear is a wrapper that controls how the time is passed -- https://www.renpy.org/doc/html/atl.html#warpers
linear 1.0 alpha .2
repeat ## repeats, and I believe you can control how many times it repeats -- https://www.renpy.org/doc/html/atl.html#repeat-statement
Katy133 wrote: ↑Tue Aug 15, 2017 9:54 pm
I've tried this, but the problem I have now is that the transition replaces the backgrounds with the .png files, instead of placing the .png files on top of the scenes. Any advice?
you can place the animation you want under a label and call it, I did something like that with an affection indicator. I'm sorry > < I wish I had a better answer
Completed: Eight Sweets, The Heart of Tales, [redacted] Life, Must Love Jaws, A Tune at the End of the World, Three Guys That Paint, The Journey of Ignorance, Portal 2.5.
Scribbles wrote: ↑Wed Aug 16, 2017 8:40 am
you can place the animation you want under a label and call it, I did something like that with an affection indicator. I'm sorry > < I wish I had a better answer
I'm actually trying to avoid using an animated image label (see my second post from the top) because I want to replace four lines of code* for one simple transition, so that it's a lot simpler and cleaner every time I make a transition in the game.
label my_transition:
## your code with the effect you want to replicate
show customin
pause 1.2
scene forest behind customin #scene will place the image at the top layer I think, you could try show if you still have issues? show forest behind customin
show customout
return
Does that help? I may not fully understand what you want > < if you're wanting to use the same effect with several different images the only way I could think to do that is to define a function that takes strings as a parameter and then converts the strings into expressions that call the right images (but I am not 100% how to do that...... or if it would even work.) I'm not sure why your transform isn't working the way you want or why it's covering up the original image? Hopefully you can get it working
Completed: Eight Sweets, The Heart of Tales, [redacted] Life, Must Love Jaws, A Tune at the End of the World, Three Guys That Paint, The Journey of Ignorance, Portal 2.5.
Scribbles wrote: ↑Wed Aug 16, 2017 10:06 pmDoes that help? I may not fully understand what you want > < if you're wanting to use the same effect with several different images the only way I could think to do that is to define a function that takes strings as a parameter and then converts the strings into expressions that call the right images (but I am not 100% how to do that...... or if it would even work.) I'm not sure why your transform isn't working the way you want or why it's covering up the original image? Hopefully you can get it working
I'm trying to create a custom transition that visually looks the same as "customfade" (its full code is in the original post), but is a custom transition, rather than a custom image (as it's re-coded in the second post).
The trouble with the callable block is that it is not a true transition. It can only be used if I transition to a "forest" background, rather than any background. I'd have to create a different callback for each background, which would cause a lot of issues if backgrounds were added/changed.
The ATL seemed to be on the right track, but I'm having trouble overlaying the .png files on top of the first scene and then on top of the scene we're transitioning to ('old_widget' and 'new_widget').
Completed: Eight Sweets, The Heart of Tales, [redacted] Life, Must Love Jaws, A Tune at the End of the World, Three Guys That Paint, The Journey of Ignorance, Portal 2.5.
Remix wrote: ↑Thu Aug 17, 2017 6:13 pm
You might do best with a DynamicDisplayable using a function as the first parameter...
Sample code fly-typed, so might need a tweak or two
DynamicDisplayables (as far as I can find from tweaking) does not support adding 'new_widget' and 'old_widget' to it (like ATL does), so it only allows me to call it in the script.rpy as an image:
start:
scene city
"Dialogue text."
scene forest with customfade
"Dialogue text."
With the previous idea of using ATL, I have the animated .png files showing up, but I'm having trouble overlaying the .png files on top of 'old_widget' and 'new_widget' (the first scene and then the scene to transition to).