Trouble Creating Custom Forced-Pause Transition [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
MasterLillyclaw
Newbie
Posts: 7
Joined: Sun Jul 16, 2017 9:00 pm
Projects: The Crossroads Where They Connect
Contact:

Trouble Creating Custom Forced-Pause Transition [SOLVED]

#1 Post by MasterLillyclaw »

I'm trying to create custom transitions that combine my unique fade and dissolve effects for scene (not character) transitions. It's really easy to click past them, so for right now, I'm trying to put in a forced pause to make sure players don't have jarring changes.
I may end up changing it if it seems too irritating to have forced, albeit brief, transitions throughout the game, but I want to try to successfully code it for the sake of getting it right, even if I end up not using it.

Currently, I'm trying to use MultipleTransition, and this is contained in my init before the game starts:

Code: Select all

    $ slow_fade = Fade(0.6, 0.9, 0.6)
    $ pause_1 = Pause(2.0, hard=True)
    $ fadehold = MultipleTransition([False, slow_fade, True, pause_1, True])
    
    $ slow_diss = Dissolve(1.0)
    $ pause_2 = Pause(0.9, hard=True)
    $ scene_diss = MultipleTransition([False, slow_diss, True, pause_2, True])
I separated the fades / dissolves and pauses simply in order to make the MultipleTransition line easier to read, rather than having a bunch of numbers and terms jumbled into it.

That code errors (the first transition of the two called is the scene_diss) and says that 'hard' is undefined - I believe because you can't do a "hard pause" with Pause(#). However, if I change the line to

Code: Select all

    $ pause_1 = renpy.pause(2.0, hard=True)
    $ pause_2 = renpy.pause(0.9, hard=True)
it will still error, because you can't add a "displayable" during the init phase.

What I'm getting from those two facts is that you can't use a forced pause in MultipleTransition simply because renpy.pause is not allowed, and Pause(#) doesn't allow the pause to be forced. Of course, I think MultipleTransition may do the pause after the first transition anyways, so that may not be the correct way to go about it at all.

I tried doing a transform like the following:

Code: Select all

    transform fadehold(old_widget=None, new_widget=None):
        Fade(0.6, 0.9, 0.6)
        pause 2.0
    
    transform scene_dissolve(old_widget=None, new_widget=None):
        Dissolve(1.0)
        pause 0.9
This errors saying "Not a displayable: <curry <class 'renpy.display.transition.Dissolve'> (1.0,) {}>", and I figure that's because you can't just call Dissolve(1.0) without applying it to something. In the Renpy ATL page it does show a Dissolve(#) within a transform, but it's being applied to a specific image and not just hanging to attach to some unknown object.

I added the things with old_widget and new_widget because the code errors without it, saying that the parameters are unknown. If I get rid of the "=None" on them and leave them as variables, and then apply the old scene and the new scene in the transform like so

Code: Select all

    scene pc_room with scene_dissolve("black", "pc_room")
(the images are in quotes because it errors without them, saying they weren't defined) then I still end up with the same error as before saying "Not a displayable: ..."

I tried doing some stuff with init python instead of just init and defining functions, but I'm even less sure of how to do things on that than I am general ATL (this is my very first game, not only on Renpy but in general, so I'm learning everything as I go), so I'm not posting that for now.

***

So, just to clarify, I want to have a transition and a forced pause at the same time (basically, an un-skippable transition). I'm not sure if MultipleTransition is the correct way to go, because it sounds like the pause will come AFTER the skippable transition, but I'm not sure - maybe there's a way to make it work with that.
Above are the different ways I've tried to make this work, along with the errors I receive with them.
I know I could technically wire in a forced pause after each transition (or so people on the forums have said), but if I do end up keeping it, I don't want to waste that many lines of code for who knows how many transitions. I will if I have to, but I'd prefer a more efficient way, especially since my non-forced-pause transitions are custom anyways, so it would be nice to have it all wrapped up into one.

Sorry this is so long, but I hope I've covered everything and that I make sense! If you need clarification just ask, obviously.
Last edited by MasterLillyclaw on Tue Jul 18, 2017 2:49 pm, edited 1 time in total.

philat
Eileen-Class Veteran
Posts: 1909
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: Trouble Creating Custom Forced-Pause Transition

#2 Post by philat »

1. Forced pauses are terrible. ;)

2. As far as I know, there's no good way to do this. If you're very committed to it, you can hardcode in forced pauses or use an unclickable screen, etc., but that's work.

MasterLillyclaw
Newbie
Posts: 7
Joined: Sun Jul 16, 2017 9:00 pm
Projects: The Crossroads Where They Connect
Contact:

Re: Trouble Creating Custom Forced-Pause Transition

#3 Post by MasterLillyclaw »

philat wrote: 1. Forced pauses are terrible. ;)
The more I thought about forced pauses, the more I realized how irritating it would be to be put on every single transition. Imagine the horror if every time you tried to casually skip dialogue, it stopped because of a forced pause! :shock: It still feels like something that should be easier to do for the times when someone might want it (like having a cutscene be unskippable the first time you play, but changing it to skippable any other time).
philat wrote: 2. As far as I know, there's no good way to do this. If you're very committed to it, you can hardcode in forced pauses or use an unclickable screen, etc., but that's work.
The problem I found with hardcoding forced pauses in was that the transition would play, and after it finished, a forced pause would happen, which defeats the purpose, since the transition could be skipped but then there's this strange pause with nothing going on. An unclickable screen sounds like it might be a good idea if it was for something that didn't happen very often, like a game with one or two cutscenes, but it seems like too much work for sprite and background transitions.

Thank you for answering :)

