A dialogue with "..." makes the game quit... (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
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:

A dialogue with "..." makes the game quit... (SOLVED)

#1 Post by ArizaLuca »

In my script, at the beginning, I have some code that reads as follows:

Code: Select all

label start:
    
    if persistent.sa == False:
        jump socialanxiety
    elif persistent.se == False:
        jump selfesteem
    elif persistent.s == False:
        jump stress
    elif persistent.whatareyoudoinghere == False:
        jump whatareyoudoinghere
    elif persistent.normal == False:
        jump normal
    
label socialanxiety:
    
    $ persistent.sa = True

    show text "Tuesday" at truecenter
    with dissolve
    pause 1.0
    hide text
    with dissolve

    "..."
Up until I added the persistent, the code worked. Now when I try to run the game, it displays this message:

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 44, in script
    "..."
NameError: name 'mode' is not defined

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

Full traceback:
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/bootstrap.py", line 306, in bootstrap
    renpy.main.main()
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/main.py", line 513, in main
    run(restart)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/main.py", line 139, in run
    renpy.execution.run_context(True)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/execution.py", line 879, in run_context
    context.run()
  File "game/script.rpy", line 44, in script
    "..."
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/ast.py", line 652, 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 1199, in say
    who(what, *args, **kwargs)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/character.py", line 1016, 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 2649, 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 3132, in interact_core
    self.draw_screen(root_widget, fullscreen_video, (not fullscreen_video) or video_frame_drawn)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/core.py", line 2055, in draw_screen
    renpy.config.screen_height,
  File "render.pyx", line 485, in renpy.display.render.render_screen
  File "render.pyx", line 233, in renpy.display.render.render
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/layout.py", line 717, in render
    surf = render(child, width, height, cst, cat)
  File "render.pyx", line 145, in renpy.display.render.render
  File "render.pyx", line 233, in renpy.display.render.render
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/layout.py", line 717, in render
    surf = render(child, width, height, cst, cat)
  File "render.pyx", line 145, in renpy.display.render.render
  File "render.pyx", line 233, in renpy.display.render.render
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/layout.py", line 717, in render
    surf = render(child, width, height, cst, cat)
  File "render.pyx", line 145, in renpy.display.render.render
  File "render.pyx", line 233, in renpy.display.render.render
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/screen.py", line 669, in render
    child = renpy.display.render.render(self.child, w, h, st, at)
  File "render.pyx", line 145, in renpy.display.render.render
  File "render.pyx", line 233, in renpy.display.render.render
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/layout.py", line 717, in render
    surf = render(child, width, height, cst, cat)
  File "render.pyx", line 145, in renpy.display.render.render
  File "render.pyx", line 233, in renpy.display.render.render
  File "accelerator.pyx", line 108, in renpy.display.accelerator.transform_render
  File "render.pyx", line 233, in renpy.display.render.render
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/image.py", line 495, in render
    return wrap_render(self.target, width, height, st, at)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/image.py", line 306, in wrap_render
    rend = render(child, w, h, st, at)
  File "render.pyx", line 145, in renpy.display.render.render
  File "render.pyx", line 233, in renpy.display.render.render
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/layout.py", line 331, in render
    surf = render(self.child, width, height, st, at)
  File "render.pyx", line 145, in renpy.display.render.render
  File "render.pyx", line 233, in renpy.display.render.render
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/layout.py", line 1258, in render
    self.update(st, at)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/layout.py", line 1245, in update
    child, redraw = self.function(st, at, *self.args, **self.kwargs)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/layout.py", line 1316, in condition_switch_show
    return condition_switch_pick(switch), None
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/layout.py", line 1309, in condition_switch_pick
    if renpy.python.py_eval_bytecode(code):
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/python.py", line 1936, in py_eval_bytecode
    return eval(bytecode, globals, locals)
  File "<none>", line 1, in <module>
NameError: name 'mode' is not defined

Darwin-17.7.0-x86_64-i386-64bit
Ren'Py 7.0.0.196
Phobias 1.0
Fri Sep 21 15:19:34 2018
What's the problem?

Thanks!
Last edited by ArizaLuca on Fri Sep 21, 2018 9:03 pm, edited 1 time in total.

User avatar
PyTom
Ren'Py Creator
Posts: 16088
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:

Re: A dialogue with "..." makes the game quit...

#2 Post by PyTom »

This is an error that involves a ConditionSwitch that accesses a variable named 'mode'.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

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: A dialogue with "..." makes the game quit...

#3 Post by ArizaLuca »

I changed the ConditionSwitch argument to:

Code: Select all

image side portrait = ConditionSwitch(
    "mode == 'social anxiety'", "msa",
    "mode == 'self esteem'", "mse",
    "mode == 'stress'", "ms",
    "mode == 'normal'", "mn",
    "True", "mn",
    )
Now the error appears to be:

Code: Select all

I'm sorry, but an uncaught exception occurred.

Compiling ATL code at game/images.rpy:176
  File "game/script.rpy", line 51, in script
    "..."
  File "renpy/common/000window.rpy", line 98, in _window_auto_callback
    _window_show()
  File "renpy/common/000window.rpy", line 60, in _window_show
    renpy.with_statement(trans)
Exception: ConditionSwitch takes an even number of arguments

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

Full traceback:
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/bootstrap.py", line 306, in bootstrap
    renpy.main.main()
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/main.py", line 513, in main
    run(restart)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/main.py", line 139, in run
    renpy.execution.run_context(True)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/execution.py", line 879, in run_context
    context.run()
  File "game/script.rpy", line 51, in script
    "..."
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/ast.py", line 618, in execute
    statement_name("say")
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/ast.py", line 43, in statement_name
    i(name)
  File "renpy/common/000window.rpy", line 98, in _window_auto_callback
    _window_show()
  File "renpy/common/000window.rpy", line 60, in _window_show
    renpy.with_statement(trans)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/exports.py", line 1452, in with_statement
    return renpy.game.interface.do_with(trans, paired, clear=clear)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/core.py", line 2207, in do_with
    clear=clear)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/core.py", line 2649, 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 3132, in interact_core
    self.draw_screen(root_widget, fullscreen_video, (not fullscreen_video) or video_frame_drawn)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/core.py", line 2055, in draw_screen
    renpy.config.screen_height,
  File "render.pyx", line 485, in renpy.display.render.render_screen
  File "render.pyx", line 233, in renpy.display.render.render
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/layout.py", line 717, in render
    surf = render(child, width, height, cst, cat)
  File "render.pyx", line 145, in renpy.display.render.render
  File "render.pyx", line 233, in renpy.display.render.render
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/transition.py", line 359, in render
    top = render(self.new_widget, width, height, st, at)
  File "render.pyx", line 145, in renpy.display.render.render
  File "render.pyx", line 233, in renpy.display.render.render
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/layout.py", line 717, in render
    surf = render(child, width, height, cst, cat)
  File "render.pyx", line 145, in renpy.display.render.render
  File "render.pyx", line 233, in renpy.display.render.render
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/layout.py", line 717, in render
    surf = render(child, width, height, cst, cat)
  File "render.pyx", line 145, in renpy.display.render.render
  File "render.pyx", line 233, in renpy.display.render.render
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/screen.py", line 669, in render
    child = renpy.display.render.render(self.child, w, h, st, at)
  File "render.pyx", line 145, in renpy.display.render.render
  File "render.pyx", line 233, in renpy.display.render.render
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/layout.py", line 717, in render
    surf = render(child, width, height, cst, cat)
  File "render.pyx", line 145, in renpy.display.render.render
  File "render.pyx", line 233, in renpy.display.render.render
  File "accelerator.pyx", line 108, in renpy.display.accelerator.transform_render
  File "render.pyx", line 233, in renpy.display.render.render
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/image.py", line 495, in render
    return wrap_render(self.target, width, height, st, at)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/image.py", line 306, in wrap_render
    rend = render(child, w, h, st, at)
  File "render.pyx", line 145, in renpy.display.render.render
  File "render.pyx", line 233, in renpy.display.render.render
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/layout.py", line 331, in render
    surf = render(self.child, width, height, st, at)
  File "render.pyx", line 145, in renpy.display.render.render
  File "render.pyx", line 233, in renpy.display.render.render
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/layout.py", line 1258, in render
    self.update(st, at)
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/layout.py", line 1247, in update
    child.visit_all(lambda c : c.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 508, in visit_all
    for d in self.visit():
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/atl.py", line 574, 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 676, in compile
    statements = [ i.compile(ctx) for i in self.statements ]
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/atl.py", line 889, 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 20, in <module>
  File "/Users/arizaluca/Desktop/renpy-6.99.13-sdk/renpy/display/layout.py", line 1366, in ConditionSwitch
    raise Exception('ConditionSwitch takes an even number of arguments')
Exception: ConditionSwitch takes an even number of arguments

Darwin-17.7.0-x86_64-i386-64bit
Ren'Py 7.0.0.196
Phobias 1.0
Fri Sep 21 16:29:36 2018

User avatar
xavimat
Eileen-Class Veteran
Posts: 1460
Joined: Sat Feb 25, 2012 8:45 pm
Completed: Yeshua, Jesus Life, Cops&Robbers
Projects: Fear&Love, unknown
Organization: Pilgrim Creations
Github: xavi-mat
itch: pilgrimcreations
Location: Spain
Contact:

Re: A dialogue with "..." makes the game quit... (SOLVED)

#4 Post by xavimat »

Try deleting the last comma in the line

Code: Select all

"True", "mn",
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot]