(Solved) Alternative to renpy.pause for Screens?

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
SypherZent
Veteran
Posts: 269
Joined: Fri Sep 02, 2016 3:14 am
Completed: Multiverse Heroes, Space Hamster in Turmoil
Projects: Working on WWTDAA
Soundcloud: Chrysopoeist
Location: Puerto Rico
Contact:

(Solved) Alternative to renpy.pause for Screens?

#1 Post by SypherZent » Thu Feb 02, 2017 10:32 pm

Hello,

Up until now when I have had to prevent user interaction I have used the following:

Code: Select all

# In scripts.rpy
    $ renpy.pause(time, hard=True)

At the moment, I require this functionality in a screen.
When I use Jump to label, in order to call $ renpy.pause from the scripts.rpy, it erases my screens.
I need the screens to stay open, but I also need to prevent user interaction for a time period.

Is there a way to achieve this? Have been searching for a few hours.


Thanks.
Last edited by SypherZent on Fri Feb 03, 2017 4:53 pm, edited 1 time in total.

User avatar
IrinaLazareva
Veteran
Posts: 372
Joined: Wed Jun 08, 2016 1:49 pm
Projects: Legacy
Organization: IKG
Location: St.Petersburg, Russia
Contact:

Re: Alternative to renpy.pause for Screens?

#2 Post by IrinaLazareva » Fri Feb 03, 2017 8:26 am

For example, add to the screen the invisible button (on all game screen) with NullAction()

Code: Select all

screen death():
    #<code of screen>
    button:
        xysize(1024, 768)          #! the width and height of the game screen
        background "#0000"
        action NullAction()    
    key "mouseup_3" action NullAction()    # right button mouse off, by analogy you can dissable any buttons
There is a light at the end of the tunnel, just pray it's not a train.
___
TODO: unresolved/нерешённое

User avatar
SypherZent
Veteran
Posts: 269
Joined: Fri Sep 02, 2016 3:14 am
Completed: Multiverse Heroes, Space Hamster in Turmoil
Projects: Working on WWTDAA
Soundcloud: Chrysopoeist
Location: Puerto Rico
Contact:

Re: Alternative to renpy.pause for Screens?

#3 Post by SypherZent » Fri Feb 03, 2017 4:45 pm

What a great trick! Okay, now my only issue.

How do I *wait* a time period and then remove that screen?
Currently, the screen draws all and the sprites are performing the transform.
I don't have a trigger that says "ok I arrived". I am unsure I can detect a transform's completion.

This is the final hurdle so I can begin 4x AI logic.
I need the user to wait for all enemy units to move to their respective locations between turns.

So I just need:
1) Block user input (THANKS WOOT!)
2) Allow user input after Time=X (Currently, I don't know how to do this -> from a screen <-)

User avatar
xela
Lemma-Class Veteran
Posts: 2481
Joined: Sun Sep 18, 2011 10:13 am
Contact:

Re: Alternative to renpy.pause for Screens?

#4 Post by xela » Fri Feb 03, 2017 4:50 pm

Use onscreen timer to hide the screen. It's in the docs.
Like what we're doing? Support us at:
Image

User avatar
SypherZent
Veteran
Posts: 269
Joined: Fri Sep 02, 2016 3:14 am
Completed: Multiverse Heroes, Space Hamster in Turmoil
Projects: Working on WWTDAA
Soundcloud: Chrysopoeist
Location: Puerto Rico
Contact:

Re: Alternative to renpy.pause for Screens?

#5 Post by SypherZent » Fri Feb 03, 2017 4:52 pm

Found it!

"onscreen timer" were just the keywords I needed.
Thanks, xela!

Post Reply

Who is online

Users browsing this forum: Google [Bot]