This is the code I'm using
Code: Select all
label fightvariables:
$ RandomFirst = renpy.random.randint(0, 3)
if RandomFirst == 0:
$ arrow_one = arrow_down
$ ArrowOne = ArrowDown
elif RandomFirst == 1:
$ arrow_one = arrow_up
$ ArrowOne = ArrowUp
elif RandomFirst == 2:
$ arrow_one = arrow_right
$ ArrowOne = ArrowRight
elif RandomFirst == 3:
$ arrow_one = arrow_left
$ ArrowOne = ArrowLeft
return
label Beforefighting:
call fightvariables
image ArrowOne = ConditionSwitch (
"[ArrowOne]Active == True", "fighting/arrows/[arrow_one]_active.png",
"True", "fighting/arrows/[arrow_one]_idle.png")
Code: Select all
I'm sorry, but an uncaught exception occurred.
While running game code:
File "game/fight.rpy", line 5, in script
image ArrowOne = ConditionSwitch (
File "game/fight.rpy", line 5, in script
image ArrowOne = ConditionSwitch (
File "game/fight.rpy", line 7, in <module>
"True", "fighting/arrows/[arrow_one]_idle.png")
SyntaxError: invalid syntax (<none>, line 1)
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "renpy/bootstrap.py", line 326, in bootstrap
renpy.main.main()
File "renpy/main.py", line 515, in main
renpy.game.context().run(node)
File "game/fight.rpy", line 5, in script
image ArrowOne = ConditionSwitch (
File "game/fight.rpy", line 5, in script
image ArrowOne = ConditionSwitch (
File "renpy/ast.py", line 1021, in execute
img = renpy.python.py_eval_bytecode(self.code.bytecode)
File "renpy/python.py", line 2242, in py_eval_bytecode
return eval(bytecode, globals, locals)
File "game/fight.rpy", line 7, in <module>
"True", "fighting/arrows/[arrow_one]_idle.png")
File "renpy/display/layout.py", line 1472, in ConditionSwitch
code = renpy.python.py_compile(cond, 'eval')
File "renpy/python.py", line 835, in py_compile
raise e
SyntaxError: invalid syntax (<none>, line 1)
Windows-8.1-6.3.9600
Ren'Py 7.4.4.1439
conditionswitch 1.0
Fri May 7 16:14:26 2021