Page 1 of 1

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

Posted: Fri Apr 11, 2014 1:24 am
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.

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

Posted: Fri Apr 11, 2014 7:21 am
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?

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

Posted: Fri Apr 11, 2014 12:01 pm
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.

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

Posted: Sat Apr 12, 2014 10:31 am
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!