How to show what chapter the player is on?

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
Pink_Juicy
Newbie
Posts: 20
Joined: Tue Feb 09, 2021 4:09 pm
Projects: Satirical Dating Simulators...
IRC Nick: Offset
Contact:

How to show what chapter the player is on?

#1 Post by Pink_Juicy » Sat Apr 24, 2021 1:10 pm

This is actually for my friend, xe wants to make a GUI sort of thing that shows what chapter the player is on. Like in the top left corner, it can say "Prologue" or "Chapter 1". I saw that they had done "show image" each time they wanted to state which chapter the player was on and it seemed like a hassle (sorry I can't explain it very well), but I just wanna make it simpler for my friend.

User avatar
emz911
Regular
Posts: 103
Joined: Fri Jun 23, 2017 2:23 pm
Contact:

Re: How to show what chapter the player is on?

#2 Post by emz911 » Sat Apr 24, 2021 4:11 pm

You can create a screen for this:

Code: Select all

screen chapter_name():
     text “[variable_name]” xpos 10 ypos 10
And update the variable in your label whenever the chapter name changes:

Code: Select all

$ variable_name = “Chapter 1”
This way all you have to do is show screen at start (it will stay there until hidden) and hide screen whenever needed:

Code: Select all

show screen chapter_name

User avatar
Pink_Juicy
Newbie
Posts: 20
Joined: Tue Feb 09, 2021 4:09 pm
Projects: Satirical Dating Simulators...
IRC Nick: Offset
Contact:

Re: How to show what chapter the player is on?

#3 Post by Pink_Juicy » Sat Apr 24, 2021 6:38 pm

emz911 wrote:
Sat Apr 24, 2021 4:11 pm
You can create a screen for this:

Code: Select all

screen chapter_name():
     text “[variable_name]” xpos 10 ypos 10
And update the variable in your label whenever the chapter name changes:

Code: Select all

$ variable_name = “Chapter 1”
This way all you have to do is show screen at start (it will stay there until hidden) and hide screen whenever needed:

Code: Select all

show screen chapter_name
omg!! Thank you I'll show this to my friend!!

Post Reply

Who is online

Users browsing this forum: No registered users