I keep reading tutorials on how to define variables, but I haven't quite familiarized myself with ren'py enough to know where to define the variables( do I define them like I define characters or do I define them in a python block?), how to set variables, and how to write if statements. I basically know how to begin a python block, and that is the limit of my knowledge. I think I managed to set user input well, but I'd really appreciate help.
Futhermore, if it helps at all, I need number variables for an affection meter!
How do I define my variables and more specifically where?
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.
- DictatorKitten
- Newbie
- Posts: 3
- Joined: Fri Jan 29, 2016 1:07 pm
- Deviantart: KittenRazorBlades
- Skype: itickleurbutts
- Contact:
Re: How do I define my variables and more specifically where
There's enough questions in here to direct you to the documentation: http://www.renpy.org/doc/html/
Any line that begins with a $ or is in a python: block is python code. Everything not in this is RenPy. Variables can be defined when you require them. I suggest you work your way through the examples in the "Getting Started" example of the documentation.
Any line that begins with a $ or is in a python: block is python code. Everything not in this is RenPy. Variables can be defined when you require them. I suggest you work your way through the examples in the "Getting Started" example of the documentation.
If we are what we repeatedly do, then good coding is not an act, but a habit
- DictatorKitten
- Newbie
- Posts: 3
- Joined: Fri Jan 29, 2016 1:07 pm
- Deviantart: KittenRazorBlades
- Skype: itickleurbutts
- Contact:
Re: How do I define my variables and more specifically where
I read the Ren'py documentation on variables already, that's why I came here. I didn't understand it :3/Iylae wrote:There's enough questions in here to direct you to the documentation: http://www.renpy.org/doc/html/
Any line that begins with a $ or is in a python: block is python code. Everything not in this is RenPy. Variables can be defined when you require them. I suggest you work your way through the examples in the "Getting Started" example of the documentation.
Re: How do I define my variables and more specifically where
Really? Docs are very clear on the variables definitions. Best way is simply to:
without any labels, screens, python or any other blocks, but you should be able to put it on the init block safely if you want all of them to be grouped together (it's convenient in JEdit for example, which I use).
will work just as well. Do not ever declare variables in the anything init without default or older define statements, you'll regret that later, use one of the ways above.
Code: Select all
default my_var = 0
default my_var_2 = {}
default my_var_3 = False
Code: Select all
label start:
$ my_var = 0
python:
my_var_2 = {}
my_var_3 = False
- DictatorKitten
- Newbie
- Posts: 3
- Joined: Fri Jan 29, 2016 1:07 pm
- Deviantart: KittenRazorBlades
- Skype: itickleurbutts
- Contact:
Re: How do I define my variables and more specifically where
Oh! Okay! I apologize, I'm not incredibly good with tutorials(for whatever reason), but yeah, this answers what I needed to know uwuxela wrote:Really? Docs are very clear on the variables definitions. Best way is simply to:
without any labels, screens, python or any other blocks, but you should be able to put it on the init block safely if you want all of them to be grouped together (it's convenient in JEdit for example, which I use).Code: Select all
default my_var = 0 default my_var_2 = {} default my_var_3 = False
will work just as well. Do not ever declare variables in the anything init without default or older define statements, you'll regret that later, use one of the ways above.Code: Select all
label start: $ my_var = 0 python: my_var_2 = {} my_var_3 = False
Who is online
Users browsing this forum: Sugar_and_rice