Quiz Section of Chapter 1 Not Working

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
DeathhunterAshi
Newbie
Posts: 6
Joined: Sat Jul 29, 2017 3:44 am
Completed: Death Hunter's Requiem, Godly Promotion
Projects: Death Hunter's Requiem [Completed], Godly Promotion [Completed]
Tumblr: menacingheatashi
itch: deathhunterashi
Discord: DHAshi#3476
Contact:

Quiz Section of Chapter 1 Not Working

#1 Post by DeathhunterAshi »

Hi, I've been working on the last part of Chapter 1 for my Visual Novel and trying to put in more than two choices for the answer to the question. Four answers to correspond to the four characters available for each route and this is how the code looks at the moment:

Code: Select all

label quiz:
    "IF ONE MUST KNOW ANSWERS, ONE MUST KNOW OF THY QUESTIONS OWN."
    y "Questions to what answer? That didn't make any sense."
    "The so-called questions appeared on the very tree I was in front of. And was in Greek too."
    "Making quick work of the translation, the questions stumped me."
    
    #Initialize score
    $ quiz_score = 0
    
    # 1st Question
    
    "Just how far are you willing to bury your past for a good future?"
    menu: 
        "A - Far enough that I'll take out anyone pertaining to it.":
            y "There's no need for those in the present to know what I did back then."
        $ quiz_score += 6
        "B - I don't need to bury my past to get a good ending.":
            y "There are some good things from the past too, its best to keep them in mind."
        $ quiz_score += 4
        "C - Enough that it doesn't affect my family negatively.":
            y "I don't want to erase my family because of one little mistake."
        $ quiz_score += 2
        "D - I'd rather stay within the present thank you very much.":
            y "It sounds cool, but too many series end with it being screwed over thanks to that." 
        $ quiz_score += 1
But when I try to test-play it, it instead comes up with saying this for each part of the quiz.

Code: Select all

File "game/script.rpy", line 634: expected menuitem
    $ quiz_score += 6
    ^

File "game/script.rpy", line 651: expected menuitem
    $ quiz_score += 2
    ^

File "game/script.rpy", line 668: expected menuitem
    $ quiz_score += 1
    ^

File "game/script.rpy", line 685: expected menuitem
    $ quiz_score += 2
    ^

Ren'Py Version: Ren'Py 6.99.12.2.2029
Is there a way to fix it? I really want this to work for the crucial part of the chapter. Thank you for listening!
"Joey: This is…this is my power! The Cursed Vampiric Left Hand!"

"That’s right...this is my power. The power I wished for so badly because I wanted to save someone."

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: Quiz Section of Chapter 1 Not Working

#2 Post by Remix »

Indent the $ lines one more tab, so they are inline vertically with the y "words" lines rather than with the menu choices
Frameworks & Scriptlets:

User avatar
DeathhunterAshi
Newbie
Posts: 6
Joined: Sat Jul 29, 2017 3:44 am
Completed: Death Hunter's Requiem, Godly Promotion
Projects: Death Hunter's Requiem [Completed], Godly Promotion [Completed]
Tumblr: menacingheatashi
itch: deathhunterashi
Discord: DHAshi#3476
Contact:

Re: Quiz Section of Chapter 1 Not Working

#3 Post by DeathhunterAshi »

Omg thank you so much! It finally works after so long! Now I can finally get to working on Chapter 2 and the rest of the game!
"Joey: This is…this is my power! The Cursed Vampiric Left Hand!"

"That’s right...this is my power. The power I wished for so badly because I wanted to save someone."

Post Reply

Who is online

Users browsing this forum: Ocelot