In my game The Visitor, I did something similar with a Contents page where the chapters are listed and once you completed a chapter, it becomes click-able. The way I did it was with Flags at the beginning of each chapter, and a separate menu screen.I wanted to implement story arcs and episodes. What I mean is where episodes unlocked can be selected.
First, in Script.rpy, I set up all the flags BEFORE the game began.
Code: Select all
$ ch01 = False
$ ch02 = False
$ ch03 = False
$ ch03_01 = False
$ ch03_02 = False
$ ch03_03 = False
$ ch04 = False
$ ch05 = False
label splashscreen:
$ renpy.pause(0)
scene black
with Pause(0.5)
play sound "sfx/Evil Laugh1.mp3"
Code: Select all
$ persistent.ch01 = False
Code: Select all
label chapter1:
$ ch01 = True
## ------------- scene 1 ----------------
play music "mu/zero-project - 06 - Moonlight No 2.mp3" fadeout 1.0
scene bg_castle with wiperight
with Pause(1.0)
ch_bg .png ch_ground.png ch_hover.png ch_idle.png Then, on a brand new chapter_list.rpy page, I created a chapter screen:
Code: Select all
screen chapter_list:
tag menu
# This is the background image.
add "ui/ch_bg.png"
# I'd rather not bother making navigation buttons again, so I called the navigation buttons I already had.
use navigation
imagemap:
ground "ui/ch_ground.png"
idle "ui/ch_idle.png"
hover "ui/ch_hover.png"
# Because my buttons all have transparency.
alpha False
if ch01:
hotspot (182, 133, 216, 125) action ShowMenu("chapter1") activate_sound "sfx/click.wav"
if ch02:
hotspot (187, 272, 209, 120) action ShowMenu("chapter2") activate_sound "sfx/click.wav"
if ch03:
hotspot (186, 398, 209, 122) action ShowMenu("chapter3") activate_sound "sfx/click.wav"
if ch03_01:
hotspot (152, 536, 280, 118) action ShowMenu("chapter3_01") activate_sound "sfx/click.wav"
if ch03_02:
hotspot (612, 137, 234, 124) action ShowMenu("chapter3_02") activate_sound "sfx/click.wav"
if ch03_03:
hotspot (586, 272, 286, 115) action ShowMenu("chapter3_03") activate_sound "sfx/click.wav"
if ch04:
hotspot (622, 403, 214, 115) action ShowMenu("chapter4") activate_sound "sfx/click.wav"
if ch05:
hotspot (586, 533, 286, 124) action ShowMenu("chapter5") activate_sound "sfx/click.wav"
init -2 python:
style.gm_nav_button.size_group = "gm_nav"
#For some reason, it doesn't work right if this isn't here.
Code: Select all
hotspot (537, 668, 153, 58) action ShowMenu("chapter_list") activate_sound "sfx/click.wav"