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.
I'm trying to have a system where you can change certain values through various means. If you change these values, your description in game changes. I've included a small portion, as the rest is simply more numbers and another variable.
But when I try to run it, all I get is this for every line with the if statement:
�ソI'm sorry, but an uncaught exception occurred.
While running game code:
File "game\script.rpy", line 57, in script
SyntaxError: invalid syntax (script.rpy, line 57)
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "C:\Program Files\renpy-6.14.1-sdk\renpy\execution.py", line 266, in run
File "C:\Program Files\renpy-6.14.1-sdk\renpy\ast.py", line 1394, in execute
File "C:\Program Files\renpy-6.14.1-sdk\renpy\python.py", line 1206, in py_eval
File "C:\Program Files\renpy-6.14.1-sdk\renpy\python.py", line 413, in py_compile
SyntaxError: invalid syntax (script.rpy, line 57)
Windows-7-6.1.7601-SP1
Ren'Py 6.14.1.366
A Ren'Py Game 0.0
What is wrong with that code, and how can I fix it?
Last edited by facadepapergirl on Sat Aug 17, 2013 10:40 pm, edited 1 time in total.
facadepapergirl wrote:I'm trying to have a system where you can change certain values through various means. If you change these values, your description in game changes. I've included a small portion, as the rest is simply more numbers and another variable.
But when I try to run it, all I get is this for every line with the if statement:
SyntaxError: invalid syntax (script.rpy, line 57)
What is wrong with that code, and how can I fix it?
There are two things going on here potentially. First off, when you want to check for equality in a conditional statement, it has to be a double equal sign '=='. This will be true for all of the if statements in your code. Also, I don't know the rest of your code, so I don't know if it's intentional or not for you to have a different variable name other than 'chest' after the first 'if' statement. You'll definitely want to change the equal signs though to double equal signs. Think of it this way, a single equal signs means to assign a value and a double equal sign is to check whether or not they are equal.
Sorry, I had changed tits to chest in case I offended people, but it seems that I got distracted and forgot to finish changing it out. So, the double = signs seems to be the answer to my problem. I'll try it tomorrow, and see how it works, though I think that it should be fine. Thank you very much.