Delaying a function

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
Lezalith
Regular
Posts: 82
Joined: Mon Dec 21, 2015 6:45 pm
Contact:

Delaying a function

#1 Post by Lezalith »

Hey everyone, I hope you're having a lovely morning/afternoon/evening.

I have two screens. teaching_done_morning and teaching_done_afternoon. While transitioning between those two, stuff changes too quickly. You can actually see the changes take place before the transition between the two screens is finished.

I thought I could delay part of the function that calls the second screen.

Code: Select all

    def delayedStuff():
        renpy.transition(fade)
        renpy.show_screen("teaching_done_afternoon")
        # Delay needed here, so ^ this can finish transitioning, and after the transition is done, those other two screen bellow show. #
        if InTeachingMorning == "Jack" or InTeachingMorning == "Suzy" or InTeachingMorning == "Daniel" or InTeachingMorning == "Lily" or InTeachingMorning == "Erik":
            renpy.show_screen("afternoonBarCompanion")
            renpy.show_screen("teachingSketchesAfternoon")
        else:
            renpy.show_screen("afternoonBarNormal")
            renpy.show_screen("teachingSketchesAfternoon")
However, I have no idea how I'd do that. I tried renpy.pause and time.sleep, neither worked though.
renpy.pause doesn't see to have effect at all, time.sleep pauses the whole program instead of just the function.

I know delaying stuff is complicated.
Is there a Renpy function that could check if the transition has finished, and then I could call the rest of the stuff?

Post Reply

Who is online

Users browsing this forum: Google [Bot]