[Solved] Invalid syntax error

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
Nicolajsej123
Newbie
Posts: 8
Joined: Sun Jan 20, 2019 10:10 am
Contact:

[Solved] Invalid syntax error

#1 Post by Nicolajsej123 »

Hey still figuring stuff out on renpy, I've set a $ value to a person if you agree or disagree to do that with True/False, but I'm having trouble getting the game to jump to different lines based on if the player chose yes or no.

Here's the error

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 309, in script
    if $ jshowedroom = True:
SyntaxError: invalid syntax (game/script.rpy, line 309)

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

Full traceback:
  File "game/script.rpy", line 309, in script
    if $ jshowedroom = True:
  File "D:\Downloads\renpy-7.1.3-sdk\renpy\ast.py", line 1762, in execute
    if renpy.python.py_eval(condition):
  File "D:\Downloads\renpy-7.1.3-sdk\renpy\python.py", line 1942, in py_eval
    code = py_compile(code, 'eval')
  File "D:\Downloads\renpy-7.1.3-sdk\renpy\python.py", line 674, in py_compile
    raise e
SyntaxError: invalid syntax (game/script.rpy, line 309)

Windows-8-6.2.9200
Ren'Py 7.1.3.1092
BAE School 1.0
Fri Feb 15 00:29:02 2019

Check the picture below
Attachments
Udklip.PNG
Last edited by Nicolajsej123 on Fri Feb 15, 2019 4:50 am, edited 1 time in total.

User avatar
isobellesophia
Miko-Class Veteran
Posts: 979
Joined: Mon Jan 07, 2019 2:55 am
Completed: None
Projects: Maddox and Friends! (AI Teacher friend), Friendly Universities! (Soon)
Organization: Friendly Teachers series
Deviantart: SophBelle
itch: Child Creation
Location: Philippines, Mindanao
Contact:

Re: Invalid syntax error

#2 Post by isobellesophia »

The problem is the

Code: Select all

if $ jshowdroom = True:
You must define it to True when the one dialogue is readed.

Code: Select all

"Blah blah blah"
$ jshowedroom = True
It must be

Code: Select all

If jshowedroom:
when it is set to True

And make sure you defined the variable above.

Code: Select all

$ jshowedroom = False
I am a friendly user, please respect and have a good day.


Image

Image


Nicolajsej123
Newbie
Posts: 8
Joined: Sun Jan 20, 2019 10:10 am
Contact:

Re: Invalid syntax error

#3 Post by Nicolajsej123 »

I solved it, i just had to write jshowedroom == True:

instead of jshowedroom = True:

Post Reply

Who is online

Users browsing this forum: No registered users