User avatar
trooper6
Lemma-Class Veteran
Posts: 3712
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Re: Trouble Creating Custom Forced-Pause Transition [SOLVED]

#4 Post by trooper6 »

There are different ways to do this.

If you just want it so that the user can't skip pauses or transitions, you could try using the _dismiss_pause variable, documented here: https://www.renpy.org/doc/html/store_va ... miss_pause
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

MasterLillyclaw
Newbie
Posts: 7
Joined: Sun Jul 16, 2017 9:00 pm
Projects: The Crossroads Where They Connect
Contact:

Re: Trouble Creating Custom Forced-Pause Transition [SOLVED]

#5 Post by MasterLillyclaw »

Is there a specific place you're supposed to put that variable? It didn't say on the doc, so I just put it in my "init python" block and set it to False, but the pauses and transitions were still dismissible.

User avatar
trooper6
Lemma-Class Veteran
Posts: 3712
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Re: Trouble Creating Custom Forced-Pause Transition [SOLVED]

#6 Post by trooper6 »

About a year ago, I made a tester that uses all the different ways I could think of to stop your user from being able to interact with your game. I'm attaching a Zipped file of that tester.

Note, there is a bug in Renpy that this tester triggers, so it may not work for you without you doing a fix first...the fix, I'm sure will eventually be put in a release, but I don't think that has happened yet. So to fix the bug, Go to your renpy folder. Then the text folder. Then open the text.py file. Do a search for "unique." You will see a bit of code that looks like this:

Code: Select all

    def _duplicate(self, args):
        if self._duplicatable:
            rv = self._copy(args)
            rv.unique()

            return rv

        return self
Make it look like this:

Code: Select all

    def _duplicate(self, args):
        if self._duplicatable:
            rv = self._copy(args)
            rv._unique() ##HERE IS THE CHANGE

            return rv

        return self
Then you should be able to run the tester with no problem. I hope it teaches something about making your players unable to interact with you game. But remember what PyTom always says...that isn't very nice thing to do to your players.
Tester 2 Block Dismiss.zip
(798.73 KiB) Downloaded 39 times
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

Post Reply

Who is online

Users browsing this forum: No registered users