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.
-
wyverngem
- Miko-Class Veteran
- Posts: 615
- Joined: Mon Oct 03, 2011 7:27 pm
- Completed: Simple as Snow, Lady Luck's Due,
- Projects: Aether Skies, Of the Waterfall
- Tumblr: casting-dreams
- itch: castingdreams
- Location: USA
-
Contact:
#1
Post
by wyverngem » Mon Feb 17, 2020 9:21 pm
I have a small script I'm adding that changes a persistent variable. I finally got it to turn on and off with the use of a function. I couldn't use SetVariable because it gave me a split error. So I created a basic function that takes the type and changes the persistent variable. However, the textbutton doesn't show that it's already enabaled on the preference screen one way or the other such as it does with the windowed and full screeen adding the line. What am I missing to change this?
Code: Select all
vbox:
style_prefix "radio"
label _("Read-Mode")
textbutton _("NVL") action Function(turn_on_nvl, 1)
textbutton _("ADV") action Function(turn_on_nvl, 0)
Code: Select all
init python:
def turn_on_nvl(type):
if type == 0:
persistent.nvl = False
else:
persistent.nvl = True
-
DragoonHP
- Miko-Class Veteran
- Posts: 758
- Joined: Tue Jun 22, 2010 12:54 am
- Completed: Christmas
- IRC Nick: DragoonHP
- Location: Zion Island, Solario
-
Contact:
#2
Post
by DragoonHP » Thu Feb 20, 2020 9:18 am
-
wyverngem
- Miko-Class Veteran
- Posts: 615
- Joined: Mon Oct 03, 2011 7:27 pm
- Completed: Simple as Snow, Lady Luck's Due,
- Projects: Aether Skies, Of the Waterfall
- Tumblr: casting-dreams
- itch: castingdreams
- Location: USA
-
Contact:
#3
Post
by wyverngem » Tue Feb 25, 2020 9:49 am
Can you be more specific on what that looks like? I'm not sure what the object would be.
-
Alex
- Lemma-Class Veteran
- Posts: 2981
- Joined: Fri Dec 11, 2009 5:25 pm
-
Contact:
#4
Post
by Alex » Tue Feb 25, 2020 2:09 pm
Try
Code: Select all
textbutton _("NVL") action SetField(persistent, nvl, True)
-
wyverngem
- Miko-Class Veteran
- Posts: 615
- Joined: Mon Oct 03, 2011 7:27 pm
- Completed: Simple as Snow, Lady Luck's Due,
- Projects: Aether Skies, Of the Waterfall
- Tumblr: casting-dreams
- itch: castingdreams
- Location: USA
-
Contact:
#5
Post
by wyverngem » Thu Apr 30, 2020 8:33 pm
Thanks Alex.
Users browsing this forum: Google [Bot]