Point system SyntaxError [SOLVED]

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
User avatar
EmberSH
Newbie
Posts: 7
Joined: Sun Dec 16, 2018 1:23 am
Tumblr: EmberSHx
Deviantart: EmberShadowHawk
Contact:

Point system SyntaxError [SOLVED]

#1 Post by EmberSH »

I've been running through the threads I can find and can't find a solution. Sorry if it's really obvious.

I'm getting the message:
While running game code:
File "game/script.rpy", line 138, in script
if kLike < 35:
SyntaxError: invalid syntax (game/script.rpy, line 138)

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

Full traceback:
File "game/script.rpy", line 138, in script
if kLike < 35:
File "C:\Users\Ember\Downloads\renpy-7.1.3-sdk\renpy\ast.py", line 1762, in execute
if renpy.python.py_eval(condition):
File "C:\Users\Ember\Downloads\renpy-7.1.3-sdk\renpy\python.py", line 1942, in py_eval
code = py_compile(code, 'eval')
File "C:\Users\Ember\Downloads\renpy-7.1.3-sdk\renpy\python.py", line 674, in py_compile
raise e
SyntaxError: invalid syntax (game/script.rpy, line 138)
Starting at line 136 the code (cutting out dialog for readability) is:
(All of the options end with a functioning jump command)
label K_Met:
"The area boots up around you."
if kLike < 35:
$ kGreetCold = renpy.random.choice(("1", "2", "3"))
if kGreetCold == "1":
...
if kGreetCold == "2":
...
if kGreetCold == "3":
...
elif kLike > 36 and < 45:
$ kGreetSad = renpy.random.choice(("1", "2", "3"))
if kGreetSad == "1":
...
if kGreetSad == "2":
...
if kGreetSad == "3":
...
elif kLike > 60 and < 75:
$ kGreetHappy = renpy.random.choice(("1", "2", "3"))
if kGreetHappy == "1":
...
if kGreetHappy = "2":
...
if kGreetHappy == "3":
...
elif kLike > 76:
$ kGreetJoy = renpy.random.choice(("1", "2", "3"))
if kGreetJoy == "1":
...
if kGreetJoy == "2":
...
if kGreetJoy == "3":
...
else :
$ kGreet = renpy.random.choice(("1", "2", "3"))
if kGreet == "1":
...
if kGreet == "2":
...
if kGreet == "3":
...
the kLike points are defined at the start as being 50 and I'm accessing this to test from a route that should put me in the 'else' section.

If anyone can help I would really appreciate it.
(The indents aren't showing up. Trying to fix it but if you can see this message I haven't managed yet)
Last edited by EmberSH on Sun Dec 16, 2018 2:35 pm, edited 1 time in total.

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

Re: Point system SyntaxError

#2 Post by IrinaLazareva »

the problem in line:

Code: Select all

    elif kLike > 36 and < 45:
and below.

Try to replace it to:

Code: Select all

    elif kLike > 36 and kLike < 45:
or

Code: Select all

    elif 45 > kLike > 36:
and etc...

User avatar
EmberSH
Newbie
Posts: 7
Joined: Sun Dec 16, 2018 1:23 am
Tumblr: EmberSHx
Deviantart: EmberShadowHawk
Contact:

Re: Point system SyntaxError [SOLVED]

#3 Post by EmberSH »

Thank you so much! It seems so obvious now in retrospect ^^;

Post Reply

Who is online

Users browsing this forum: No registered users