End of Line Expected Statement on "If" choice menu

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
Machiner
Newbie
Posts: 2
Joined: Wed Jul 02, 2014 8:02 pm
Contact:

End of Line Expected Statement on "If" choice menu

#1 Post by Machiner »

So I'm trying to do an "if value x >= #y then don't show option z". To complicate matters, I've got a series right before that that won't work properly, needing "ends of statements" but no matter where I put any punctuation, nothing changes and I get errors. I need held figuring it out.

Code: Select all

"Test Paper" "Topic: Science"
     "Test Paper" "In the classification of life, what comes after Kingdom?"
     menu:
         "Phylum":
          $ Science += 2
         "Species":
          $ Science += 1
         "Cells":
          $ Science += 0
         "Skip":
          $ Science -= 1
     "Test Paper" "Topic: Math"
     "Test Paper" "Acceleration, in its most applicabel form, is best described as..."
     menu:
         "dv/dt":
          $ Math += 2
         "Change in velocity":
          $ Math += 1
         "dx/dt":
          $ Math += 0
         "Skip":
          $ Math -= 1
     "Test Paper" "Topic: Language Arts"
     "Test Paper" "Which of the following is a simile?"
     menu:
         "His hair looked like a porcupine.":
          $ LA += 0
         "His hair was a porcupine.":
          $ LA += 1
         "Skip":
          $ LA -= 1
     "Test Paper" "Extracurricular Activities"
     "Test Paper" "Please select 3"
     label extra_choice:
      menu:
        "Test Paper" "Choir" if choir == False:
         $ choir = True
         jump point_check
        "Test Paper" "Band" if band == False:
         $ band = True
         jump point_check
        "Test Paper" "Art" if art == False:
         $ art = True
         jump point_check
        "Test Paper" "Sports" if sports == False:
         $ sports = True
         jump point_check
        "Test Paper" "Drama" if drama == False:
         $ drama = True
         jump point_check
        "Test Paper" "Programming" if program == False:
         $ program = True
         jump point_check
     label point_check:
      if choices >= 3:
       jump nap_time
      elif choices <= 3:
       jump extra_choice
     label nap_time:
     "I better go ahead and mail this now that I'm done. I guess I'll find out how well I did in a few months when they ship the schedules to the students."


Feel free to ignore the specifics of the text, but I need to know the problems here. If anyone needs them, here are the variables:
$ Science = 0
$ Math = 0
$ LA = 0
$ Choices = 0
$ band = False
$ choir = False
$ sports = False
$ art = False
$ program = False

Asceai
Eileen-Class Veteran
Posts: 1258
Joined: Fri Sep 21, 2007 7:13 am
Projects: a battle engine
Contact:

Re: End of Line Expected Statement on "If" choice menu

#2 Post by Asceai »

The problem is all the lines that are like:

Code: Select all

        "Test Paper" "Choir" if choir == False:
Specifically, the two pieces of text to use for menu options.
That kind of thing works for say statements, because the first piece of text is the speaker and the second piece of text the dialogue, but it makes no sense for menu items.

User avatar
ArachneJericho
Regular
Posts: 196
Joined: Sun Jun 22, 2014 2:04 am
Projects: Kaguya Hime
Tumblr: mousedeerproductions
Location: Seattle, WA, USA
Contact:

Re: End of Line Expected Statement on "If" choice menu

#3 Post by ArachneJericho »

edit - not the right answer from me :)

Machiner
Newbie
Posts: 2
Joined: Wed Jul 02, 2014 8:02 pm
Contact:

Re: End of Line Expected Statement on "If" choice menu

#4 Post by Machiner »

I'm probably being a bit of an idiot, but forgive me, for I am really new at this. How do I go about fixing it? I copied the format on the (admittedly dated) wiki, so I'm not sure how to fix it.

Asceai
Eileen-Class Veteran
Posts: 1258
Joined: Fri Sep 21, 2007 7:13 am
Projects: a battle engine
Contact:

Re: End of Line Expected Statement on "If" choice menu

#5 Post by Asceai »

Just don't have two strings there

Code: Select all

        "Choir" if choir == False:
Fix all of the lines that are like this.

Post Reply

Who is online

Users browsing this forum: henne, Ocelot, snotwurm