Having some "choices" problems
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.
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.
Having some "choices" problems
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)
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)
- 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
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
*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
-
- Miko-Class Veteran
- Posts: 793
- Joined: Fri Feb 09, 2018 12:05 am
- Location: Canada
- Contact:
Re: Having some "choices" problems
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
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.
- 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
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.
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
*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
Re: Having some "choices" problems
Where do I find the actual codes?
-
- Miko-Class Veteran
- Posts: 793
- Joined: Fri Feb 09, 2018 12:05 am
- Location: Canada
- Contact:
Re: Having some "choices" problems
So that entire document? Sorry for all the noob questions here!
Re: Having some "choices" problems
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
Re: Having some "choices" problems
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.
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:
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!
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
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
Hope this is helpful!
-
- Miko-Class Veteran
- Posts: 793
- Joined: Fri Feb 09, 2018 12:05 am
- Location: Canada
- Contact:
Re: Having some "choices" problems
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
Re: Having some "choices" problems
Thank you guys!
Who is online
Users browsing this forum: Google [Bot]