[Modding Help] - How To Create "Walkthrough Mod's" for Ren'Py Games?

Funerals

New Member
Oct 24, 2019
12
10
The title pretty much explains it all, looking for a step in the direction of creating walkthrough mods, like someone such as Scrappy.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,256
15,041
The title pretty much explains it all, looking for a step in the direction of creating walkthrough mods, like someone such as Scrappy.
It totally depend of how you want the walkthrough to look, how you want the mod to act, how much time you have to do this, and if you're ready to repeat your works with every update released (unless it's for already finished games).

One way can be to use the to dynamically add indication to the menu :
Code:
init python:
    def myCB( text ):
         if text == "this":
              if sex_point <= 6: 
                   return "this {color=#F00}(follow to increase your low sex_points){/color}"
             else:
                   return "this {color=#F00}(You've enough sex_points, you can safely chose the other option){/color}"
         return text

    config.say_menu_text_filter = myCB
But there's a risk that more than one menu entry will have the same content, and so you'll be confused, not knowing which one it is. Therefore, you need to either know in which line/file you are. For this you can use by example
Code:
init python:
    def myCB( text ):
         file, line = renpy.get_filename_line()
         if text == "this":
            if file.endswith( "char_thisGirl.rpy" ):
                  if sex_point <= 6: 
                       return "this {color=#F00}(follow to increase your low sex_points){/color}"
                 else:
                       return "this {color=#F00}(You've enough sex_points, you can safely chose the other option){/color}"
            elif file.endswith( "char_thatGirl.rpy" ):
                  if girl_relation <= 42: return "this {color=#F00}(Warning, your relation is really low, chose this){/color}"
         return text

    config.say_menu_text_filter = myCB
You can also use to have a better view and know precisely in which label you are.
Code:
init python:

    def lblCB( lName=None, abnormal=False ):
            ( f, l ) = renpy.get_filename_line()
            if renpy.get_filename_line()[0].startswith( 'renpy' ): return( lName, abnormal )
            labelsStack.update( { str( renpy.call_stack_depth() ): lName } )
        return( lName, abnormal )

    config.label_callback = lblCB

    def currentLabel():
        try:
            return labelsStack[str( renpy.call_stack_depth() )]  
        except:
            return "UNKNEW LABEL"

    def myCB( text ):
         if text == "this":
            if currentLabel() == "thisGirl_event1":
                  if sex_point <= 6: 
                       return "this {color=#F00}(follow to increase your low sex_points){/color}"
                 else:
                       return "this {color=#F00}(You've enough sex_points, you can safely chose the other option){/color}"
            elif currentLabel() == "thatGirl_event7":
                  if girl_relation <= 42: return "this {color=#F00}(Warning, your relation is really low, chose this){/color}"
         return text

    config.say_menu_text_filter = myCB

defaut labelsStack = {}

Or you can just edit the source code and directly change the menus. But you'll have to do that every time an update is released, and to do it manually, to be sure that you'll not revert a change made by the author.