Menu error
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.
Menu error
Hello everyone, who can help?
- MrTorex
- Newbie
- Posts: 7
- Joined: Fri Jan 25, 2019 3:00 am
- Projects: Secret Idea
- Location: Belarus
- Contact:
Re: Menu error
Can you show the part of the code where the scope is? Because i don't see it in your code.
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3794
- Joined: Mon Dec 14, 2015 5:05 am
- itch: Imperf3kt
- Location: Your monitor
- Contact:
Re: Menu error
Your indentation is also incorrect. Ren'Py uses four spaces, but you have supplied what looks like two.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Twitter
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
- IrinaLazareva
- Veteran
- Posts: 399
- Joined: Wed Jun 08, 2016 1:49 pm
- Projects: Legacy
- Organization: SunShI
- Location: St.Petersburg, Russia
- Contact:
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3794
- Joined: Mon Dec 14, 2015 5:05 am
- itch: Imperf3kt
- Location: Your monitor
- Contact:
Re: Menu error
Which is set out in the beginning.IrinaLazareva wrote: ↑Sat Jan 26, 2019 10:12 amThe number of spaces can be anything (4, 5, 10... or 1). The main thing is to follow the Indentation's rules.
Take a look at the files found in renpy/common - they all use 4 spaces and make up the base upon which projects created with the launcher are built upon. So using anything other than four spaces means you are not following indentation previously set out.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Twitter
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
- IrinaLazareva
- Veteran
- Posts: 399
- Joined: Wed Jun 08, 2016 1:49 pm
- Projects: Legacy
- Organization: SunShI
- Location: St.Petersburg, Russia
- Contact:
Re: Menu error
...then this code should cause an indentation error:
Code: Select all
label start:
menu:
'one':
pass
'two':
pass
menu:
'three':
pass
'four':
pass
return
Actually, bypassing "the four-spaces canon" greatly simplifies the code editing.
Here a good example.
https://pp.userapi.com/c851216/v8512165 ... tEFf4Q.jpg
If I need to change the code (picture on the left) on the seventh line, for example, to add a If-condition, I will have to move all the lines starting from the eighth and below.
But, if I don't execute "the four-spaces canon", it is enough to change only two lines (line 7, 8, picture on the right).
P.S. I don't insist on being right. I just show you the possibilities of language. (RenPy is based on python. And python was designed to make the programmer's job easier.)
Who is online
Users browsing this forum: No registered users