hi everyone!
is there a way to keep variables during renpy replay? replaying a scene with multiple paths is causing us issues. all the variables seem to reset in replay
and another question. Is there a command for "if in replay: jump newlabel" and such?? Basiclly "if in replay: do this or that"
Renpy replay not using variables
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.
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.
-
- Newbie
- Posts: 1
- Joined: Mon Mar 16, 2020 9:21 am
- Contact:
- RicharDann
- Veteran
- Posts: 286
- Joined: Thu Aug 31, 2017 11:47 am
- Contact:
Re: Renpy replay not using variables
This is the first time I actually try out this code so this may not be the perfect solution, but according to the documentation here, you have to pass each variable and value pair as a dictionary, using the 'scope' keyword argument, either with the Replay() action or with renpy.call_replay() function, so Ren'Py can set the values before launching the replay.
For the second question, there's a built in _in_replay variable that can be used to check if you're in replay mode or not.
A quick example:
I don't have time to do some more testing but hopefully this is a start.
For the second question, there's a built in _in_replay variable that can be used to check if you're in replay mode or not.
A quick example:
Code: Select all
default a_number = 0
default a_string = ""
screen replay_gallery():
textbutton _("Scene 01") action Replay("scene_01", scope={"a_number":100, "a_string":"Hello"})
Code: Select all
label scene_01:
if _in_replay:
"This scene is being replayed."
"Let's test an int variable: [a_number]"
"Let's test with a string: [a_string]"
$ renpy.end_replay()
The most important step is always the next one.
Who is online
Users browsing this forum: Dark79, Google [Bot]