If you don't want players to be able to access the codex from the main menu, all you have to do is remove the codex button. It's super easy, in the screens.rpy file, go to the section labeled "Main Menu":
Code: Select all
##############################################################################
# Main Menu
#
# Screen that's used to display the main menu, when Ren'Py first starts
# http://www.renpy.org/doc/html/screen_special.html#main-menu
screen main_menu:
# This ensures that any other menu screen is replaced.
tag menu
# The background of the main menu.
window:
style "mm_root"
# The main menu buttons.
frame:
style_group "mm"
xalign .98
yalign .98
has vbox
textbutton _("Start Game") action Start()
textbutton _("Codex") action ShowMenu("codex")
textbutton _("CG Gallery") action ShowMenu("cg_gallery")
textbutton _("BG Gallery") action ShowMenu("bg_gallery")
textbutton _("Load Game") action ShowMenu("load")
textbutton _("Preferences") action ShowMenu("preferences")
textbutton _("Help") action Help()
textbutton _("Quit") action Quit(confirm=False)
init -2 python:
# Make all the main menu buttons be the same size.
style.mm_button.size_group = "mm"
And remove the line with the Codex button:
Code: Select all
textbutton _("Codex") action ShowMenu("codex")
Then make sure that you have the game's "quick menu" activated. You'll have a section like this at the end of the screens.rpy:
Code: Select all
##############################################################################
# Game Menu
#
# Screen that appears when the player presses the escape button.
image logo = "logo.jpg"
screen game_menu:
tag menu
add "logo"
frame:
xalign .5
yalign .33
has vbox spacing 5
textbutton _("Continue") action Return()
textbutton _("Save Game") action ShowMenu("save")
textbutton _("Load Game") action ShowMenu("load")
textbutton _("Codex") action ShowMenu("codex")
textbutton _("Preferences") action ShowMenu("preferences")
textbutton _("Main Menu") action MainMenu()
textbutton _("Help") action Help()
textbutton _("Quit") action Quit()
And then you need to activate it after label start:
Code: Select all
label start:
$ _game_menu_screen = "game_menu" # This code activates the "pause menu" in screens.rpy
This is already done by default in the Quickstart, but pasting in case you're trying to use or edit other code. These will be the sections you want to grab if that is the case.
Now, if you want the codex to only be available *after* the player has experienced a certain event, you'll need to work with persistent data. However, I don't have a lot of experience with that so far, so I'd recommend searching around the Questions thread and you should find a lot of posts about it.