Adding checkpoints for rollback

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
User avatar
thelastsecret
Regular
Posts: 117
Joined: Tue Mar 01, 2022 1:32 pm
Completed: The Last Secret
Projects: Sweet Science – The Girls from Silversee Castle
itch: thelastsecret
Discord: TheLastSecret #5266
Contact:

Adding checkpoints for rollback

#1 Post by thelastsecret »

I have a fairly long cut scene in my next game. It's based on commands like pause 20, and in between text is spoken and animations happen. It's possible to skip it. (I've added a screen for that.) When you want to go back, however, you can only roll back before the scene, since rollback goes back to the last interaction. However, I want it to roll back only to the last pause command.
Now, I know there is renpy.checkpoint(), but adding this alone does not work, and I'm really at loss what to do there. So if anybody could help, that would be great!
Thank you very much in advance! :)

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3792
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Adding checkpoints for rollback

#2 Post by Imperf3kt »

Place this after your pauses

Code: Select all

$ renpy.block_rollback
Be aware this will block rolling back before this point entirely
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
thelastsecret
Regular
Posts: 117
Joined: Tue Mar 01, 2022 1:32 pm
Completed: The Last Secret
Projects: Sweet Science – The Girls from Silversee Castle
itch: thelastsecret
Discord: TheLastSecret #5266
Contact:

Re: Adding checkpoints for rollback

#3 Post by thelastsecret »

Sorry, but that's not what I want: I want the player to roll back to the last pause, then have the option to roll back further or not. I do NOT want to prevent them from rolling back further!

Post Reply

Who is online

Users browsing this forum: Google [Bot]