Ren'Py Skip Speed slider bar

iOtero

Active Member
Aug 4, 2020
925
1,460
Hi, friends

I am trying to implement a "Skip Speed slider bar".

Ren'py nullifies this change after you closed the game menu, that's why I use persistent variable,
and for it in gui.rpy I have put this:

Code:
init python:
    gui.init(1920, 1080)

    def recursive_update():
        config.skip_delay = persistent.skip_delay

    config.interact_callbacks.append(recursive_update)
And on screens.rpy, this:

Code:
   label _("Skip Speed")

   bar value FieldValue(persistent, "skip_delay", range=100, max_is_zero=False, style="bar", offset=5, step=None, action=None, force_step=False) bar_invert True
But it doesn't work, can you tell me why?

Thanks for your help.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,957
16,190
But it doesn't work, can you tell me why?
I'm pretty sure that it works, the problem is not in your code but here: " "
You're giving to the player the possibility to choose a skip delay between 0 and 100 milliseconds, when the default value is 75 milliseconds.

I don't know you, but personally I'm totally unable to make the difference between an interval of 75 milliseconds and an interval of 100 milliseconds. Those 0.025 second of difference are totally unnoticeable.
And since Ren'Py have anyway things to do between each interaction, you'll never reach 0 milliseconds and more surely something around 30 milliseconds at best. This lead to a difference of 0.045 second with the default delay, once again something not noticeable.

But anyway, why do you want to configure the speed of the skip feature ? Its goal is to advance as fast as possible, then stop advancing once it reach something new. It happen that 13 interactions/second is already pretty fast. And I assume that PyTom haven't chosen this value randomly. It's more surely a good compromise between speed and the time Ren'Py need to proceed an average interaction on an average computer ; with perhaps a bit of "don't stress the system".

If the player want to have the time to notice what happen, he have the auto-advance for this ; it's not the role of the skip feature to let him notice things.
 

iOtero

Active Member
Aug 4, 2020
925
1,460
I develop visual adventures for adults.
And I have to go through all the scenes I generate, sometimes just to see if there are any characters or not, and with the current skip it goes too fast for my eyes. That's why I want it to go slower, so I don't have to go through image by image, but something faster but not as fast as default.
So far I do it by changing the value of conf.speed_delay manually in gui.rpy in values like 200 or 300, but it's annoying, it would be more comfortable with a skip speed bar in the game, so I wouldn't have to close the game, modify the value in gui.rpy and restart the game.
I don't know if I have explained myself well.
And it doesn't work because I get this error, for what it's worth:

Code:
I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/screens.rpy", line 927, in execute
    screen preferences():
  File "game/screens.rpy", line 927, in execute
    screen preferences():
  File "game/screens.rpy", line 931, in execute
    use game_menu(_("Opciones"), scroll="viewport"):
  File "game/screens.rpy", line 542, in execute
    screen game_menu(title, scroll=None, yinitial=0.0):
  File "game/screens.rpy", line 542, in execute
    screen game_menu(title, scroll=None, yinitial=0.0):
  File "game/screens.rpy", line 551, in execute
    frame:
  File "game/screens.rpy", line 554, in execute
    hbox:
  File "game/screens.rpy", line 560, in execute
    frame:
  File "game/screens.rpy", line 563, in execute
    if scroll == "viewport":
  File "game/screens.rpy", line 565, in execute
    viewport:
  File "game/screens.rpy", line 574, in execute
    vbox:
  File "game/screens.rpy", line 575, in execute
    transclude
  File "game/screens.rpy", line 931, in execute
    use game_menu(_("Opciones"), scroll="viewport"):
  File "game/screens.rpy", line 933, in execute
    vbox:
  File "game/screens.rpy", line 972, in execute
    hbox:
  File "game/screens.rpy", line 976, in execute
    vbox:
  File "game/screens.rpy", line 989, in execute
    bar value FieldValue(persistent, "skip_delay", range=400, max_is_zero=False, style="bar", offset=5, step=None, action=None, force_step=False) bar_invert True
  File "renpy/common/00barvalues.rpy", line 285, in get_adjustment
    value -= self.offset
