Let's say I want to make a walkthrough file. When I get to a choice in the game I would like to look for the walkthrough and if it exist get the menu and the choices from there, but if it doesn't exist just continu as normal.
Do I have to do like a Try Catch or something?
Wow...
You need to hijack the whole process for the menus, with the help of
You must be registered to see the links
, look at the entries to see if the menu is in the walkthrough, possibly update the said entries, then pass all this to
You must be registered to see the links
.
Something that would more or less looks like:
Python:
init python:
def menuWT( items, *args, **kwargs ):
# Keep only the text to check if this particular menu is in the walkthrough
choices = [ t for (t, v ) in items ]
# Search the way you want, return the new menu or None.
newMenu = isInWalkthrough( choices ):
items = newMenu
# Let Ren'Py continue starting there.
return renpy.display_menu( items, *args, **kwargs )
store.menu = menuWT
But be aware that
items
is a tuple with the text of the choice
and the action to perform if the choice is selected by the player. Therefore the creation of
newMenu
will not necessarily be trivial.
This being said, I'm 80% sure that what you want isn't the complex mechanism you talked about, but something that looks like
that.