- Nov 15, 2019
- 13
- 34
Hello, I'm a beginner at renpy (started 2 months ago) and im trying my best to understand everything. I'm currently developing a 2d game that has a sandbox type(i know im going to pull my hair out on this one later on. But it's ok, hard work pays off! XD) I really love to customize everything in the main menu and I currently came across an issue of sometimes people who test my build, they tell me sometimes its hard to see who's talking unless they keep looking back at the name. I didn't color code the name since I didn't want to lol So instead, i decided to put side images in it to show who's talking along with the name of the person.
Well, long story short, I'm not quite sure if everyone likes sides images so I wanted to input a code into the settings for players having the ability to toggle side images on and off. I managed to make the side images work even with different expressions and whatnot. But when I search online for how to toggle the side images in the settings, I found one but when i tried it, it doesn't work. The toggle in the setting is there but when i click on it and test out the game, it does absolutely nothing since the side images is still there. I was wondering if there is anything wrong with the code or maybe im doing something wrong completely.
Here is the code:
also here is the textbutton code i placed for the preferences section:
my names section for side images look like this:
the images section for side images of different expression look like this:
The side images works fine and im able to set different expression based on the scenes. the code is in there since when i go to the settings, I can see the toggle on and off for side images like this:
Even when i uncheck the box in the settings, it's still there. The side images look like this:
To sum it up, the code is not working since even when i turn it off, it's still there. If anyone can give me any pointers or help to see what I'm doing wrong, that would be really helpful.
Well, long story short, I'm not quite sure if everyone likes sides images so I wanted to input a code into the settings for players having the ability to toggle side images on and off. I managed to make the side images work even with different expressions and whatnot. But when I search online for how to toggle the side images in the settings, I found one but when i tried it, it doesn't work. The toggle in the setting is there but when i click on it and test out the game, it does absolutely nothing since the side images is still there. I was wondering if there is anything wrong with the code or maybe im doing something wrong completely.
Here is the code:
Python:
init python:
if persistent.side_images is None:
persistent.side_images = True
screen say(who, what):
tag menu
style_prefix "say"
window:
id "window"
if who is not None:
window:
id "namebox"
style "namebox"
text who id "who"
text what id "what"
if not renpy.variant("small"):
add SideImage() xalign 0.0 yalign 1.0
also here is the textbutton code i placed for the preferences section:
Python:
textbutton _("{b}Toggle Side Images{/b}") action [ToggleField(persistent, "side_images"), SelectedIf(persistent.side_images)]
my names section for side images look like this:
Python:
#Main Character
define b = Character("Blake", ctc="ctcanim", ctc_position="nestled", image="blake")
define p = Character("[pname]", ctc="ctcanim", ctc_position="nestled", image="blake")
the images section for side images of different expression look like this:
Python:
#blake
image side blake kid = "sideblakekid.png"
image side blake ksad = "sideblakekidsad.png"
image side blake kidangry1 = "sideblakekidangry2.png"
image side blake kidangry2 = "sideblakekidangry.png"
image side blake teenmask = "sideblaketeenmask.png"
image side blake teenangry = "sideblaketeenangry.png"
The side images works fine and im able to set different expression based on the scenes. the code is in there since when i go to the settings, I can see the toggle on and off for side images like this:
Even when i uncheck the box in the settings, it's still there. The side images look like this:
To sum it up, the code is not working since even when i turn it off, it's still there. If anyone can give me any pointers or help to see what I'm doing wrong, that would be really helpful.
Last edited: