I'm getting a syntax error regarding the ConditionSwitch, which is really weird because I'm using it exactly how the example in the documentation is coded.
Code: Select all
I'm sorry, but an uncaught exception occurred.
While running game code:
File "game/script.rpy", line 11, in script
image trina_cs = ConditionSwitch(
File "game/script.rpy", line 11, in script
image trina_cs = ConditionSwitch(
File "game/script.rpy", line 11, in <module>
image trina_cs = ConditionSwitch(
SyntaxError: invalid syntax (<none>, line 1)
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "C:\Users\zero557\Desktop\Programs\renpy-8.0.3-sdk\renpy\bootstrap.py", line 277, in bootstrap
renpy.main.main()
File "C:\Users\zero557\Desktop\Programs\renpy-8.0.3-sdk\renpy\main.py", line 558, in main
renpy.game.context().run(node)
File "game/script.rpy", line 11, in script
image trina_cs = ConditionSwitch(
File "/home/tom/ab/renpy-build/tmp/install.linux-x86_64/lib/python3.9/site-packages/future/utils/__init__.py", line 441, in raise_
File "game/script.rpy", line 11, in script
image trina_cs = ConditionSwitch(
File "C:\Users\zero557\Desktop\Programs\renpy-8.0.3-sdk\renpy\ast.py", line 1230, in execute
img = renpy.python.py_eval_bytecode(self.code.bytecode)
File "C:\Users\zero557\Desktop\Programs\renpy-8.0.3-sdk\renpy\python.py", line 1085, in py_eval_bytecode
return eval(bytecode, globals, locals)
File "game/script.rpy", line 11, in <module>
image trina_cs = ConditionSwitch(
File "C:\Users\zero557\Desktop\Programs\renpy-8.0.3-sdk\renpy\display\layout.py", line 1652, in ConditionSwitch
code = renpy.python.py_compile(cond, 'eval')
File "C:\Users\zero557\Desktop\Programs\renpy-8.0.3-sdk\renpy\python.py", line 1027, in py_compile
raise e
File "C:\Users\zero557\Desktop\Programs\renpy-8.0.3-sdk\renpy\python.py", line 979, in py_compile
raise orig_e
File "C:\Users\zero557\Desktop\Programs\renpy-8.0.3-sdk\renpy\python.py", line 972, in py_compile
tree = compile(source, filename, py_mode, ast.PyCF_ONLY_AST | flags, 1)
SyntaxError: invalid syntax (<none>, line 1)
Here's the code I've written, again I'm still very new to Ren'Py but I don't see what I'm doing wrong here. I've doublechecked that the spelling of the .png files is correct, and speaking_char is given a default value of 'None' in the auto callback script.
Code: Select all
define trina = Character("Trina", callback = name_callback, cb_name = "trina", color="#00a716")
image trina_cs = ConditionSwitch(
"speaking_char = trina", "trina_neutral_talk.png",
"True", "trina_neutral.png")
image trina neutral = At('trina_cs', sprite_highlight('trina'))
I'm hoping your idea works as the chelsea_neutral refers to the .png file itself rather than an image definition made in Ren'Py. That'd be pretty neat if i can refer to either a .png file or an image definition, because then in theory I could just nest the image definition a bunch of times and apply different effects to it each time.