[Help] invaild syntax, I don't know what's wrong

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
smrehd
Newbie
Posts: 1
Joined: Sun May 12, 2019 3:35 am
Contact:

[Help] invaild syntax, I don't know what's wrong

#1 Post by smrehd » Sun May 12, 2019 3:47 am

init python:
def ending(truth):
global<goodending>
global<badending>

if truth >=0:
renpy.jump(goodending)
else:
renpy.jump(badending)
return
ren'py says green lines are invaild, I'm not sure what's wrong...

I'm sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.


File "game/script.rpy", line 42: invalid syntax
global<"goodending">:
^

User avatar
SONTSE
Regular
Posts: 95
Joined: Sun Nov 24, 2013 10:49 pm
Completed: 8 VN's so far
Contact:

Re: [Help] invaild syntax, I don't know what's wrong

#2 Post by SONTSE » Sun May 12, 2019 4:28 am

Code: Select all

init python:
    def ending(truth):
        global goodending
        global badending
        if truth >=0:
            renpy.jump(goodending)
        else:
            renpy.jump(badending)
        return
you don't need angle brackets to declare global vars in python
Look! It's moving. It's alive. It's alive... IT'S ALIVE! Oh, in the name of God! Now I know what it feels like to be God!(@Henry_Frankenstein. Sums up my coding style)

Post Reply

Who is online

Users browsing this forum: Google [Bot]