If staement/input 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.
If staement/input Help!
$ Theme_one = renpy.input
$ Theme_one = Theme_one.strip()
if Theme_one == "nothing":
s "Okay"
This is my games code,well a small part of the code,so I wanted the the player to be able to type in aword/theme and different theme gets a different answer,When I launch the project my 3rd line in this part of the code is wrong and it says this:
if statement expects an un-empty block
what shoudl I do to fix this
$ Theme_one = Theme_one.strip()
if Theme_one == "nothing":
s "Okay"
This is my games code,well a small part of the code,so I wanted the the player to be able to type in aword/theme and different theme gets a different answer,When I launch the project my 3rd line in this part of the code is wrong and it says this:
if statement expects an un-empty block
what shoudl I do to fix this
Re: If staement/input Help!
Extra indent next line, like
Code: Select all
if Theme_one == "nothing":
s "Okay"
New problem
A new problem :
While running game code:
File game/script.rpy,line 31, in script
$ Theme_one.strip()
File game/script.rpy,line 31,in <module>
$ Theme_one=Theme_one.strip()
Attribute error : "function" object has no attribute "strip"
While running game code:
File game/script.rpy,line 31, in script
$ Theme_one.strip()
File game/script.rpy,line 31,in <module>
$ Theme_one=Theme_one.strip()
Attribute error : "function" object has no attribute "strip"
Re: If staement/input Help!
Code: Select all
$ Theme_one = renpy.input() # you've missed the brackets
Re: If staement/input Help!
Like this?
$ Theme_one = renpy.input()
$ Theme_one = Theme_one.strip()
if Theme_one == "nothing":
s "Okay"
$ Theme_one = renpy.input()
$ Theme_one = Theme_one.strip()
if Theme_one == "nothing":
s "Okay"
- trooper6
- Lemma-Class Veteran
- Posts: 3712
- Joined: Sat Jul 09, 2011 10:33 pm
- Projects: A Close Shave
- Location: Medford, MA
- Contact:
Re: If staement/input Help!
Put your code in-between the [ code][ /code] tags (without the extra space), so we can see your indents.
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: If staement/input Help!
Can you tell me how to code should go?
Correct the code:
$ Theme_one = renpy.input()
$ Theme_one = Theme_one.strip()
if Theme_one == "nothing":
s "Okay"
Its written liek that exactly
Correct the code:
$ Theme_one = renpy.input()
$ Theme_one = Theme_one.strip()
if Theme_one == "nothing":
s "Okay"
Its written liek that exactly
- 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: If staement/input Help!
Indent any child of a block (lines with : at the end).
If posting code, follow trooper6's advice, use code tags -> [code]Your code here[/code]
Otherwise, the only replies you will likely get are ones saying 'indent properly' or 'use indentation'...
If posting code, follow trooper6's advice, use code tags -> [code]Your code here[/code]
Otherwise, the only replies you will likely get are ones saying 'indent properly' or 'use indentation'...
Frameworks & Scriptlets:
- Speech Bubble dialogue system
- Multiple Notify with ATL and history
- (WIP) Radial Masking - needs updating to use Shader
- 7.4 - Smooth Tinting using ATL and matrixcolor
- Several other repositories there too
Re: If staement/input Help!
Try this (should work).
Code: Select all
# The game starts here.
label start:
$ Theme_one = renpy.input("")
$ Theme_one = Theme_one.strip()
if Theme_one == "nothing":
s "Okay"
else:
s "[Theme_one]"
Re: If staement/input Help!
Thanks
Who is online
Users browsing this forum: Google [Bot]