Difference between with Pause(2.0) and $renpy.pause(2.0) ?

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
qirien
Miko-Class Veteran
Posts: 541
Joined: Thu Jul 31, 2003 10:06 pm
Organization: Metasepia Games
Deviantart: qirien
Github: qirien
itch: qirien
Location: New Mexico, USA
Discord: qirien
Contact:

Difference between with Pause(2.0) and $renpy.pause(2.0) ?

#1 Post by qirien »

Hey, I'm working on the credits, and want each text item to be shown for a few seconds before fading away and being replaced by the next item.

I thought I could use the transition Pause (as in "Example 2" below), but this doesn't pause at all, just zips past to the end. $renpy.pause(2) seems to work, but am I missing something about how the Pause transition is supposed to work?

Code: Select all

    "Credits"
    scene black with dissolve
    show text "Example 1" with dissolve
    $renpy.pause(2.0)  #works fine
    scene black with dissolve
    show text "Example 2" with dissolve
    with Pause(2.0) #doesn't pause at all, goes straight to the next thing.
    scene black with dissolve
    "End Credits"
Last edited by qirien on Mon Dec 09, 2013 12:20 am, edited 1 time in total.
Finished games:
Image
Image
Image

User avatar
chris3spice
Regular
Posts: 44
Joined: Wed Nov 20, 2013 12:39 am
Projects: BKA24
Location: Kansas
Contact:

Re: Difference between with Pause(2) and $renpy.pause(2.0) ?

#2 Post by chris3spice »

Did you try it without the .0 on the end, not sure if the pause function supports floats, it'll work in renpy.pause but not sure if it makes a difference with the transitional pause or not... I'm stumped beyond that

Actually I just tried "with pause" and it wouldn't work for me either, I know it used to and I have it setup exactly like in the documentation so I don't know what is going on.

User avatar
nyaatrap
Crawling Chaos
Posts: 1824
Joined: Mon Feb 13, 2012 5:37 am
Location: Kimashi Tower, Japan
Contact:

Re: Difference between with Pause(2) and $renpy.pause(2.0) ?

#3 Post by nyaatrap »

An equivalent of renpy.pause() is pause, not a Pause() transition.
Though with Pause(2.0) just works fine to me. I think the difference between them is, 2 transtions (Dissolve and Pause) are skipped by one click, unlike the pause statement.

User avatar
xavimat
Eileen-Class Veteran
Posts: 1461
Joined: Sat Feb 25, 2012 8:45 pm
Completed: Yeshua, Jesus Life, Cops&Robbers
Projects: Fear&Love
Organization: Pilgrim Creations
Github: xavi-mat
itch: pilgrimcreations
Location: Spain
Discord: xavimat
Contact:

Re: Difference between with Pause(2.0) and $renpy.pause(2.0)

#4 Post by xavimat »

- Pause() is a Transition used with the statement 'with' and applies to displayables
- pause is an statement and is used to pause the game
- renpy.pause() is a python function equivalent to the 'pause' statement to be used inside a python block, where the renpy-statements can't be used. It has also more functionalities that the simple 'pause' (see the doc: http://www.renpy.org/doc/html/other.html#renpy.pause)

The 'with' statement applies to a displayable shown before (using 'scene' or 'show').
In your code, the line "with Pause(2.0)" comes after a 'show' that has its own 'with' on it. Then it has no displayable to be applied to and it does nothing.

You can use:

Code: Select all

pause 2.0
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)

User avatar
qirien
Miko-Class Veteran
Posts: 541
Joined: Thu Jul 31, 2003 10:06 pm
Organization: Metasepia Games
Deviantart: qirien
Github: qirien
itch: qirien
Location: New Mexico, USA
Discord: qirien
Contact:

Re: Difference between with Pause(2.0) and $renpy.pause(2.0)

#5 Post by qirien »

Oh, I thought you could use more than one with statement with a displayable...
So, I tried it with "with Pause" as the only transition, but it still doesn't seem to do anything:

Code: Select all

    "Credits"
    scene black with dissolve
    show text "Example 1" with dissolve
    $renpy.pause(2.0)  #works fine
    scene black with dissolve
    show text "Example 2" with Pause(2.0) #still doesn't pause at all
    scene black with dissolve
    "End Credits"
So, what does the with Pause transition do, if it doesn't show an image for a certain amount of time?
Finished games:
Image
Image
Image

SundownKid
Lemma-Class Veteran
Posts: 2299
Joined: Mon Feb 06, 2012 9:50 pm
Completed: Icebound, Selenon Rising Ep. 1-2
Projects: Selenon Rising Ep. 3-4
Organization: Fastermind Games
Deviantart: sundownkid
Location: NYC
Contact:

Re: Difference between with Pause(2.0) and $renpy.pause(2.0)

#6 Post by SundownKid »

I'm pretty sure you have to put it on a new line for it to work.

User avatar
xavimat
Eileen-Class Veteran
Posts: 1461
Joined: Sat Feb 25, 2012 8:45 pm
Completed: Yeshua, Jesus Life, Cops&Robbers
Projects: Fear&Love
Organization: Pilgrim Creations
Github: xavi-mat
itch: pilgrimcreations
Location: Spain
Discord: xavimat
Contact:

Re: Difference between with Pause(2.0) and $renpy.pause(2.0)

#7 Post by xavimat »

'Pause()' is not a Transition, as I have said, is a Class that returns a transition. The documentation says:
http://www.renpy.org/doc/html/transitions.html#Pause : Pause(delay). Returns a transition that only displays the new screen for delay seconds. It can be useful as part of a MultipleTransition.

If I understand correctly, you don't want to apply two transitions here but simply need a pause. You can do this:

Code: Select all

    "Credits"
    scene black with dissolve
    show text "Example 1" with dissolve
    pause 2.0
    scene black with dissolve
    show text "Example 2" with dissolve
    pause 2.0
    scene black with dissolve
    "End Credits"
As Sundownkid says, the 'pause' statement is used in a new line.
That code does the same than this one (if you don't want to change the scene):

Code: Select all

    "Credits"
    scene black with dissolve
    show text "Example 1" with dissolve
    pause 2.0
    hide text with dissolve
    show text "Example 2" with dissolve
    pause 2.0
    hide text with dissolve
    "End Credits"
If you want to force the user to wait the 2 seconds (I wouldn't do it, it's user-unfriendly!), you can use hard pauses:

Code: Select all

    "Credits"
    scene black with dissolve
    show text "Example 1" with dissolve
    $ renpy.pause(2.0, hard=True)
    hide text with dissolve
    show text "Example 2" with dissolve
    $ renpy.pause(2.0, hard=True)
    hide text with dissolve
    "End Credits"
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)

User avatar
qirien
Miko-Class Veteran
Posts: 541
Joined: Thu Jul 31, 2003 10:06 pm
Organization: Metasepia Games
Deviantart: qirien
Github: qirien
itch: qirien
Location: New Mexico, USA
Discord: qirien
Contact:

Re: Difference between with Pause(2.0) and $renpy.pause(2.0)

#8 Post by qirien »

OK, it turns out the "with Pause" actually works just fine; I just forgot I had my transitions setting set to "None". :oops: BUT, now the difference between the two is clear. "with Pause" is a transition, so it will get skipped if the user has transitions off. pause(2.0, hard) will pause no matter what (which could be annoying if overused, I imagine). So, I appreciate everyone's help, and sorry to make such a fuss over my own carelessness! :roll:
Finished games:
Image
Image
Image

Post Reply

Who is online

Users browsing this forum: Google [Bot]