How to stop game until click a button

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
civcommander
Newbie
Posts: 6
Joined: Tue Dec 19, 2017 8:15 am
Contact:

How to stop game until click a button

#1 Post by civcommander »

Hello,

i am working several weeks with renpy and i have a stupid question:
Normally when the Player clicks the mouse the next scene or text etc. will display. I want the game to stop until a button is clicked.
I solved the problem this way:

label start:

show screen imagebutton()

scene livingroom
label 1:
"That is the livingroom"
jump 1

return

You see the game is jumping always back zu label 1, so it seems the game is stoppping. The Player have to click the imagebutton to go to the next Scene.
But that isnt the right solution or is it?
I am hoping someone can help me.

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: How to stop game until click a button

#2 Post by xavimat »

There is a difference between show screen and call screen.
- Show screen is used to show info to the player, but it does not stop the flow of the game. That screen only will disappear when you hide it with "hide screen nameofscreen"
- Call screen, instead, stops the game and waits for the screen to return something with Return() (or to jump or call to another label). If you call a screen that has only info, the game will be blocked.

Here, you need to call the screen, and can forget the label/jump workaround.

Some comments about your code:
- here in the forums, you can use the [ code][/code]tags to display code with indentation.
- don't name your screen "imagebutton", that's a reserved word.
- you don't need to put the parenthesis when showing or calling a screen (you need them when defining the screen).
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)

civcommander
Newbie
Posts: 6
Joined: Tue Dec 19, 2017 8:15 am
Contact:

Re: How to stop game until click a button

#3 Post by civcommander »

Hi xavimat!!

Thank you for your message!! It works wonderful ;-))

Post Reply

Who is online

Users browsing this forum: Bing [Bot]