I keep having issues with "displayables" and switching?
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.
I keep having issues with "displayables" and switching?
I keep getting this message: "Exception: Switch could not choose a displayable," and it's only for a small portion of the game. I'm not exactly sure what's causing it. The line it's direction me to is a character speaking. In this game, I have graphics for the narrator's facial expression on the left side, so I think that might be what's wrong. I haven't been having problems with that up until this point though. The portion of the game that I keep getting this message on is:
je "Well, we better get back before your parents catch us and nearly kill you again."
j "Definitely."
"Justin opens the front door for me and follows behind.
scene black with fade
scene street with fade
"I spot his car in the driveway after he unlocks the doors."
show jsmirk with dissolve
$ face = "heh"
Once I get to the next line, everything is back to normal. Does anyone have any idea what I'm doing wrong here?
je "Well, we better get back before your parents catch us and nearly kill you again."
j "Definitely."
"Justin opens the front door for me and follows behind.
scene black with fade
scene street with fade
"I spot his car in the driveway after he unlocks the doors."
show jsmirk with dissolve
$ face = "heh"
Once I get to the next line, everything is back to normal. Does anyone have any idea what I'm doing wrong here?
Re: I keep having issues with "displayables" and switching?
There is no condition that evaluate to True, I guess.
Re: I keep having issues with "displayables" and switching?
How would I go about doing that? Or is there a tutorial somewhere around it would be easier if I go looking for that lol
Re: I keep having issues with "displayables" and switching?
I went back and removed the previous displayable ($ face = "happy") and that fixed it for some reason... I'm not sure why, though.
Edit: I then moved it down just above the line "Well, we better..." and it worked there, too.
Edit: I then moved it down just above the line "Well, we better..." and it worked there, too.
Re: I keep having issues with "displayables" and switching?
Maybe you should actually put the code up. Because it's all guessing here that you used a ConditionSwitch, and none of the condition are true.
And $ face = "happy" is not a displayable, just to clear up the confused terminology. And even that part of the code are not here either.
And $ face = "happy" is not a displayable, just to clear up the confused terminology. And even that part of the code are not here either.
Re: I keep having issues with "displayables" and switching?
I actually didn't use a ConditionSwitch, I only have the .pngs defined. Here's the code I used for them, borrowed from another player:
# Declare characters used by this game.
define je = Character('Jessica',
color="#f4a207", who_outlines=[ (2, "#000000") ], what_outlines=[ (2, "#000000") ],
window_left_padding=270,
show_side_image=ConditionSwitch(
"face == 'ah'", "yah.png",
"face == 'yha'", "yha.png",
"face == 'happy'", "yhappy.png",
"face == 'heh'", "yheh.png",
"face == 'mmhm'", "ymmhm.png",
"face == 'normal'", "ynormal.png",
"face == 'pissed'", "ypissed.png",
"face == 'wellthen'", "ywellthen.png",
"face == 'what'", "ywhat.png",
"face == 'what2'", "ywhat2.png",
"face == 'yay'", "yyay.png",
xalign=0.0, yalign=1.0))
# Declare characters used by this game.
define je = Character('Jessica',
color="#f4a207", who_outlines=[ (2, "#000000") ], what_outlines=[ (2, "#000000") ],
window_left_padding=270,
show_side_image=ConditionSwitch(
"face == 'ah'", "yah.png",
"face == 'yha'", "yha.png",
"face == 'happy'", "yhappy.png",
"face == 'heh'", "yheh.png",
"face == 'mmhm'", "ymmhm.png",
"face == 'normal'", "ynormal.png",
"face == 'pissed'", "ypissed.png",
"face == 'wellthen'", "ywellthen.png",
"face == 'what'", "ywhat.png",
"face == 'what2'", "ywhat2.png",
"face == 'yay'", "yyay.png",
xalign=0.0, yalign=1.0))
Re: I keep having issues with "displayables" and switching?
What do you means you don't use ConditionSwitch???Brendan wrote:I actually didn't use a ConditionSwitch, I only have the .pngs defined. Here's the code I used for them, borrowed from another player:
# Declare characters used by this game.
define je = Character('Jessica',
color="#f4a207", who_outlines=[ (2, "#000000") ], what_outlines=[ (2, "#000000") ],
window_left_padding=270,
show_side_image=ConditionSwitch(
"face == 'ah'", "yah.png",
"face == 'yha'", "yha.png",
"face == 'happy'", "yhappy.png",
"face == 'heh'", "yheh.png",
"face == 'mmhm'", "ymmhm.png",
"face == 'normal'", "ynormal.png",
"face == 'pissed'", "ypissed.png",
"face == 'wellthen'", "ywellthen.png",
"face == 'what'", "ywhat.png",
"face == 'what2'", "ywhat2.png",
"face == 'yay'", "yyay.png",
xalign=0.0, yalign=1.0))
Anyway, go through your code, look for all the line that looks like $ face = ... (the ... could be anything, the = might be == or the variable face could be something else if typos were made; basically, look for all line that might have try to do something to variable face). Post these here, indicate where the problematic portion of the game are with relative to these line. Especially pay attention to $ face = "ha" because I suspect that to be the most likely culprit.
Re: I keep having issues with "displayables" and switching?
Oh man, that's so awkward. I didn't read through the code to know it was a ConditionSwitch, I just assumed the previous user had defined them and positioned them. Yeah, "ha" is causing quite a few problems, I've noticed. Do you want me to post <i>all</i> the times that's listed, because there's quite a few of them?
Re: I keep having issues with "displayables" and switching?
If there are too many times you have them, just post the those that are close to the place where you have trouble.
Re: I keep having issues with "displayables" and switching?
Alrighty, here you go:
je "About?"
j "Us. I was wondering if you'd be mad that I don't think I'm ready to like, settle down or anything."
"I take my phone away from my ear and look at it."
$ face = "what"
je "I've only known you for a two days, Justin. I don't think I'm ready to be in a relationship either."
je "I hardly know you."
j "Okay, good. I've talked to girls who immediately want to date and that's freaky as hell."
"I laugh to myself. He must not know who I am."
"I'm an independent woman who don't need no man."
"I don't even need my dad."
"I mean, he sometimes helps me open new jars of pickles so I can have a good breakfast, but most of the time?"
"He's pretty useless. I'm a girl's girl."
je "Don't even worry. I like hanging out with you. And kissing you. Whatever happens, happens."
je "I'm not gonna rush it, so don't stress yourself about that."
"I can practically hear him sigh with relief."
j "I'm glad to hear that, honestly."
j "I was worried you'd get super attached to me. It's not that hard, you know?"
je "Of course not."
"I roll my eyes. I can already tell he's gonna be like this all the time."
j "Well, I just wanted to call and make sure that was covered."
# Trouble with changing faces
$ face = "smile"
je "It's covered. I'll see you tomorrow night, then?"
j "Of course. I'm looking forward to it."
je "Me too."
j "I'll let you go then."
je "Bye!"
j "Later."
"I hang up my phone and look down at my laptop."
"I'm not even in the mood to read erotic fan fiction anymore."
"I just wanna stuff my mouth with popcorn. And Justin's tongue. At the same time. Mmm..."
At first I thought maybe it was because I was trying to switch faces with each response the narrator said, but even when I put filler talk in there and separated the switches, it still gave me a problem. But on other portions of the game, I've switched every other response, so I dunno.
je "About?"
j "Us. I was wondering if you'd be mad that I don't think I'm ready to like, settle down or anything."
"I take my phone away from my ear and look at it."
$ face = "what"
je "I've only known you for a two days, Justin. I don't think I'm ready to be in a relationship either."
je "I hardly know you."
j "Okay, good. I've talked to girls who immediately want to date and that's freaky as hell."
"I laugh to myself. He must not know who I am."
"I'm an independent woman who don't need no man."
"I don't even need my dad."
"I mean, he sometimes helps me open new jars of pickles so I can have a good breakfast, but most of the time?"
"He's pretty useless. I'm a girl's girl."
je "Don't even worry. I like hanging out with you. And kissing you. Whatever happens, happens."
je "I'm not gonna rush it, so don't stress yourself about that."
"I can practically hear him sigh with relief."
j "I'm glad to hear that, honestly."
j "I was worried you'd get super attached to me. It's not that hard, you know?"
je "Of course not."
"I roll my eyes. I can already tell he's gonna be like this all the time."
j "Well, I just wanted to call and make sure that was covered."
# Trouble with changing faces
$ face = "smile"
je "It's covered. I'll see you tomorrow night, then?"
j "Of course. I'm looking forward to it."
je "Me too."
j "I'll let you go then."
je "Bye!"
j "Later."
"I hang up my phone and look down at my laptop."
"I'm not even in the mood to read erotic fan fiction anymore."
"I just wanna stuff my mouth with popcorn. And Justin's tongue. At the same time. Mmm..."
At first I thought maybe it was because I was trying to switch faces with each response the narrator said, but even when I put filler talk in there and separated the switches, it still gave me a problem. But on other portions of the game, I've switched every other response, so I dunno.
Re: I keep having issues with "displayables" and switching?
Uh, you never defined what would be displayed when face is "smile". Looks at the list of what you defined, you only have:
ah
yha
happy
heh
mmhm
normal
pissed
wellthen
what
what2
yay
ah
yha
happy
heh
mmhm
normal
pissed
wellthen
what
what2
yay
Re: I keep having issues with "displayables" and switching?
Ah, that might be why smile wasn't working, lol. When I changed it though, it's still not working.
Re: I keep having issues with "displayables" and switching?
Whatever you changed it too, it still need to be in that list. Also, did you not mention that "ha" is causing your trouble as well? It's not on the list either.
Who is online
Users browsing this forum: Ahrefs [Bot]