TypeError: unsupported operand type(s) for -=: 'NoneType' and 'int'

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "renpy/common/_layout/screen_main_menu.rpym", line 28, in script
    python hide:
  File "renpy/ast.py", line 928, in execute
    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
  File "renpy/python.py", line 2245, in py_exec_bytecode
    exec(bytecode, globals, locals)
  File "renpy/common/_layout/screen_main_menu.rpym", line 28, in <module>
    python hide:
  File "renpy/common/_layout/screen_main_menu.rpym", line 35, in _execute_python_hide
    ui.interact()
  File "renpy/ui.py", line 298, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "renpy/display/core.py", line 3325, in interact
    repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, pause=pause, pause_start=pause_start, **kwargs)
  File "renpy/display/core.py", line 3737, in interact_core
    root_widget.visit_all(lambda i : i.per_interact())
  File "renpy/display/core.py", line 568, in visit_all
    d.visit_all(callback, seen)
  File "renpy/display/core.py", line 568, in visit_all
    d.visit_all(callback, seen)
  File "renpy/display/core.py", line 568, in visit_all
    d.visit_all(callback, seen)
  File "renpy/display/core.py", line 568, in visit_all
    d.visit_all(callback, seen)
  File "renpy/display/screen.py", line 436, in visit_all
    callback(self)
  File "renpy/display/core.py", line 3737, in <lambda>
    root_widget.visit_all(lambda i : i.per_interact())
  File "renpy/display/screen.py", line 447, in per_interact
    self.update()
  File "renpy/display/screen.py", line 637, in update
    self.screen.function(**self.scope)
  File "game/screens.rpy", line 927, in execute
    screen preferences():
  File "game/screens.rpy", line 927, in execute
    screen preferences():
  File "game/screens.rpy", line 931, in execute
    use game_menu(_("Opciones"), scroll="viewport"):
  File "game/screens.rpy", line 542, in execute
    screen game_menu(title, scroll=None, yinitial=0.0):
  File "game/screens.rpy", line 542, in execute
    screen game_menu(title, scroll=None, yinitial=0.0):
  File "game/screens.rpy", line 551, in execute
    frame:
  File "game/screens.rpy", line 554, in execute
    hbox:
  File "game/screens.rpy", line 560, in execute
    frame:
  File "game/screens.rpy", line 563, in execute
    if scroll == "viewport":
  File "game/screens.rpy", line 565, in execute
    viewport:
  File "game/screens.rpy", line 574, in execute
    vbox:
  File "game/screens.rpy", line 575, in execute
    transclude
  File "game/screens.rpy", line 931, in execute
    use game_menu(_("Opciones"), scroll="viewport"):
  File "game/screens.rpy", line 933, in execute
    vbox:
  File "game/screens.rpy", line 972, in execute
    hbox:
  File "game/screens.rpy", line 976, in execute
    vbox:
  File "game/screens.rpy", line 989, in execute
    bar value FieldValue(persistent, "skip_delay", range=400, max_is_zero=False, style="bar", offset=5, step=None, action=None, force_step=False) bar_invert True
  File "renpy/sl2/sldisplayables.py", line 252, in sl2bar
    return renpy.display.behavior.Bar(range, value, width, height, vertical=False, **properties)
  File "renpy/display/behavior.py", line 1847, in __init__
    adjustment = value.get_adjustment()
  File "renpy/common/00barvalues.rpy", line 285, in get_adjustment
    value -= self.offset
TypeError: unsupported operand type(s) for -=: 'NoneType' and 'int'

Windows-10-10.0.17763
Ren'Py 7.4.11.2266
At Home Again 0.07
Tue Jan 24 16:51:20 2023
The auto advance speed is too slow for what I need, but I will see if I can vary it, thanks for your help.
 
Last edited:

iOtero

Active Member
Aug 4, 2020
925
1,460
Code:
frame:
    style_prefix "pref"
    has vbox

    label _("Auto-Forward Time")
    bar value Preference("auto-forward time")
Thanks you, but to vary that speed I have to modify the \common\preferences.rpy file and that is not a viable option.

Players are used to the renpy default auto-advance speeds and if I were to modify them, it would annoy them.

I will have to keep trying with the Skip Speed slider bar.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,957
16,190
I develop visual adventures for adults.
I wouldn't have guessed, it's so exceptional here.


So far I do it by changing the value of conf.speed_delay manually in gui.rpy in values like 200 or 300,
Then why did you initially used a range of 100 for the bar ?


And it doesn't work because I get this error, for what it's worth:

Code:
  File "renpy/common/00barvalues.rpy", line 285, in get_adjustment
    value -= self.offset
TypeError: unsupported operand type(s) for -=: 'NoneType' and 'int'
And you didn't said it in your original post because... ?

If you have the ability to read the mind of others, good for you, but it's not our case. By the way, you should exchange it with the ability to read the documentation.

" "
Code:
init python:
    if persistent.skip_delay is None:
        persistent.skip_delay = 0


The auto advance speed is too slow for what I need,
*sigh*
The value is the delay between each interaction... The auto-advance can be really fast when you don't configure it backward.
 

crabsinthekitchen

Well-Known Member
Apr 28, 2020
1,565
9,063
Thanks you, but to vary that speed I have to modify the \common\preferences.rpy file and that is not a viable option.

Players are used to the renpy default auto-advance speeds and if I were to modify them, it would annoy them.

I will have to keep trying with the Skip Speed slider bar.
uhh, put that slider on the settings screen? if it's not already there because default settings screen generated by RenPy when you create a new game already had it last time I tried
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,957
16,190
uhh, put that slider on the settings screen? if it's not already there because default settings screen generated by RenPy when you create a new game already had it last time I tried
I'm almost sure that, when he talked about varying the value, there were an implicit "beyond what the configuration bar permit".
For some, "auto-forward time" isn't really implicit. They push the bar at its maximum and, believing that it's the fastest speed, they don't try to see what happen if they do the opposite.