Having some "choices" problems

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
pianist88
Newbie
Posts: 14
Joined: Fri Apr 06, 2018 10:41 pm
Contact:

Having some "choices" problems

#1 Post by pianist88 »

Hi guys,

I am a complete noob to Ren'Py and I keep getting this error, despite following the instructions about choices. Here is both the script and the error, and some help would be much appreciated :) thanks. This game is only a test run, hence the EXTREME cheesiness of the story (which is far from complete, of course)

Script: https://prnt.sc/j2648i
Error: https://prnt.sc/j264ll

I am running Ren'Py on Windows 10 (64bit)

User avatar
trooper6
Lemma-Class Veteran
Posts: 3712
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Re: Having some "choices" problems

#2 Post by trooper6 »

You have a number of errors in your code. Rather than providing a picture of the code, could you paste your code within the [ code][ /code] tags (without the extra space). It would make it easier for us to copy/paste your code and fix it.
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

rayminator
Miko-Class Veteran
Posts: 793
Joined: Fri Feb 09, 2018 12:05 am
Location: Canada
Contact:

Re: Having some "choices" problems

#3 Post by rayminator »

i can see it all the errors

makes sure you indent all menus and jumps and returns are indented and add another indent to the line inside the menus

and the last one is the labels are not suppose to be indented
Last edited by rayminator on Sat Apr 07, 2018 11:54 am, edited 1 time in total.

User avatar
trooper6
Lemma-Class Veteran
Posts: 3712
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Re: Having some "choices" problems

#4 Post by trooper6 »

There are also spelling inconsistencies and apparently a missing label.

But if you post the actual code, one of us can fix it for you.
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

pianist88
Newbie
Posts: 14
Joined: Fri Apr 06, 2018 10:41 pm
Contact:

Re: Having some "choices" problems

#5 Post by pianist88 »

Where do I find the actual codes?

rayminator
Miko-Class Veteran
Posts: 793
Joined: Fri Feb 09, 2018 12:05 am
Location: Canada
Contact:

Re: Having some "choices" problems

#6 Post by rayminator »

pianist88 wrote: Sat Apr 07, 2018 12:05 pm Where do I find the actual codes?
the codes that you working on in script.rpy

pianist88
Newbie
Posts: 14
Joined: Fri Apr 06, 2018 10:41 pm
Contact:

Re: Having some "choices" problems

#7 Post by pianist88 »

So that entire document? Sorry for all the noob questions here!

pianist88
Newbie
Posts: 14
Joined: Fri Apr 06, 2018 10:41 pm
Contact:

Re: Having some "choices" problems

#8 Post by pianist88 »

Code: Select all

image evening = "evening.BMP"
image Jess = "Jessica.png"
image Lauren = "lauren.png"

define b = Character("Ben")
define  l = Character("Lauren")
define j = Character("Jessica")    

label start
    scene evening
    "I decided to take a look around town one night to find some girls"
    l "Hello, I'm Lauren!"
    show lauren at left 
    j "Hello, I'm Jess!"
    show Jess at right
    "They both approach me, both looking elegant."
    "Who should I speak to first?"
    
menu:
    "Jess":
     jump jesstalk :
    
    "Lauren" :
     jump laurentalk :
    
     label laurentalk  
     "Ben" "How are you, Lauren?" 
     "Lauren" "I'm great, thank you Ben!" 
     "Ben" "That's fantastic Lauren!"
     "I decided that I was going to take Lauren home for the night"
     "We went to the local cinema and saw the latest horror movie and had a great time together!"
     jump choice_done:
  
    
         
     label jesstalk  
             "Ben" "How are you, Jess?"
             "Jess" "I'm great thanks, Ben!" 
             "Ben" "Great to hear that, Jess!"
             jump choice_done
             "I decided to take Jess home for the night. We went to the local restaurent and had the nicest meal ever!" 
     jump choice_done :
             
     
     
     hide jess 
    
     "After spending time with Lauren, I decided to kiss her"
     return
     

kivik
Miko-Class Veteran
Posts: 786
Joined: Fri Jun 24, 2016 5:58 pm
Contact:

Re: Having some "choices" problems

#9 Post by kivik »

I had a go at this, though the code's quite messy and confusing so I just took a stab at what you intended, starting from the start label.

I'm assuming you're basically choosing to either speak to Lauren or Jess, then end the game.

