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.
-
DesertFox
- Regular
- Posts: 196
- Joined: Sun Jul 28, 2013 1:29 pm
- Completed: Over The Hills And Far Away
- Projects: My Little Dictator
- Organization: WarGirl Games
-
Contact:
#1
Post
by DesertFox » Wed Oct 07, 2015 4:16 pm
I'm having an issue with how quickly a variable sets. The idea is to let the player select between two color schemes. However, the styles and variables don't set with one click on either button, at least to begin with. There's some middling state, where some elements are orange and some are green. You have to double click to get what you want. Any suggestions as to why the variable doesn't 'set' properly?
Code: Select all
screen pretheme():
textbutton _("Green") action [StylePreference("color", "#2CD11B")], [SetVariable("orange", False)], [SetVariable("persistent.orange", False)] etc.
Code: Select all
init -2 python:
renpy.register_style_preference("color", "#2CD11B", style.default, "color", "#2CD11B") etc.
Code: Select all
image monitor = ConditionSwitch("persistent.orange", "monitor1",
"True", "monitor2")
-
PyTom
- Ren'Py Creator
- Posts: 15893
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
-
Contact:
#2
Post
by PyTom » Wed Oct 07, 2015 9:51 pm
Is anything conditional on orange or persistent.orange? You may need to set those before calling StylePreference. A lot depends on what the actual conditions are.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama •
https://www.patreon.com/renpytom
-
DesertFox
- Regular
- Posts: 196
- Joined: Sun Jul 28, 2013 1:29 pm
- Completed: Over The Hills And Far Away
- Projects: My Little Dictator
- Organization: WarGirl Games
-
Contact:
#3
Post
by DesertFox » Thu Oct 08, 2015 8:51 pm
PyTom wrote:Is anything conditional on orange or persistent.orange? You may need to set those before calling StylePreference. A lot depends on what the actual conditions are.
Those images using Conditionswitch are. There are several images using the same kind of thing. In the above example, monitor1 and monitor2 are other defined images, with the Conditionswitch choosing between them based on the persistent.orange variable. Then in that prescreen, there's also the textbutton to choose to set orange and persistent.orange to True, I just didn't include it.
Also set is the following:
Code: Select all
init -2 python:
orange = False
persistent.orange = orange
-
philat
- Eileen-Class Veteran
- Posts: 1853
- Joined: Wed Dec 04, 2013 12:33 pm
-
Contact:
#4
Post
by philat » Thu Oct 08, 2015 11:04 pm
A list of actions is run in order. I think what PyTom means is try putting SetVariable before StylPreference and see if that fixes the problem.
-
DesertFox
- Regular
- Posts: 196
- Joined: Sun Jul 28, 2013 1:29 pm
- Completed: Over The Hills And Far Away
- Projects: My Little Dictator
- Organization: WarGirl Games
-
Contact:
#5
Post
by DesertFox » Fri Oct 09, 2015 12:38 am
No that doesn't fix the issue. There's still a delay in that the coloring of the text and buttons (sometimes the image) doesn't set with just one click. Since it's the text sometimes too, that suggests there's an issue with StylePreference as well.
-
PyTom
- Ren'Py Creator
- Posts: 15893
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
-
Contact:
#6
Post
by PyTom » Fri Oct 09, 2015 11:23 pm
Can you put together a replication so I can look at this?
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama •
https://www.patreon.com/renpytom
-
DesertFox
- Regular
- Posts: 196
- Joined: Sun Jul 28, 2013 1:29 pm
- Completed: Over The Hills And Far Away
- Projects: My Little Dictator
- Organization: WarGirl Games
-
Contact:
#7
Post
by DesertFox » Sat Oct 10, 2015 4:03 pm
Here's a replication.
Last edited by
DesertFox on Sun Oct 11, 2015 11:51 pm, edited 2 times in total.
-
gas
- Miko-Class Veteran
- Posts: 838
- Joined: Mon Jan 26, 2009 7:21 pm
-
Contact:
#8
Post
by gas » Sat Oct 10, 2015 9:51 pm
You can set the images as a part of the style definition, like a frame or window background property.
I think this is more consistent, and I applied the same to let the player choose the whole interface style between 5 colours. No bugs at all.
The choice get saved as a persistent value. So if you choose the red interface, next time you launch the game it start with the red one. If you load a game, it load the style definitions of that game.
If you want to debate on a reply I gave to your posts, please QUOTE ME or i'll not be notified about. << now red so probably you'll see it.
10 ? "RENPY"
20 GOTO 10
RUN
-
DesertFox
- Regular
- Posts: 196
- Joined: Sun Jul 28, 2013 1:29 pm
- Completed: Over The Hills And Far Away
- Projects: My Little Dictator
- Organization: WarGirl Games
-
Contact:
#9
Post
by DesertFox » Tue Oct 13, 2015 5:13 pm
gas wrote:You can set the images as a part of the style definition, like a frame or window background property.
I think this is more consistent, and I applied the same to let the player choose the whole interface style between 5 colours. No bugs at all.
The choice get saved as a persistent value. So if you choose the red interface, next time you launch the game it start with the red one. If you load a game, it load the style definitions of that game.
Considering I'm using the overlay here, how would I apply a style to that image?
Users browsing this forum: Google [Bot]