Need Help 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
Silvey
Newbie
Posts: 3
Joined: Sat Mar 28, 2015 3:26 pm
Skype: skyangels003
Contact:

Need Help D:

#1 Post by Silvey » Sun Mar 29, 2015 8:04 pm

I am trying to add achievements into my game, but apparently I'm doing something wrong ;-;
Error report=

Code: Select all

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


File "game/script.rpy", line 276: expected statement.
    achievement.grant(GET THE BEST ENDING~):
                                           ^

File "game/untitled 1.rpy", line 1: expected statement.
    achievement.register(GET THE BEST ENDING~, **kwargs):
                                                        ^

File "game/untitled 1.rpy", line 2: expected statement.
    achievement.register(GET ALL BAD ENDINGS~, **kwargs):
                                                        ^

File "game/untitled 1.rpy", line 3: expected statement.
    achievement.register(GET ALL ENDINGS, **kwargs):
                                                   ^

File "game/untitled 1.rpy", line 4: expected statement.
    achievement.register(GET ALL GOOD ENDINGS, **kwargs):
                                                        ^

File "game/untitled 1.rpy", line 7: expected statement.
    achievement.grant(GET ALL ENDINGS~):
                                       ^

File "game/untitled 1.rpy", line 10: expected statement.
    achievement.grant(GET ALL GOOD ENDINGS~):
                                            ^

File "game/untitled 1.rpy", line 13: expected statement.
    achievement.grant(GET ALL BAD ENDINGS~):
                                           ^

Ren'Py Version: Ren'Py 6.99.0.303


the script that has those errors=

Code: Select all

achievement.register(GET THE BEST ENDING~, **kwargs):
    
achievement.register(GET ALL BAD ENDINGS~, **kwargs):
    
achievement.register(GET ALL ENDINGS, **kwargs):
    
achievement.register(GET ALL GOOD ENDINGS, **kwargs):
    

if persistant_allend_points = 10:
    achievement.grant(GET ALL ENDINGS~):
        
    
if persistant_good_points = 2:
    achievement.grant(GET ALL GOOD ENDINGS~):
        
    
if persistant_bad_points = 8:
     achievement.grant(GET ALL BAD ENDINGS~):



the part of my other script that has errors=

Code: Select all

label fight:
    "You knocked them out, and realize they had a knife along with a gun."
    
    "-----Few Days Later------"
    
    "You and Rina turned The Stranger over to the police, and as it turns out The Stranger was a serial killer."
    
    "You caught The Stranger and protected Rina! BEST ENDING!!!!"
    $ persistant_good_points += 1
    $ persistant_allend_points += 1
    achievement.grant(GET THE BEST ENDING~):
I'd really like to know how to fix this, and sorry if I made any simple errors as I am very new to this! >~<

User avatar
yuucie
Regular
Posts: 164
Joined: Sun Jun 22, 2014 4:04 am
Completed: NaNoReNo[2015] Those Without Names
Tumblr: an-na-ko
Location: Toronto, Canada
Contact:

Re: Need Help D:

#2 Post by yuucie » Sun Mar 29, 2015 8:17 pm

You can't run the script with a menu hanging without content. Add something in each of them and try again.

User avatar
Zetsubou
Miko-Class Veteran
Posts: 513
Joined: Wed Mar 05, 2014 1:00 am
Completed: See my signature
Github: koroshiya
itch: zetsuboushita
Contact:

Re: Need Help D:

#3 Post by Zetsubou » Sun Mar 29, 2015 8:19 pm

Get rid of the colons on the ends of the achievement.grant and achievement.register statements.
I think you'll also need to add dollar signs before achievement, remove kwargs, and give names as strings.

eg.

Code: Select all

$ achievement.register("GET ALL GOOD ENDINGS")

if persistant_allend_points = 10:
    $ achievement.grant("GET ALL GOOD ENDINGS")
Finished games
-My games: Sickness, Wander No More, Max Massacre, Humanity Must Perish, Tomboys Need Love Too, Sable's Grimoire, My Heart Grows Fonder, Man And Elf, A Dragon's Treasure
-Commissions: No One But You, Written In The Sky, Diamond Rose, To Libertad, Catch Canvas, Love Ribbon, Happy Campers, Wolf Tails

Working on:
Sable's Grimoire 2

Image

Silvey
Newbie
Posts: 3
Joined: Sat Mar 28, 2015 3:26 pm
Skype: skyangels003
Contact:

Re: Need Help D:

#4 Post by Silvey » Sun Mar 29, 2015 8:44 pm

Zetsubou wrote:Get rid of the colons on the ends of the achievement.grant and achievement.register statements.
I think you'll also need to add dollar signs before achievement, remove kwargs, and give names as strings.

eg.

Code: Select all

$ achievement.register("GET ALL GOOD ENDINGS")

if persistant_allend_points = 10:
    $ achievement.grant("GET ALL GOOD ENDINGS")
Thanks this helped ^w^ and I also got this error after fixing it=

Code: Select all

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


File "game/script.rpy", line 276: invalid syntax
    achievement.grant(GET THE BEST ENDING~)
                             ^

User avatar
Hijiri
Eileen-Class Veteran
Posts: 1519
Joined: Sun Mar 25, 2012 6:35 pm
Completed: Death Rule:lost code Overdrive Edition, Where the White Doves Rest-Tsumihanseishi
Projects: Death Rule: Killing System
Organization: MESI Games
IRC Nick: Hizi
Tumblr: mesigames
Skype: kurotezuka
itch: hijiri
Location: Los Angeles
Contact:

Re: Need Help D:

#5 Post by Hijiri » Sun Mar 29, 2015 8:45 pm

Silvey wrote:
Zetsubou wrote:Get rid of the colons on the ends of the achievement.grant and achievement.register statements.
I think you'll also need to add dollar signs before achievement, remove kwargs, and give names as strings.

eg.

Code: Select all

$ achievement.register("GET ALL GOOD ENDINGS")

if persistant_allend_points = 10:
    $ achievement.grant("GET ALL GOOD ENDINGS")
Thanks this helped ^w^ and I also got this error after fixing it=

Code: Select all

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


File "game/script.rpy", line 276: invalid syntax
    achievement.grant(GET THE BEST ENDING~)
                             ^
You forgot the quotes:

Code: Select all

    achievement.grant("GET THE BEST ENDING~")
                             
Image Image
"Perfection goal that always changes. Can pursue, cannot obtain."

Silvey
Newbie
Posts: 3
Joined: Sat Mar 28, 2015 3:26 pm
Skype: skyangels003
Contact:

Re: Need Help D:

#6 Post by Silvey » Sun Mar 29, 2015 8:48 pm

Hijiri wrote:
Silvey wrote:
Zetsubou wrote:Get rid of the colons on the ends of the achievement.grant and achievement.register statements.
I think you'll also need to add dollar signs before achievement, remove kwargs, and give names as strings.

eg.

Code: Select all

$ achievement.register("GET ALL GOOD ENDINGS")

if persistant_allend_points = 10:
    $ achievement.grant("GET ALL GOOD ENDINGS")
Thanks this helped ^w^ and I also got this error after fixing it=

Code: Select all

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


File "game/script.rpy", line 276: invalid syntax
    achievement.grant(GET THE BEST ENDING~)
                             ^
You forgot the quotes:

Code: Select all

    achievement.grant("GET THE BEST ENDING~")
                             
Thank you so much qwq I think I love you

Post Reply

Who is online

Users browsing this forum: Google [Bot]