[solved] Screen that is hidden the first 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
User avatar
Harimak
Newbie
Posts: 9
Joined: Tue Sep 08, 2020 12:14 am
Deviantart: KimisuCandy
Contact:

[solved] Screen that is hidden the first time?

#1 Post by Harimak » Tue Sep 29, 2020 10:35 pm

Hi, how are you? I have a question, I hope you can answer me.

At the beginning of the game I want there to be a screen that "forces" the player to play the prologue.
Then select the route.
BUT
After playing the first time, when you start the game again [on another occasion], s/he is not forced to play the prologue. Instead, s/he can directly choose the route.
Image

I tried to use:

Code: Select all

 $ prologue = okay/no 
But I can't use them properly, or maybe there is another function, I'm new to this. ;v;)??
Last edited by Harimak on Thu Oct 01, 2020 3:47 pm, edited 1 time in total.

User avatar
hell_oh_world
Miko-Class Veteran
Posts: 777
Joined: Fri Jul 12, 2019 5:21 am
Projects: The Button Man
Organization: NILA
Github: hell-oh-world
Location: Philippines
Contact:

Re: Screen that is hidden the first time?

#2 Post by hell_oh_world » Wed Sep 30, 2020 2:00 am

Have you looked on persistent variables? https://www.renpy.org/doc/html/persiste ... en%20renpy.

Code: Select all

default persistent.played_already = False

label start:
  if not persistent.played_already:
    call prologue
    
  call screen route_chooser
  
label prologue:
  $ persistent.played_already = True
  return

User avatar
Harimak
Newbie
Posts: 9
Joined: Tue Sep 08, 2020 12:14 am
Deviantart: KimisuCandy
Contact:

Re: Screen that is hidden the first time?

#3 Post by Harimak » Wed Sep 30, 2020 1:20 pm

hell_oh_world wrote:
Wed Sep 30, 2020 2:00 am
Have you looked on persistent variables? https://www.renpy.org/doc/html/persiste ... en%20renpy.

Code: Select all

default persistent.played_already = False

label start:
  if not persistent.played_already:
    call prologue
    
  call screen route_chooser
  
label prologue:
  $ persistent.played_already = True
  return
It has worked for me, thank you very much. I did not know this type of variables :)!!

Post Reply

Who is online

Users browsing this forum: Bing [Bot]