[Solved] How do you put a stop flag for the chapters list?

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
Lockvia
Regular
Posts: 124
Joined: Wed Mar 26, 2014 8:02 pm
Projects: Prank Masters
Organization: Lockvia Studios
Tumblr: lockvia
itch: lockvia
Location: Australia
Contact:

[Solved] How do you put a stop flag for the chapters list?

#1 Post by Lockvia »

I read these two forums here: http://lemmasoft.renai.us/forums/viewto ... 51&t=17301 and http://lemmasoft.renai.us/forums/viewto ... pters+page to make a chapters list. And when I replayed the chapter through the chapters list page, it doesn't stop until you finish the whole game. So I was wondering how do you would put stop flags for each chapter to bring it back to the chapters list page?

Here's my code for in script.rpy:

Code: Select all

$ persistent.ch00 = False
$ persistent.k_ch01 = False

# Character routes
init python:

    chapters = [
        ("kadin_route"),
        ("richard_route"),
        ("romeo_route"),
        ]
    
# Splash screen    
label splashscreen:
    show logo splash_screen
    with dissolve
    with Pause (2)

# Default music and sound volumes
python:
    if not persistent.set_volumes:
        persistent.set_volumes = True
        _preferences.volumes['music'] *= .70
        _preferences.volumes['sfx'] *= .80
        # You could also set 'sfx' and 'voice'.
return
        
# The game starts here.
label start:

##########
# Prologue: Ice Pack Emergency

label prologue:
    $ persistent.ch00 = True
    
    scene chp prologue
    with fade
    pause 3.0
And this is where my chapters list is from chapters.rpy:

Code: Select all

screen chapters_juliet:
    tag menu 

    # This is the background image.
    add "gui/ch_bg.jpg" 

    imagemap:
        ground "gui/ch_juliet_ground.png"
        idle "gui/ch_juliet_idle.png"
        hover "gui/ch_juliet_hover.png"

        hotspot (528, 22, 75, 74) action ShowMenu("chapters_kadin_1")
        hotspot (604, 20, 74, 78) action ShowMenu("chapters_richard_1")
        hotspot (678, 20, 77, 78) action ShowMenu("chapters_romeo_1")
        
        hotspot (519, 484, 160, 66) action Return()

        if persistent.ch00 == True:
            hotspot (27, 111, 358, 46) action ShowMenu("prologue")
        
init -2 python:
    style.gm_nav_button.size_group = "gm_nav" 
    #For some reason, it doesn't work right if this isn't here.
Last edited by Lockvia on Sat Apr 12, 2014 10:01 pm, edited 1 time in total.
Image

User avatar
saguaro
Miko-Class Veteran
Posts: 560
Joined: Sun Feb 12, 2012 9:17 am
Completed: Locked-In, Sunrise, The Censor
Organization: Lucky Special Games
itch: saguarofoo
Location: USA
Contact:

Re: How do you put a stop flag for the chapters list?

#2 Post by saguaro »

The built-in replay function does what you describe. It might be more suitable if you intend for the chapter menus to be more of a scene gallery and not a mechanism for the player to jump forward in the main script.

http://www.renpy.org/doc/html/rooms.html#replay

Can the player access the chapter menu from inside the game? Or is it only available from the game menu?

User avatar
OokamiKasumi
Eileen-Class Veteran
Posts: 1779
Joined: Thu Oct 14, 2010 3:53 am
Completed: 14 games released -- and Counting.
Organization: DarkErotica Games
Deviantart: OokamiKasumi
Location: NC, USA
Contact:

Re: How do you put a stop flag for the chapters list?

#3 Post by OokamiKasumi »

Lockvia wrote:I read these two forums here: http://lemmasoft.renai.us/forums/viewto ... 51&t=17301 and http://lemmasoft.renai.us/forums/viewto ... pters+page to make a chapters list. And when I replayed the chapter through the chapters list page, it doesn't stop until you finish the whole game. So I was wondering how do you would put stop flags for each chapter to bring it back to the chapters list page?
The chapters list was designed specifically so that you could replay the game from a certain chapter. It's not supposed to 'stop'.

A way to deal with this is by adding a 'Chapters' textbutton to the QuickMenu so the player can access the "Chapters" page at any time.

Code: Select all

        textbutton _("Chapters") action ShowMenu('chapters') 
Ivan19b.jpg
saguaro wrote:The built-in replay function does what you describe. It might be more suitable if you intend for the chapter menus to be more of a scene gallery and not a mechanism for the player to jump forward in the main script.

http://www.renpy.org/doc/html/rooms.html#replay
The chapters list will only let you access the chapters you've already played -- via flags. You can't go to a chapter you haven't played.
Ookami Kasumi ~ Purveyor of fine Smut.
Most recent Games Completed: For ALL my completed games visit: DarkErotica Games

"No amount of great animation will save a bad story." -- John Lasseter of Pixar

User avatar
Lockvia
Regular
Posts: 124
Joined: Wed Mar 26, 2014 8:02 pm
Projects: Prank Masters
Organization: Lockvia Studios
Tumblr: lockvia
itch: lockvia
Location: Australia
Contact:

Re: How do you put a stop flag for the chapters list?

#4 Post by Lockvia »

I ended up solving the problem myself yesterday and was too happy with the result I forgot to post it on here. But basically it was similar to what both of saguaro and OokamiKasumi suggested. And now it works perfectly the way I want it to. ^^ Thank you so much for your help!
Image

Post Reply

Who is online

Users browsing this forum: snotwurm