Hello
I am trying to add a scene gallery to my game. Calling the replay seems simple enough but how do you make replay remember some variables?
For example, in my game the player writes their own name (povname = playername) so in a replay every time the player talks it gives the error (povname not defined) and the same with any other variables such as "if variable b is true:" stuff.
How to be able to make scene replays with those variables not removed?
Variables and Replay
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.
-
- Miko-Class Veteran
- Posts: 793
- Joined: Fri Feb 09, 2018 12:05 am
- Location: Canada
- Contact:
Re: Variables and Replay
can you post your code that you are using?
are you using:
textbotton?
hotspots?
imagebuttons?
here are some examples textbutton you can do the same for other as well
SetField:
SetVariable:
are you using:
textbotton?
hotspots?
imagebuttons?
here are some examples textbutton you can do the same for other as well
SetField:
Code: Select all
textbutton _("Cousin Hearts") action [ ShowMenu("test"), SetField(cousin, "lim", cousin.lim+50) ]
Code: Select all
textbutton _("Rat") action [ ShowMenu("test"), SetVariable("rat_mouse.have", True) ]
Re: Variables and Replay
The code right now is merely for testing but look like thisrayminator wrote: ↑Tue Oct 22, 2019 3:42 pm can you post your code that you are using?
are you using:
textbotton?
hotspots?
imagebuttons?
here are some examples textbutton you can do the same for other as well
SetField:SetVariable:Code: Select all
textbutton _("Cousin Hearts") action [ ShowMenu("test"), SetField(cousin, "lim", cousin.lim+50) ]
Code: Select all
textbutton _("Rat") action [ ShowMenu("test"), SetVariable("rat_mouse.have", True) ]
Code: Select all
textbutton "The meaning of life":
action Replay("gracieMovie1")
xalign 0.5
yalign 0.95
-
- Miko-Class Veteran
- Posts: 793
- Joined: Fri Feb 09, 2018 12:05 am
- Location: Canada
- Contact:
Re: Variables and Replay
try this if this you want i have tried it and works for me but i did use the replay cause i don't have it so hope it works for you that you want it too
Edit: it only work inside of the game
Edit: it only work inside of the game
Code: Select all
textbutton _("testing") action [ Jump("test"), povname.strip() ]
Code: Select all
textbutton "The meaning of life":
action [ Replay("gracieMovie1"), povname.strip() ]
xalign 0.5
yalign 0.95
Re: Variables and Replay
EDIT*rayminator wrote: ↑Tue Oct 22, 2019 9:40 pm try this if this you want i have tried it and works for me but i did use the replay cause i don't have it so hope it works for you that you want it too
Edit: it only work inside of the game
Code: Select all
textbutton _("testing") action [ Jump("test"), povname.strip() ]
Code: Select all
textbutton "The meaning of life": action [ Replay("gracieMovie1"), povname.strip() ] xalign 0.5 yalign 0.95
It worked! Thanks for the help.
Code: Select all
textbutton "The meaning of life":
action Replay("gracieMovie1", scope={ "povname" : "Slow" })
xalign 0.5
yalign 0.95
Who is online
Users browsing this forum: No registered users