show screen all time

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
BlindDeafDunce
Newbie
Posts: 10
Joined: Sat Jun 20, 2015 5:46 pm
Contact:

show screen all time

#1 Post by BlindDeafDunce » Sat Jun 20, 2015 6:03 pm

Hello!

May be this question has been asked. But I have not found an answer.
Prompt please: Why HeroMenu try show all time?

Code: Select all

screen HeroMenu:
    $ renpy.notify("Hero Menu!")

label start:
    "Text"
    show screen HeroMenu
    return
HeroMenu_Text.jpg
Show ahead of time.
This happens even in the game menu.
HeroMenu.jpg
Show HeroMenu in game menu.
Thank you very much!

User avatar
kitsalai
Regular
Posts: 65
Joined: Wed Jan 08, 2014 11:05 pm
Projects: Imaginatum
Location: US
Contact:

Re: show screen all time

#2 Post by kitsalai » Sat Jun 20, 2015 7:06 pm


BlindDeafDunce
Newbie
Posts: 10
Joined: Sat Jun 20, 2015 5:46 pm
Contact:

Re: show screen all time

#3 Post by BlindDeafDunce » Sat Jun 20, 2015 7:46 pm

Thank you very much!

It was necessary to use: nopredict

Code: Select all

screen HeroMenu:
    $ renpy.notify("Hero Menu!")

label start:
    "Text"
    show screen HeroMenu nopredict
    return

BlindDeafDunce
Newbie
Posts: 10
Joined: Sat Jun 20, 2015 5:46 pm
Contact:

Re: show screen all time

#4 Post by BlindDeafDunce » Sat Jun 20, 2015 8:23 pm

Can you say, Why function testFunction execute all time?

Code: Select all

init python:
    def testFunction():
        renpy.notify("Hero Menu!")

screen HeroMenu:
    textbutton "test" xalign 0.5 yalign 0.5 action testFunction()

label start:
    show screen HeroMenu nopredict
    "Text"
    return
HeroMenu_Text_NewCode.jpg

User avatar
SinnyROM
Regular
Posts: 166
Joined: Mon Jul 08, 2013 12:25 am
Projects: Blue Birth
Organization: Cosmic Static Games
Contact:

Re: show screen all time

#5 Post by SinnyROM » Sat Jun 20, 2015 8:26 pm

You have testfunction() in your button, which calls it immediately. Just have the function name for the action so Ren'Py can handle the call:

Code: Select all

screen HeroMenu:
    textbutton "test" xalign 0.5 yalign 0.5 action testFunction

BlindDeafDunce
Newbie
Posts: 10
Joined: Sat Jun 20, 2015 5:46 pm
Contact:

Re: show screen all time

#6 Post by BlindDeafDunce » Sat Jun 20, 2015 8:33 pm

Thank you very much!

Post Reply

Who is online

Users browsing this forum: Ocelot