About Renpy Rollback

frozenfeet

Well-Known Member
Aug 2, 2019
1,268
2,048
439
You know how Unren has the feature to over ride blocking Renpy rollback? The only problem I have noticed is that all the dev needs to do is just add
Code:
renpy.config.rollback_enabled = False
and bam Unren feature defeated.

What I'm wondering is there a way to write a little script that would instantly reset
Code:
renpy.config.rollback_enabled = False
to true if it has been set to false somewhere else in the game?
 

Winterfire

Conversation Conqueror
Respected User
Game Developer
Sep 27, 2018
6,523
9,364
800
Is that a real issue, or just something you thought about? Either way, just open the game project, shift + ctrl + f (or whatever hotkey to search the whole project), write "renpy.config.rollback_enabled = False" then change the value to True.
That's reasonably fast in the rare (if any) cases that Unren doesn't work.

Just keep in mind that more often than not, the developer disables rollback for a reason. Not every game can support rollback, and if forced on, it'll only lead to issues.
 

<Code/>

Newbie
Feb 27, 2020
70
83
155
You know how Unren has the feature to over ride blocking Renpy rollback? The only problem I have noticed is that all the dev needs to do is just add
Code:
renpy.config.rollback_enabled = False
and bam Unren feature defeated.

What I'm wondering is there a way to write a little script that would instantly reset
Code:
renpy.config.rollback_enabled = False
to true if it has been set to false somewhere else in the game?
The best way would be to make the code you want to run to run after the other parts of the code are already loaded, that way your code will run last and change the variable.

Python:
init 1500 python:
    config.rollback_enabled = True
    config.developer = True
    config.console = True
If the dev is then resetting that somewhere else in the code, while it's playing,you likely wanna then edit the actual code instead.
 

frozenfeet

Well-Known Member
Aug 2, 2019
1,268
2,048
439
The best way would be to make the code you want to run to run after the other parts of the code are already loaded, that way your code will run last and change the variable.

Python:
init 1500 python:
    config.rollback_enabled = True
    config.developer = True
    config.console = True
If the dev is then resetting that somewhere else in the code, while it's playing,you likely wanna then edit the actual code instead.
Yeah that's how I have been doing unfortunately. I was just hoping for a way to auto reverse it when it happens instead of having to check the code to make sure the dev isn't setting it to false.

I think some devs have figured out we have bypassed the renpy rollback block with Unren and therefore use the config.rollback_enabled instead.
 

<Code/>

Newbie
Feb 27, 2020
70
83
155
Yeah that's how I have been doing unfortunately. I was just hoping for a way to auto reverse it when it happens instead of having to check the code to make sure the dev isn't setting it to false.

I think some devs have figured out we have bypassed the renpy rollback block with Unren and therefore use the config.rollback_enabled instead.
One way to do it is to add something which runs `config.rollback_enabled = True` every second or so, if it's currently false.


Python:
screen check_rollback():
    timer 1.0 repeat True action If("not config.rollback_enabled", SetVariable("config.rollback_enabled", True))

init python:
    if "check_rollback" not in config.overlay_screens:
        config.overlay_screens.append("check_rollback")
Here's a script I wipped up which adds an invisible screen to overlays (like quick_menu), which will reset it every second if they change it. You can increase or decrease the interval if needed.
 
Last edited:

frozenfeet

Well-Known Member
Aug 2, 2019
1,268
2,048
439
One way to do it is to add something which runs `config.rollback_enabled = True` every second or so, if it's currently false.


Python:
screen check_rollback():
    timer 1.0 repeat True action:
        If(
            not config.rollback_enabled,
            # couldn't find a screen action that works for configs, so did it manually
            python:
                config.rollback_enabled = True
        )

init python:
    if "check_rollback" not in config.overlay_screens:
        config.overlay_screens.append("check_rollback")
Here's a script I wipped up which adds an invisible screen to overlays (like quick_menu), which will reset it every second if they change it. You can increase or decrease the interval if needed.
Ok this looks interesting and promising I will give it a try :D.
 

<Code/>

Newbie
Feb 27, 2020
70
83
155
Ok this looks interesting and promising I will give it a try :D.
I tried it myself locally, and made changes to make it more efficient. Should work as intended, if that is the only change they are making. You can add more checks and edits if needed, if they use others.
 
  • Like
Reactions: frozenfeet

frozenfeet

Well-Known Member
Aug 2, 2019
1,268
2,048
439
I tried it myself locally, and made changes to make it more efficient. Should work as intended, if that is the only change they are making. You can add more checks and edits if needed, if they use others.
Working like a charm. I set config.rollback_enabled = False in the console and then tried rolling back and it still worked. Thanks man this was really helpful.

It's going into my over ride script I always use for Renpy