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.
-
neometalero
- Regular
- Posts: 181
- Joined: Sun Oct 23, 2016 3:51 am
- Completed: My Dream Sport Dating Simulator, Attack Helicopter Dating Simulator
- Projects: My Dream Sport Dating Simulator, Attack Helicopter Dating Simulator
- Deviantart: neometalero
-
Contact:
#1
Post
by neometalero » Tue Oct 25, 2016 3:03 pm
Hi, i want to create a simple If Structure inside a Label , but this error keep apearing
This is my code
first i declare the variable
label start:
#variables de pyton
$ munieca = True
and then i do the if structure
label op7a:
sh1"Llegue hasta aqui, pero no logré encontrar a mi hija"
sh1"No tengo idea donde estará, que voy a hacer?"
#si recogiste o no a la munieca
if munieca == True:
"la variable vale true"
else:
"funco el else tambien porque?"
Any idea why this is happening?
-
Ocelot
- Eileen-Class Veteran
- Posts: 1883
- Joined: Tue Aug 23, 2016 10:35 am
- Github: MiiNiPaa
- Discord: MiiNiPaa#4384
-
Contact:
#2
Post
by Ocelot » Tue Oct 25, 2016 3:12 pm
1) Are you sure that you are not loading game, skipping assignment?
2) Are there any non-latin symbols in varaible name, by any chance?
3) Indentation in provided code sample is broken.
4) You do not need to compare it to True. Just if munieca: is enough.
< < insert Rick Cook quote here > >
-
neometalero
- Regular
- Posts: 181
- Joined: Sun Oct 23, 2016 3:51 am
- Completed: My Dream Sport Dating Simulator, Attack Helicopter Dating Simulator
- Projects: My Dream Sport Dating Simulator, Attack Helicopter Dating Simulator
- Deviantart: neometalero
-
Contact:
#3
Post
by neometalero » Tue Oct 25, 2016 3:52 pm
Ocelot wrote:1) Are you sure that you are not loading game, skipping assignment?
2) Are there any non-latin symbols in varaible name, by any chance?
3) Indentation in provided code sample is broken.
4) You do not need to compare it to True. Just if munieca: is enough.
Tks for your answer. What would be the apropiate indentation for this code?
Also i dont have any non latin simbols in the variable.
-
trooper6
- Lemma-Class Veteran
- Posts: 3712
- Joined: Sat Jul 09, 2011 10:33 pm
- Projects: A Close Shave
- Location: Medford, MA
-
Contact:
#4
Post
by trooper6 » Tue Oct 25, 2016 5:00 pm
First off declare your variables using "default" before the start label.
Second, post code using "code" tags rather than "quote" tags so we can see your indentation.
Third, each new level should be indented 4 spaces. So if you have a label, all the things inside that label should be indented for spaced. If you have an if block inside the label, the things inside the if block should be indented 8 spaces, and so on. This is documented here:
https://www.renpy.org/doc/html/language ... and-blocks
Fourth, try this:
Code: Select all
default munieca = True
label op7a:
sh1"Llegue hasta aqui, pero no logré encontrar a mi hija"
sh1"No tengo idea donde estará, que voy a hacer?"
#si recogiste o no a la munieca
if munieca == True:
"la variable vale true"
else:
"funco el else tambien porque?"
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
-
neometalero
- Regular
- Posts: 181
- Joined: Sun Oct 23, 2016 3:51 am
- Completed: My Dream Sport Dating Simulator, Attack Helicopter Dating Simulator
- Projects: My Dream Sport Dating Simulator, Attack Helicopter Dating Simulator
- Deviantart: neometalero
-
Contact:
#5
Post
by neometalero » Tue Oct 25, 2016 7:34 pm
Tks a lot now everything works. This helped me a lot.
In the wiki of Renpy the variable declaration is not clear.
And tks for the tip on the default , in the wiki says that you need to put the variables with a $, but it doesnt work
-
neometalero
- Regular
- Posts: 181
- Joined: Sun Oct 23, 2016 3:51 am
- Completed: My Dream Sport Dating Simulator, Attack Helicopter Dating Simulator
- Projects: My Dream Sport Dating Simulator, Attack Helicopter Dating Simulator
- Deviantart: neometalero
-
Contact:
#7
Post
by neometalero » Thu Oct 27, 2016 4:00 pm
Tks for the links , i will check them out
Users browsing this forum: No registered users