DynamicDisplay/ConditionSwitch Issues {solved!}

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.
Post Reply
Message
Author
Agent-J
Newbie
Posts: 22
Joined: Thu Sep 23, 2010 11:34 am
Projects: Kiss from Cupid
Contact:

DynamicDisplay/ConditionSwitch Issues {solved!}

#1 Post by Agent-J »

I know this is me messing up the script to run the image change, I'm just not too clear how to correct it.

I have the main character image set as:


$ f = Character(
'Freya',
color="#B3476F",
show_two_window=True,
window_left_padding=140,
show_side_image=ConditionSwitch(
"'freya' == 'neutral'", "freyahead.png",
"'freya' == 'annoyed'", "freyamad.png",
"'freya' == 'calmblush'", "freyablushcalm.png",
"'freya' == 'blushmad'", "freyablushmad.png",
"'freya' == 'flustered'", "freyafluster.png", xalign=1.0, yalign=1.0))

And after the label start added in

$ freya = "neutral"

To have that particular image come up with her dialogue. However, every time it reaches her first line, the traceback text comes up. Did I miss putting something in?
Last edited by Agent-J on Mon Sep 27, 2010 10:57 pm, edited 1 time in total.

cloudyssky
Veteran
Posts: 258
Joined: Mon May 17, 2010 2:09 pm
Completed: Alone
Projects: Many failed ones
Location: Massachusetts
Contact:

Re: DynamicDisplay/ConditionSwitch Issues

#2 Post by cloudyssky »

What's the traceback error say? It seems to me you're supposed to put everything on one line, rather than multiple ones like this:

$ f = Character('Freya', color="#B3476F, show_two_window=True, etc...)

All on one line, just like above.
Projects:
Alone- (Horror/Sci-Fi) Complete! Link
Demokratiya- (Adventure/Action) I'm kind of winging it with this one. Goal is 100,000 words. Yeah, it's gonna take a while.
{Last worked on Sept/28 : Word count (coding and all) ~4500}

User avatar
backansi
Veteran
Posts: 224
Joined: Sun May 31, 2009 7:15 am
Location: Korea, Republic of
Contact:

Re: DynamicDisplay/ConditionSwitch Issues

#3 Post by backansi »

@cloudyssky
Multiple lines in parentheses are interpreted as a line, so it's not a problem.

@Agent -J
Change " 'freya' == 'neutral' " into "freya == 'neutral'".

Code: Select all

init:
    $ f = Character(
    'Freya',
    color="#B3476F",
    show_two_window=True,
    window_left_padding=140,
    show_side_image=ConditionSwitch(

    # "variable == value, image file name"
    "freya == 'neutral'", "freyahead.png",
    "freya == 'annoyed'", "freyamad.png", 
    "freya == 'calmblush'", "freyablushcalm.png",
    "freya == 'blushmad'", "freyablushmad.png",
    "freya == 'flustered'", "freyafluster.png", xalign=1.0, yalign=1.0))

Agent-J
Newbie
Posts: 22
Joined: Thu Sep 23, 2010 11:34 am
Projects: Kiss from Cupid
Contact:

Re: DynamicDisplay/ConditionSwitch Issues

#4 Post by Agent-J »

Ah, that's fixed it!
Thank you so much!

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Majestic-12 [Bot]