[SOLVED] Fast skipping stop at menu and does not resume

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
Azephir
Newbie
Posts: 8
Joined: Fri Sep 03, 2021 1:05 pm
Projects: The Alchemist - VN bara (azephir.itch.io/the-alchemist)
itch: azephir
Contact:

[SOLVED] Fast skipping stop at menu and does not resume

#1 Post by Azephir »

Hello everyone !

I'm making a debug tool for my VN. That tool will read my VN and make random choices.

For now i'm in good progress : my tool work with "normal" skipping (Ctrl or left click on skip button). But normal skipping is long, even with "define config.skip_delay=0.01".

So i try to make it work with fast skipping too ('>' or right click on skip button).

But the problem that i have is that fast skipping stop at each menu statement, even if there is "default preference.skip_after_choices = True".
The choice is made automatically with "define config.auto_choice_delay=0.01" but the fast skipping does not resume after the choice is made...

How can we toggle fast skipping for good, in order to have it resumed after menu ?
Or how can we make it not stop at menu statement ?

Thanks a lot for reading :D !
Kind regards
Last edited by Azephir on Thu Sep 23, 2021 7:25 am, edited 3 times in total.

Azephir
Newbie
Posts: 8
Joined: Fri Sep 03, 2021 1:05 pm
Projects: The Alchemist - VN bara (azephir.itch.io/the-alchemist)
itch: azephir
Contact:

Re: Fast skipping stop at menu and does not resume

#2 Post by Azephir »

After further research, i found the culprit.

It's a core fonctionality of ren'py that is called when a menu statement is encounter : the 'interact' function define in renpy\ui.py

Code: Select all

def interact(type='misc', roll_forward=None, **kwargs): # @ReservedAssignment
That fonction has that line :

Code: Select all

    if renpy.config.skipping == "fast":
        renpy.config.skipping = None
Which stop skipping if the fast skipping is currently running.

So i override an re-write the 'interact' function by this code :

Code: Select all

    def interact3(type='misc', roll_forward=None, **kwargs): # @ReservedAssignment

        if ui.stack is None:
            raise Exception("Interaction not allowed during init phase.")

        if len(ui.stack) != 1:   #WARNING : important to refer to ui.stack and not just stack
            raise Exception("ui.interact called with non-empty widget/layer stack. Did you forget a ui.close() somewhere?\nStack was " + ('\n'.join([str(item) for item in stack])))

        if ui.at_stack: #WARNING : important to refer to ui.at_stack and not just at_stack
            raise Exception("ui.interact called with non-empty at stack.")

        renpy.game.context().info._current_interact_type = type
        rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
        renpy.game.context().info._last_interact_type = type

        if renpy.exports.in_fixed_rollback() and roll_forward is not None:
            return roll_forward
        else:
            return rv
            
           ui.interact=interact3
It's the same code than in ui.py with the following modifications :
- remove the annoying lines that cause fast skipping to stop
- add a reference to ui for the "global" variable defined in ui.py (stack --> ui.stack , at_stack -->ui.at_stack)

Hope it will help someone else !

Post Reply

Who is online

Users browsing this forum: No registered users