Jump to label If issue

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
poep
Regular
Posts: 47
Joined: Tue Feb 04, 2014 1:26 pm
Contact:

Jump to label If issue

#1 Post by poep »

At the start of the game the following is asked of the player:

Code: Select all

 menu:
        "At the start of the story you read the events from [name]'s perspective. Later in the story events without [name] can be seen from his wife Fiona's perspective. Do you want to see these events or read the story just from [name]'s perspective?"

        "Include events from Fiona's perspective.":
            $ fiona_perspective = True

        "Only read scenes from the protagonist's perspective.":
            $ fiona_perspective = False

Code: Select all

On line 2248 this is first used:
if $ fiona_perspective == True:
        jump fiona1
    else:
        jump nofiona1
Now the game gives the following error:

Code: Select all

I'm sorry, but an uncaught exception occurred.

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

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

Full traceback:
  File "game/game.rpy", line 2248, in script
    if $ fiona_perspective == True:
  File "C:\Users\me_\Downloads\renpy-6.99.14-sdk\renpy\ast.py", line 1702, in execute
    if renpy.python.py_eval(condition):
  File "C:\Users\me_\Downloads\renpy-6.99.14-sdk\renpy\python.py", line 1833, in py_eval
    code = py_compile(code, 'eval')
  File "C:\Users\me_\Downloads\renpy-6.99.14-sdk\renpy\python.py", line 630, in py_compile
    raise e
SyntaxError: invalid syntax (game/game.rpy, line 2248)

Windows-8-6.2.9200
Ren'Py 6.99.14.3135
Swing & Miss 0.23.2
I've been unable for figure out, any help would be appreciated.

User avatar
IrinaLazareva
Veteran
Posts: 399
Joined: Wed Jun 08, 2016 1:49 pm
Projects: Legacy
Organization: SunShI
Location: St.Petersburg, Russia
Contact:

Re: Jump to label If issue

#2 Post by IrinaLazareva »

poep wrote: Sun Sep 02, 2018 9:22 am

Code: Select all

On line 2248 this is first used:
if $ fiona_perspective == True:
        jump fiona1
    else:
        jump nofiona1

Code: Select all

if fiona_perspective:
        jump fiona1
    else:
        jump nofiona1
https://www.renpy.org/doc/html/conditio ... -statement

poep
Regular
Posts: 47
Joined: Tue Feb 04, 2014 1:26 pm
Contact:

Re: Jump to label If issue

#3 Post by poep »

Thank you very much!

Post Reply

Who is online

Users browsing this forum: No registered users