[Solved] fade transition not working as expected

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
Imperf3kt
Lemma-Class Veteran
Posts: 3791
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

[Solved] fade transition not working as expected

#1 Post by Imperf3kt »

I suspect, just like the wait tag and screen scaling, this error may be my computer.
None the less, I am unable to check at the moment, so I was wondering if anyone can explain this for me.

When I use this, everything works:

Code: Select all

    show kitchen with fade
However, I want the fade to take a bit longer, so I use this:

Code: Select all

    show kitchen with Fade(1.0)
And I get the following error:

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 84, in script
    show kitchen with Fade(1.0)
TypeError: Fade() takes at least 3 arguments (3 given)

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "game/script.rpy", line 84, in script
    show kitchen with Fade(1.0)
  File "C:\Program Files (x86)\renpy\renpy-6.99.14-sdk\renpy\ast.py", line 1337, in execute
    renpy.exports.with_statement(trans, paired)
  File "C:\Program Files (x86)\renpy\renpy-6.99.14-sdk\renpy\exports.py", line 1413, in with_statement
    return renpy.game.interface.do_with(trans, paired, clear=clear)
  File "C:\Program Files (x86)\renpy\renpy-6.99.14-sdk\renpy\display\core.py", line 2193, in do_with
    clear=clear)
  File "C:\Program Files (x86)\renpy\renpy-6.99.14-sdk\renpy\display\core.py", line 2635, in interact
    repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, **kwargs)
  File "C:\Program Files (x86)\renpy\renpy-6.99.14-sdk\renpy\display\core.py", line 2972, in interact_core
    new_widget=layers_root)
  File "C:\Program Files (x86)\renpy\renpy-6.99.14-sdk\renpy\curry.py", line 38, in __call__
    **dict(self.kwargs.items() + kwargs.items()))
TypeError: Fade() takes at least 3 arguments (3 given)

Windows-7-6.1.7601-SP1
Ren'Py 6.99.14.2.3327
Cooking with RWBY 0.06
Tue Mar 27 19:30:51 2018
Anybody able to explain what is happening? I don't recall this ever happening before.
Dissolve(1.0) works fine, but that leaves the say window on screen and I want it to fade as well, hence why I wanted to use fade.

I am using a 9:16 resolution, and think that may be causing some of the issues I have seen with this project in particular.
Last edited by Imperf3kt on Tue Mar 27, 2018 6:50 am, edited 1 time in total.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
korova
Veteran
Posts: 217
Joined: Sat Jun 27, 2009 5:15 pm
Completed: Ivy, Chocolate, Time, Clair Obscur
Projects: Writing exercises, The House [Nano18]
Tumblr: korova08
itch: korova
Location: Normandie, France
Contact:

Re: fade transition not working as expected

#2 Post by korova »

Code: Select all

TypeError: Fade() takes at least 3 arguments (3 given)
As stated in the error message, Fade() needs 3 arguments, so 1 is not enough
(I remember having the same problem the first time I tried to define my own fades...)

See documentation https://www.renpy.org/doc/html/transitions.html#Fade
Fade(out_time, hold_time, in_time, color="#000")

Returns a transition that takes out_time seconds to fade to a screen filled with color, holds at that screen for hold_time seconds, and then takes in_time to fade to then new screen.

# Fade to black and back.
define fade = Fade(0.5, 0.0, 0.5)

# Hold at black for a bit.
define fadehold = Fade(0.5, 1.0, 0.5)

# Camera flash - quickly fades to white, then back to the scene.
define flash = Fade(0.1, 0.0, 0.5, color="#fff")

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

Re: fade transition not working as expected

#3 Post by Imperf3kt »

I've used both fade and Fade(1.0) in the past with no issue though. I think. Not so sure anymore.
The error message states "3 given", so I thought the arguments were all there in some default for Fade

Anyway, that definitely works now. Thanks.
I was looking at the wrong part of the documentation without realising it:
file:///C:/Program%20Files%20(x86)/renpy/renpy-6.99.14-sdk/doc/transitions.html?#var-fade
fade
Takes 0.5 seconds to fade to black, and then 0.5 seconds to fade to the new screen. An instance of the Fade() transition class.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

Post Reply

Who is online

Users browsing this forum: Google [Bot]