Name Error: name [variable] is not defined (but it is?)[SOLVE:D]

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
PeachStar1
Newbie
Posts: 6
Joined: Mon Apr 12, 2021 8:18 am
itch: PeachStarStudios
Contact:

Name Error: name [variable] is not defined (but it is?)[SOLVE:D]

#1 Post by PeachStar1 »

So uhh help

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 181, in script
    if $RobinRel >= 2:
SyntaxError: invalid syntax (script.rpy, line 181)

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

Full traceback:
  File "game/script.rpy", line 181, in script
    if $RobinRel >= 2:
  File "/Users/flckl/Desktop/renpy-7.4.0-sdk/renpy/ast.py", line 1843, in execute
    if renpy.python.py_eval(condition):
  File "/Users/flckl/Desktop/renpy-7.4.0-sdk/renpy/python.py", line 2140, in py_eval
    code = py_compile(code, 'eval')
  File "/Users/flckl/Desktop/renpy-7.4.0-sdk/renpy/python.py", line 746, in py_compile
    raise e
SyntaxError: invalid syntax (script.rpy, line 181)

Code: Select all

    r "Well, we're finished!"
    pause
    r "What do you guys think?"
    pause
    if RobinRel >= 2:
        jump Robinlikesursong
    elif AntRel >= 2:
        jump Antlikesursong
    elif SkyRel >= 2:
        jump Skylikesursong
    elif RobinRel == 1 and AntRel == 1 and SkyRel == 1:
        jump alllikeursong
       
I don't know what I can do? Help I really want to release the demo of this game!
Last edited by PeachStar1 on Mon May 17, 2021 11:30 am, edited 1 time in total.

User avatar
mavyxdawn
Regular
Posts: 72
Joined: Sun Dec 20, 2015 6:18 pm
Github: mavyxdawn
itch: zeillearnings
Discord: _zeil
Contact:

Re: Name Error: name [variable] is not defined (but it is?)

#2 Post by mavyxdawn »

It says invalid syntax but the syntax is correct. Did you create RobinRel correctly?

Code: Select all

default RobinRel = 0
Edit: Maybe you could also add the error from your title? "Name Error: name [variable] is not defined"
YouTube: Zeil Learnings
itch.io: Zeil Learnings

Image

PeachStar1
Newbie
Posts: 6
Joined: Mon Apr 12, 2021 8:18 am
itch: PeachStarStudios
Contact:

Re: Name Error: name [variable] is not defined (but it is?)

#3 Post by PeachStar1 »

Thank you this fixed the problem!

User avatar
mavyxdawn
Regular
Posts: 72
Joined: Sun Dec 20, 2015 6:18 pm
Github: mavyxdawn
itch: zeillearnings
Discord: _zeil
Contact:

Re: Name Error: name [variable] is not defined (but it is?)

#4 Post by mavyxdawn »

nice! You're welcome :D
YouTube: Zeil Learnings
itch.io: Zeil Learnings

Image

Post Reply

Who is online

Users browsing this forum: Google [Bot]