In need of Ren'py help!
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.
- Dylan_Bain
- Regular
- Posts: 101
- Joined: Mon Mar 09, 2015 2:05 pm
- Organization: Dylan Bain Games
- Location: Scotland
- Contact:
In need of Ren'py help!
Just got an error message on my test game saying
"if statement expects a non-empty block."
What does this mean?
The entire statement is
"if statement expects a non-empty block.
if question1 == True and question2 == True and question3 == True: <-"
How do you fix this?
Thanks!
"if statement expects a non-empty block."
What does this mean?
The entire statement is
"if statement expects a non-empty block.
if question1 == True and question2 == True and question3 == True: <-"
How do you fix this?
Thanks!
- trooper6
- Lemma-Class Veteran
- Posts: 3712
- Joined: Sat Jul 09, 2011 10:33 pm
- Projects: A Close Shave
- Location: Medford, MA
- Contact:
Re: In need of Ren'py help!
Could you post your actual code, and put it in between code tags in order to preserve indentation.
Code tags are [ code], and [ /code]...but without the space right after the square bracket.
Post as much code as possible, including the lines after the if statement.
Code tags are [ code], and [ /code]...but without the space right after the square bracket.
Post as much code as possible, including the lines after the if statement.
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
- Dylan_Bain
- Regular
- Posts: 101
- Joined: Mon Mar 09, 2015 2:05 pm
- Organization: Dylan Bain Games
- Location: Scotland
- Contact:
Re: In need of Ren'py help!
Yeah, of course!trooper6 wrote:Could you post your actual code, and put it in between code tags in order to preserve indentation.
Code tags are [ code], and [ /code]...but without the space right after the square bracket.
Post as much code as possible, including the lines after the if statement.
Just in case you are wondering, I am just getting to know Ren'Py so I am making The Question bigger.
Code: Select all
"Before I could ask her my question, I had to get to know a bit more about her."
"She turned to me and smiled."
m "Hey, so..."
label menu1:
if question 1 == True and question2 == True and question3 == True:
$ all_questions_over = True
menu:
"What is your name?" if question1 == False:
jump question1
"How old are you?" if question2 == False:
jump question2
"Where are you from?" if question3 == False:
jump question3
"End conversation." if all_questions_over == True:
jump afterquestions
Re: In need of Ren'py help!
You need to indent the line:
$ all_questions_over = True
Basically, the indentations are key in Python (and Ren'py.) The "if" statement will run the next "block" of code, and those blocks are defined by being indented.
So:
Would call both Happy_Dance and Next_Bob with the same "if" statement.
If there is no indented block found after the statement, then it will panic since it knows there should be something there to run, and give the error you just saw.
$ all_questions_over = True
Basically, the indentations are key in Python (and Ren'py.) The "if" statement will run the next "block" of code, and those blocks are defined by being indented.
So:
Code: Select all
if Bob == "Happy":
$ call Happy_Dance
$ call Next_Bob
If there is no indented block found after the statement, then it will panic since it knows there should be something there to run, and give the error you just saw.
- trooper6
- Lemma-Class Veteran
- Posts: 3712
- Joined: Sat Jul 09, 2011 10:33 pm
- Projects: A Close Shave
- Location: Medford, MA
- Contact:
Re: In need of Ren'py help!
The problem with your code is indentation...well and other things.
Every time you have a colon, you need to indent the next line that belongs to that block and then indent back out when you are finished with that block. Also you have "jump question 1" in your menu...but I don't see any question1 defined anywhere. I don't think you even need to jump to a different label if the conversation that happens after the question isn't all that lengthy.
And you get a bit complicated in a way that you don't really need.
Something that is useful for you: you can label your menu. So here is how I would rewrite the code you provided:
Look over the code ask ask if there is something that isn't clear!
Every time you have a colon, you need to indent the next line that belongs to that block and then indent back out when you are finished with that block. Also you have "jump question 1" in your menu...but I don't see any question1 defined anywhere. I don't think you even need to jump to a different label if the conversation that happens after the question isn't all that lengthy.
And you get a bit complicated in a way that you don't really need.
Something that is useful for you: you can label your menu. So here is how I would rewrite the code you provided:
Code: Select all
label start:
#I always define all my variables at the beginning of the start label, since none of the questions have been asked yet, you start your variables as Fals
$question1_asked = False
$question2_asked = False
$question3_asked = False
#Presumably you have some talking happening here until you get to...
"Before I could ask her my question, I had to get to know a bit more about her."
"She turned to me and smiled."
m "Hey, so..."
menu opening_questions:
"What is your name?" if question1_asked == False:
s "My name is Sylvie...what's yours?"
m "My name is Dylan."
$ question1_asked = True
jump opening_questions
"How old are you?" if question2_asked == False:
s "I'm 20...my birthday is next week, though!"
m "Really? Are you doing anything special?"
s "I'm having a party over at the Watering Hole at 8...you are welcome to come along!"
$ question2_asked = True
jump opening_questions
"Where are you from?" if question3_asked == False:
s "I'm from Seattle. I just moved here. Is this your hometown?"
m "I was born and raised here!"
s "I'd love it if you gave me a tour of the sights one of these day."
m "It would be my pleasure!"
$ question3_asked = True
jump opening_questions
"End conversation." if all([question1_asked, question2_asked, question3_asked]):
jump afterquestions
label afterquestions:
"It was nice getting to know Sylvie."
#Blah, blah, blah
return
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
- Dylan_Bain
- Regular
- Posts: 101
- Joined: Mon Mar 09, 2015 2:05 pm
- Organization: Dylan Bain Games
- Location: Scotland
- Contact:
Re: In need of Ren'py help!
Thanks for the help!trooper6 wrote:The problem with your code is indentation...well and other things.
Every time you have a colon, you need to indent the next line that belongs to that block and then indent back out when you are finished with that block. Also you have "jump question 1" in your menu...but I don't see any question1 defined anywhere. I don't think you even need to jump to a different label if the conversation that happens after the question isn't all that lengthy.
And you get a bit complicated in a way that you don't really need.
Because I didn't give the full page of code, some things I had to change in order for it to work, but thanks for the help anyway!
Dylan_Bain
Re: In need of Ren'py help!
Hello to everyone.
I order to avoid spawning additional topics I would post my question here, I hope it woild be OK.
I'm trying to make a VN/sanbox style game and got stuck when I was trying to add a drawer in PC room where he/she would be able to see what kind of items he/she has.
I wish to display it as a list, but I keep getting "expected a keyword argument or child statement" error.
Code itself
So - what am I doing wrong?
Thanks in advance.
I order to avoid spawning additional topics I would post my question here, I hope it woild be OK.
I'm trying to make a VN/sanbox style game and got stuck when I was trying to add a drawer in PC room where he/she would be able to see what kind of items he/she has.
I wish to display it as a list, but I keep getting "expected a keyword argument or child statement" error.
Code itself
Code: Select all
screen drawer():
frame:
align (1.0, 0.0)
has vbox
if plain_cloth_own = 1 and cloth_worn != "plain clothes":
"A set of casual clothes"
if fancy_cloth_own = 1 and cloth_worn != "fancy clothes":
"A set of exquisite dress"
if univ_cloth_own = 1 and cloth_worn != "university uniform":
"A set of uniform from my university"
Thanks in advance.
- trooper6
- Lemma-Class Veteran
- Posts: 3712
- Joined: Sat Jul 09, 2011 10:33 pm
- Projects: A Close Shave
- Location: Medford, MA
- Contact:
Re: In need of Ren'py help!
= is to assign a value,
== is to check equivalencies
So your if should be: if plain_cloth_own == 1
== is to check equivalencies
So your if should be: if plain_cloth_own == 1
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: In need of Ren'py help!
I've tried to modify code that way, but I keep receiving same error message. Maybe there are problems with that I try to put it as vbox stuff, or identation... or something. )trooper6 wrote:= is to assign a value,
== is to check equivalencies
So your if should be: if plain_cloth_own == 1
What exactly that kind of "expected a keyword argument or child statement" error supposed to mean?
- xavimat
- Eileen-Class Veteran
- Posts: 1461
- Joined: Sat Feb 25, 2012 8:45 pm
- Completed: Yeshua, Jesus Life, Cops&Robbers
- Projects: Fear&Love
- Organization: Pilgrim Creations
- Github: xavi-mat
- itch: pilgrimcreations
- Location: Spain
- Discord: xavimat
- Contact:
Re: In need of Ren'py help!
Please read some documentation and see some examples before trying to do screens.
Your lines with text don't have any screen statement. Ren'Py doesn't know what to do with "A set of casual clothes"
You probably want a text printed in the screen, then you need the "text" statement:
Your lines with text don't have any screen statement. Ren'Py doesn't know what to do with "A set of casual clothes"
You probably want a text printed in the screen, then you need the "text" statement:
Code: Select all
text "A set of casual clothes"
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)
Re: In need of Ren'py help!
Thank you very much, it helped.
Who is online
Users browsing this forum: NerdyBitch