Code: Select all

label start: # missing colon
    scene evening
    "I decided to take a look around town one night to find some girls"
    l "Hello, I'm Lauren!"
    show lauren at left
    j "Hello, I'm Jess!"
    show Jess at right
    "They both approach me, both looking elegant."
    "Who should I speak to first?"

    menu: # extra indent here for everything below
        "Jess":
            call jesstalk # if you call instead of jump, the game will return here after the label block finishes
        "Lauren":
            call laurentalk
    return

label laurentalk: # colon
    hide jess
    "Ben" "How are you, Lauren?"
    "Lauren" "I'm great, thank you Ben!"
    "Ben" "That's fantastic Lauren!"
    "I decided that I was going to take Lauren home for the night"
    "We went to the local cinema and saw the latest horror movie and had a great time together!"
    "After spending time with Lauren, I decided to kiss her"
    return #use return at the end of the label to end the label block

label jesstalk:
    hide lauren
    "Ben" "How are you, Jess?"
    "Jess" "I'm great thanks, Ben!"
    "Ben" "Great to hear that, Jess!"
    "I decided to take Jess home for the night. We went to the local restaurent and had the nicest meal ever!"
    return #use return at the end of the label to end the label block
Please bear in mind most programming languages are very sensitive to syntax - if your code doesn't have the exactly formatting expected, by simply missing a character or symbol or indenting your code incorrectly, it won't work - so when referring to the Ren'py documentation, please take note of every character in the examples as well as the indentation. Each indentation needs to be four spaces - I'd advise you to use the built in editor Atom instead of notepad as it can deal with the indentation for you.

The most common mistake you've made are:
- missing colons on label blocks
- adding colons where you don't need them (like after jump statements)
- incorrect indentation
- not breaking down the label blocks
- not defining labels you want to jump to: i.e. choice_done doesn't exist as a label

Speaking of choices, there are two ways of doing the above - assuming my interpretation of what you're trying to do is correct.

I used label blocks above since you seem to be trying to use it but misunderstood how they work. Instead of using jump, I used call, which basically means once the label block I called has finished running, it returns the game to wherever you were in the code (in this case the start label block).

An alternative would be:

Code: Select all

label start:
    "introduction"
    menu:
        "Jess":
            "Entire conversation with Jess here"
        "Lauren":
            "Entire conversation with Lauren here"
    "Continue the game"
    return
This version doesn't use any additional labels, and it may make more sense in this case assuming you won't be redoing Jess / Lauren's conversation again anywhere else in the game. In the first version with the label blocks, you can call the alternative character's label block at a later stage (like the next day), so you should choose whichever method makes more sense. You may also want to look into variables as well so that the game remembers who you spoke to first.

Hope this is helpful!

rayminator
Miko-Class Veteran
Posts: 793
Joined: Fri Feb 09, 2018 12:05 am
Location: Canada
Contact:

Re: Having some "choices" problems

#10 Post by rayminator »

here you go

Code: Select all

label start
    scene evening
    "I decided to take a look around town one night to find some girls"
    l "Hello, I'm Lauren!"
    show lauren at left 
    j "Hello, I'm Jess!"
    show Jess at right
    "They both approach me, both looking elegant."
    "Who should I speak to first?"
    
    menu:
        "Jess":
        jump jesstalk    
        "Lauren":
        jump laurentalk
    
label laurentalk  
    "Ben" "How are you, Lauren?" 
    "Lauren" "I'm great, thank you Ben!" 
    "Ben" "That's fantastic Lauren!"
    "I decided that I was going to take Lauren home for the night"
    "We went to the local cinema and saw the latest horror movie and had a great time together!"
    jump choice_done:
  
    
         
label jesstalk  
    "Ben" "How are you, Jess?"
    "Jess" "I'm great thanks, Ben!" 
    "Ben" "Great to hear that, Jess!"
    jump choice_done
    "I decided to take Jess home for the night. We went to the local restaurent and had the nicest meal ever!" 
    jump choice_done :
             
     
     
    hide jess 
    
    "After spending time with Lauren, I decided to kiss her"
    return

pianist88
Newbie
Posts: 14
Joined: Fri Apr 06, 2018 10:41 pm
Contact:

Re: Having some "choices" problems

#11 Post by pianist88 »

Thank you guys!
:)

Post Reply

Who is online

Users browsing this forum: Google [Bot]