ConditionSwitch takes an even number of arguments?

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
ArizaLuca
Veteran
Posts: 241
Joined: Tue Feb 20, 2018 12:59 pm
Completed: Through the Screen, Riddle Me This, Trust Fall, Phobias, Another Adventure
Projects: The Souls in the Seams, Fata Morgana, Minecraft: Story Mode - Behind the Scenes
Organization: Astral Autumn Games
Tumblr: astralautumngames
Deviantart: ArizaLuca
itch: astralautumngames
Contact:

ConditionSwitch takes an even number of arguments?

#1 Post by ArizaLuca »

Code: Select all

I'm sorry, but an uncaught exception occurred.

Compiling ATL code at game/script.rpy:149
  File "game/script.rpy", line 889, in script
    r "…"
Exception: ConditionSwitch takes an even number of arguments

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "game/script.rpy", line 889, in script
    r "…"
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/ast.py", line 643, in execute
    renpy.exports.say(who, what, interact=self.interact, *args, **kwargs)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/exports.py", line 1176, in say
    who(what, *args, **kwargs)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/character.py", line 1013, in __call__
    self.do_display(who, what, cb_args=self.cb_args, **display_args)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/character.py", line 817, in do_display
    **display_args)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/character.py", line 566, in display_say
    rv = renpy.ui.interact(mouse='say', type=type, roll_forward=roll_forward)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/ui.py", line 287, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/core.py", line 2624, in interact
    repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, **kwargs)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/core.py", line 2999, in interact_core
    root_widget.visit_all(lambda i : i.per_interact())
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/core.py", line 511, in visit_all
    d.visit_all(callback)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/core.py", line 511, in visit_all
    d.visit_all(callback)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/core.py", line 511, in visit_all
    d.visit_all(callback)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/screen.py", line 405, in visit_all
    self.child.visit_all(callback)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/core.py", line 511, in visit_all
    d.visit_all(callback)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/core.py", line 511, in visit_all
    d.visit_all(callback)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/core.py", line 511, in visit_all
    d.visit_all(callback)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/core.py", line 508, in visit_all
    for d in self.visit():
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/atl.py", line 569, in visit
    block = self.compile()
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/atl.py", line 481, in compile
    block = self.atl.compile(self.context)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/atl.py", line 671, in compile
    statements = [ i.compile(ctx) for i in self.statements ]
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/atl.py", line 884, in compile
    child = ctx.eval(expr)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/atl.py", line 246, in eval
    return eval(expr, renpy.store.__dict__, self.context)  # @UndefinedVariable
  File "<string>", line 52, in <module>
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/layout.py", line 1359, in ConditionSwitch
    raise Exception('ConditionSwitch takes an even number of arguments')
Exception: ConditionSwitch takes an even number of arguments

Darwin-17.2.0-x86_64-i386-64bit
Ren'Py 6.99.14.1.3218
PhantasmagoriaHotelDemo 1.0
Thu May 17 21:59:51 2018
I'm not entirely sure why this code came up? I'm trying to put a side image with a speaker in RenPy, and I'm using a LiveComposite/ConditionSwitch image. The code for that is underneath:

Code: Select all

image ri eyes normal shine:
    LiveComposite((400, 720), 
        (0, 0), "ri_eye_normal_shine.png"
    )
    choice:
        4.5
    choice:
        3.5
    choice:
        1.5
    "ri_eye_closed.png"
    .25
    repeat
    
image ri eyes normal dull:
    LiveComposite((400, 720), 
        (0, 0), "ri_eye_normal_dull.png"
    )
    choice:
        4.5
    choice:
        3.5
    choice:
        1.5
    "ri_eye_closed.png"
    .25
    repeat
    
image ri eyes glance shine:
    LiveComposite((400, 720), 
        (0, 0), "ri_eye_glance_shine.png"
    )
    choice:
        4.5
    choice:
        3.5
    choice:
        1.5
    "ri_eye_closed.png"
    .25
    repeat
    
image ri eyes glance dull:
    LiveComposite((400, 720), 
        (0, 0), "ri_eye_glance_dull.png"
    )
    choice:
        4.5
    choice:
        3.5
    choice:
        1.5
    "ri_eye_closed.png"
    .25
    repeat
    
image ri eyes halfshut shine:
    LiveComposite((400, 720), 
        (0, 0), "ri_eye_halfshut_shine.png"
    )
    choice:
        4.5
    choice:
        3.5
    choice:
        1.5
    "ri_eye_closed.png"
    .25
    repeat
    
image ri eyes halfshut dull:
    LiveComposite((400, 720), 
        (0, 0), "ri_eye_halfshut_dull.png"
    )
    choice:
        4.5
    choice:
        3.5
    choice:
        1.5
    "ri_eye_closed.png"
    .25
    repeat
    
