A place for Ren'Py tutorials and reusable Ren'Py code.
Forum rules
Do not post questions here!
This forum is for example code you want to show other people. Ren'Py questions should be asked in the Ren'Py Questions and Announcements forum.
Moshibit
Regular
Posts: 50 Joined: Wed Oct 16, 2019 1:58 pm
Location: Mexico
Contact:
#1
Post
by Moshibit » Wed Mar 11, 2020 2:13 am
I have seen many visual novels with mini-games, where they eliminate the rollback feature. I bring a solution so that this feature is not eliminated.
This is just an example.
Code: Select all
init python:
class NoRollObj(NoRollback):
def __init__(self, v):
self.value = v
default ctrlnc = NoRollObj(False)
default points = NoRollObj(0)
label start:
"..."
"..."
if ctrlnc.value == False:
$ renpy.call_in_new_context("rock_paper_scisors")
$ ctrlnc.value = True
"..."
"..."
label rock_paper_scisors:
show screen rps
$ points += 1
return
In the new context it is not allowed to rollback, when making a code structure like the one in the example, it is allowed to make a rolback in the story, without playing the minigame again and the result is not lost.
Users browsing this forum: No registered users