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.
-
KairuKyun
- Veteran
- Posts: 286
- Joined: Thu Feb 12, 2015 4:10 pm
- Completed: No One But You, Catch Canvas, Sickness, Written in the Sky, Wander no more, Warped Reality
- Projects: Warped Reality
- Organization: Unwonted Studios
- IRC Nick: Kairu_kyun
- Tumblr: karamuchan
-
Contact:
#1
Post
by KairuKyun » Sun Apr 26, 2015 1:12 am
Okay in my code I have this at the end of my label:
And I have this as my button:
Code: Select all
if persistent.replay == True:
imagebutton auto "assets/images/menu/buttons/btn_start_%s.png" action ShowMenu("replay_gallery") xpos 550 ypos 394 focus_mask True
But the button wont unlock after passing that point no matter what i do. What it going on.
-
Laiska
- Veteran
- Posts: 323
- Joined: Sat Jan 11, 2014 1:14 am
- Completed: Queen At Arms, Cerulean, The Shadows That Run Alongside Our Car, Vicarwissen
- Projects: Caramel Mokaccino
- Tumblr: minesweeperaddict
- Deviantart: koyoba
-
Contact:
#2
Post
by Laiska » Sun Apr 26, 2015 2:09 am
I believe you're only supposed to have a single '=' for setting a variable, '==' is only for evaluation.
So: $ persistent.replay = True
I could be wrong. I've had no trouble getting this to work though:
if (persistent.check1 is False):
add "heart" xalign 1.0 yalign 0.0
paired with
$ persistent.check1 = True
wherein the first line makes a heart icon appear in the main menu, only if a persistent variable hasn't been set to true in the script yet.
-
Onishion
- Veteran
- Posts: 295
- Joined: Mon Apr 20, 2015 10:36 am
-
Contact:
#3
Post
by Onishion » Sun Apr 26, 2015 4:10 am
Laiska's correct, at least on the first bit. One easy way to check that sort of thing is that after you do the thing that's meant to activate the button, hit ctrl-d and open the variable viewer, to see if that variable has in fact changed. If we're right on this one, it won't have changed the way you have it there (I know this because I'm constantly messing this up by copy-pasting elements and forgetting to add or remove an "=").

-
KairuKyun
- Veteran
- Posts: 286
- Joined: Thu Feb 12, 2015 4:10 pm
- Completed: No One But You, Catch Canvas, Sickness, Written in the Sky, Wander no more, Warped Reality
- Projects: Warped Reality
- Organization: Unwonted Studios
- IRC Nick: Kairu_kyun
- Tumblr: karamuchan
-
Contact:
#4
Post
by KairuKyun » Sun Apr 26, 2015 12:35 pm
Dang, I didn't even notice that