image ri eyes squint shine:
    LiveComposite((400, 720), 
        (0, 0), "ri_eye_squint_shine.png"
    )
    choice:
        4.5
    choice:
        3.5
    choice:
        1.5
    "ri_eye_closed.png"
    .25
    repeat
    
image ri eyes squint dull:
    LiveComposite((400, 720), 
        (0, 0), "ri_eye_squint_dull.png"
    )
    choice:
        4.5
    choice:
        3.5
    choice:
        1.5
    "ri_eye_closed.png"
    .25
    repeat
    
image ri eyes wide shine:
    LiveComposite((400, 720), 
        (0, 0), "ri_eye_wide_shine.png"
    )
    choice:
        4.5
    choice:
        3.5
    choice:
        1.5
    "ri_eye_closed.png"
    .25
    repeat
    
image ri eyes wide dull:
    LiveComposite((400, 720), 
        (0, 0), "ri_eye_wide_dull.png"
    )
    choice:
        4.5
    choice:
        3.5
    choice:
        1.5
    "ri_eye_closed.png"
    .25
    repeat
    
image side ri:
    LiveComposite(
        (480, 720),
        (0,0), "ri_body.png",
        (0,0), ConditionSwitch(
            "r_clothes == 'normal'", "ri_outfit_shirt.png",
            "True", "ri_outfit_shirt.png",
            ),
        (0,0), ConditionSwitch(
            "r_eye == 'normal'", "ri eyes normal shine",
            "r_eye == 'dull'", "ri eyes normal dull",
            "r_eye == 'glance'", "ri eyes glance shine",
            "r_eye == 'glance dull'", "ri eyes glance dull",
            "r_eye == 'halfshut'", "ri eyes halfshut shine",
            "r_eye == 'halfshut dull'", "ri eyes halfshut dull",
            "r_eye == 'squint'", "ri eyes squint shine",
            "r_eye == 'squint dull'", "ri eyes squint dull",
            "r_eye == 'wide'", "ri eyes wide shine",
            "r_eye == 'wide dull'", "ri eyes wide dull",
            "True", "ri eyes normal shine",
            ),
        (0,0), ConditionSwitch(
            "r_eyebrow == 'normal'", "ri_eyebrow_normal.png",
            "r_eyebrow == 'angry'", "ri_eyebrow_angry.png",
            "r_eyebrow == 'oneraised'", "ri_eyebrow_oneraised.png",
            "r_eyebrow == 'raised'", "ri_eyebrow_raised.png",
            "r_eyebrow == 'sad'", "ri_eyebrow_sad.png",
            "r_eyebrow == 'thoughtful'", "ri_eyebrow_thoughtful.png",
            "True", "ri_eyebrow_normal.png",
            ),
        (0,0), ConditionSwitch(
            "r_mouth == 'normal'", "ri_mouth_normal.png",
            "r_mouth == 'frown'", "ri_mouth_frown.png",
            "r_mouth == 'smile'", "ri_mouth_smile.png",
            "r_mouth == 'teeth'", "ri_mouth_teeth.png",
            "r_mouth == 'teethgrit'", "ri_mouth_teethgrit.png",
            "r_mouth == 'toothysmile'", "ri_mouth_toothysmile.png",
            "r_mouth == 'open'", "ri_mouth_open.png",
            "r_mouth == 'opengrin'", "ri_mouth_opengrin.png",
            "r_mouth == 'small'", "ri_mouth_small.png",
            "True", "ri_mouth_normal.png",
            ),
        (0,0), ConditionSwitch(
            "r_special == 'blush'", "ri_blush.png",
            "r_special == 'shadow'", "ri_shadow.png",
            "r_special == 'sparkles'", "ri_sparkles.png",
            "r_special == 'sweatdrop'", "ri_sweatdrop.png",
            "r_special == 'tears'", "ri_tears.png",
            "True", "none.png",
            ),
        (0,0), ConditionSwitch(
            "r_camera == 'none'",
            "True", "ri_camera.png",
            ),
        )

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: ConditionSwitch takes an even number of arguments?

#2 Post by Remix »

At the end...

Code: Select all

        (0,0), ConditionSwitch(
            "r_camera == 'none'", ############# <--- missing image
            "True", "ri_camera.png",
            ),
Frameworks & Scriptlets:

ArizaLuca
Veteran
Posts: 241
Joined: Tue Feb 20, 2018 12:59 pm
Completed: Through the Screen, Riddle Me This, Trust Fall, Phobias, Another Adventure
Projects: The Souls in the Seams, Fata Morgana, Minecraft: Story Mode - Behind the Scenes
Organization: Astral Autumn Games
Tumblr: astralautumngames
Deviantart: ArizaLuca
itch: astralautumngames
Contact:

Re: ConditionSwitch takes an even number of arguments?

#3 Post by ArizaLuca »

Ahh... thank you. I'm an idiot. xD

Post Reply

Who is online

Users browsing this forum: Google [Bot]