• To improve security, we will soon start forcing password resets for any account that uses a weak password on the next login. If you have a weak password or a defunct email, please update it now to prevent future disruption.

Making patches for games

ZLZK

Member
Modder
Jul 2, 2017
274
575
Firstly, because it literally hijack Ren'Py mid-process.
With config.label_overrides, Ren'Py is told to branch to a label, and before doing this it will look if there's a redirection defined. But here, Ren'Py will be already entering into the label when you'll order him to go to another label. It will break nothing, but it's not clean at all.
config.label_overrides happens before config.label_callback.
So it's redirected before, and with renpy.jump inside callback, it's redirected after as well.

What "jump" ? The statement or the python equivalent ? And what don't works with it ?
Never mind, abnormal argument was blocking jump.

And that's all. There's no "pre_label" or whatever.
That was just me making things up, since I didn't look into code.


Taking above into account, this makes config.label_overrides to work with labels without explicit jump.
Python:
init 1699 python hide:

    def new_label_callback(label, abnormal):
        if not abnormal:
            renpy.jump(label)
          
    if config.label_callback:
        old_label_callback = config.label_callback
      
        def chained_label_callback(label, abnormal):
            old_label_callback(label, abnormal)
            new_label_callback(label, abnormal)
          
        config.label_callback = chained_label_callback
    else:
        config.label_callback = new_label_callback
 
Last edited:

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,202
14,944
config.label_overrides happens before config.label_callback.
So it's redirected before, and with renpy.jump inside callback, it's redirected after as well.
What doesn't matters since the callback is precisely here for the cases that can not be covered by config.label_overrides. In the same time, if what you want is only to redirect the flow, or if your mod provide a variety of range, you will benefit from the possible redirection over the destination label.


Taking above into account, this makes config.label_overrides to work with labels without explicit jump.
What was the question asked, and answered...
 
  • Like
Reactions: simple_human