When I left click after dialog has run out it send me to the main menu

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
crankycrypt
Newbie
Posts: 3
Joined: Wed Aug 10, 2022 1:30 am
Contact:

When I left click after dialog has run out it send me to the main menu

#1 Post by crankycrypt »

I'm sure this is a stupid question with a simple solution but I can't figure out how to fix this ANYWHERE, when the player clicks after the dialogue has stopped id like it to do nothing. (I have a button and it does what i want but when the player clicks anywhere else it does the same thing)
Attachments
start.gif

User avatar
m_from_space
Miko-Class Veteran
Posts: 956
Joined: Sun Feb 21, 2021 3:36 am
Contact:

Re: When I left click after dialog has run out it send me to the main menu

#2 Post by m_from_space »

Uhm, so what comes next in your code after the dialogue? Is it the end of the label block and your game? When your game is finished, it automatically will return to the main menu. What else is it supposed to do? You might want to provide your relevant code to get detailed help.

crankycrypt
Newbie
Posts: 3
Joined: Wed Aug 10, 2022 1:30 am
Contact:

Re: When I left click after dialog has run out it send me to the main menu

#3 Post by crankycrypt »

m_from_space wrote: Wed Aug 10, 2022 2:17 am Uhm, so what comes next in your code after the dialogue? Is it the end of the label block and your game? When your game is finished, it automatically will return to the main menu. What else is it supposed to do? You might want to provide your relevant code to get detailed help.
This is the end of my code (the button coding is the only thing that is after the dialog)
Attachments
code.PNG

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3791
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: When I left click after dialog has run out it send me to the main menu

#4 Post by Imperf3kt »

Remember that screens need to be placed outside label flow.

The reason the game ends is because you have no more dialogue after you show the screen.
Place the screen definition outside your label and just use the show screen door action you already are, but add some dialogue after that line as well.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

crankycrypt
Newbie
Posts: 3
Joined: Wed Aug 10, 2022 1:30 am
Contact:

Re: When I left click after dialog has run out it send me to the main menu

#5 Post by crankycrypt »

I don't want any dialog until after they click on the button. (it's going to be a door to the next section) if I add dialog after it'll just show more text and then the next click will go to the main menu. I only want something to happen when they click on the button, and if they click anywhere else I want nothing to happen. This is just me testing before making the actual game.

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2400
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: When I left click after dialog has run out it send me to the main menu

#6 Post by Ocelot »

Then make screen modal and add a hard pause after showing it.
< < insert Rick Cook quote here > >

User avatar
m_from_space
Miko-Class Veteran
Posts: 956
Joined: Sun Feb 21, 2021 3:36 am
Contact:

Re: When I left click after dialog has run out it send me to the main menu

#7 Post by m_from_space »

I spot several mistakes in your code:

1. Line 109 - 115 is not indented, so it's not part of any label / block. This should never be the case for elements of the normal game flow. Playing a game starts at label "start" and every dialogue line should either be part of that label or another label.

2. ShowMenu() as part of your door screen is not what you want, since that function is used for game menu screens (like preferences or the main menu). It's not useful inside an actual game. Use Show() instead!

3. If you want to force a player to interact with a screen, make it modal and call it. The game will continue, whenever you execute the function Return() inside that screen.

Suggestion:

Code: Select all

label going:
    hide nat normal
    e "there"
    show bg temp
    call screen door
    jump SOMEWHERE_ELSE
    
screen door:
    modal True
    imagebutton idle "door":
         action Show("hallway"),Hide("door"),Return()

Post Reply

Who is online

Users browsing this forum: No registered users