resolution
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.
resolution
hello everybody this is my first post here. I'd have to say I'm quite surprised the ease of use Ren'Py, being a non-programmer myself. I went through the online quick start and documentation, and found it to be very clear and helpful. As an artist I like to work @ 1024x768 resolution for my work, problem being I'm not quite sure how to achieve this is my script.
init:
config.screen_height = 1024
config.screen_width = 768
label start:
On line 1 of D:\programs\renpy-6.7.1\theGoddess/game/script.rpy: init statement expects a non-empty block.
init:
^
On line 2 of D:\programs\renpy-6.7.1\theGoddess/game/script.rpy: expected statement.
config.screen_height = 1024
^
On line 3 of D:\programs\renpy-6.7.1\theGoddess/game/script.rpy: expected statement.
config.screen_width = 768
^
this is what I have at start of my script, but doesn't work, I'm not sure If have to use a different script in the directory. If anyone can point out my mistake, I'd be most grateful.
thank you
init:
config.screen_height = 1024
config.screen_width = 768
label start:
On line 1 of D:\programs\renpy-6.7.1\theGoddess/game/script.rpy: init statement expects a non-empty block.
init:
^
On line 2 of D:\programs\renpy-6.7.1\theGoddess/game/script.rpy: expected statement.
config.screen_height = 1024
^
On line 3 of D:\programs\renpy-6.7.1\theGoddess/game/script.rpy: expected statement.
config.screen_width = 768
^
this is what I have at start of my script, but doesn't work, I'm not sure If have to use a different script in the directory. If anyone can point out my mistake, I'd be most grateful.
thank you
- PyTom
- Ren'Py Creator
- Posts: 16096
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Re: resolution
Your best bet is to edit the image sizes into options.rpy.
The proximate cause of your problem is that your code isn't indented correctly, and that you need to either proceed each python statement with a $ or use an init python block. But options.rpy has a nice init python block set up, so you should use that.
The proximate cause of your problem is that your code isn't indented correctly, and that you need to either proceed each python statement with a $ or use an init python block. But options.rpy has a nice init python block set up, so you should use that.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
Re: resolution
Actually, I think the reason that it doesn't work is that the config variables can't be accessed from Ren'Py code; only Python blocks. I'm not sure, and I know I'm contradicting the expert about one of the causes, even though I'm not contradicting the answer. (In other words, the correct solution, regardless of the technicalities involved, IS to edit options.rpy's config.screen_height and config.screen_width declarations, just like the master says.) And yes, I do understand that the indentation screws things up as well.
The reason I don't think that config variables are accessible from Ren'Py blocks is that I tried to access config.developer from the "start" block and it gave me an error. (I asked for config.developer's value so as to make the difference between the developer's menu and what the regular player gets.) I may have just done this wrong, though.
In other words, the proper way to change those variables outside of the options.rpy file would be to make an "init python" block and make a routine that changes those. Not that that does any good if it occurs after the window is generated, since the window size doesn't change along with it.
The reason I don't think that config variables are accessible from Ren'Py blocks is that I tried to access config.developer from the "start" block and it gave me an error. (I asked for config.developer's value so as to make the difference between the developer's menu and what the regular player gets.) I may have just done this wrong, though.
In other words, the proper way to change those variables outside of the options.rpy file would be to make an "init python" block and make a routine that changes those. Not that that does any good if it occurs after the window is generated, since the window size doesn't change along with it.
-
- Regular
- Posts: 129
- Joined: Thu Apr 19, 2007 12:07 am
- Location: Michigan, United States, Terra
- Contact:
-
- Veteran
- Posts: 359
- Joined: Sat Feb 25, 2006 11:09 am
- Location: Sant Cugat del Vallès (Barcelona, Spain)
- Contact:
Re: resolution
To be more exact, Ren'py has no explicit syntax to manipulate variables, so you have to use Python's syntax, and hence tell Ren'py that these statements are actually in Python's syntax rather than Ren'py's. Either putting the code within a python (or init python) block, or preceeding the statement with a "$" (which is like making a single-line python block). This applies to variables in general, not just config variables.Formedras wrote:Actually, I think the reason that it doesn't work is that the config variables can't be accessed from Ren'Py code; only Python blocks.
That's actually a separate point: config variables need to be set up during the init stage, before the game actually begins. This is because Ren'py needs to already know the value of some (probably most) of them during starting up, before the main menu screen is even shown (for example, it needs to know at which resolution the game should be displayed before the main menu screen can be shown at that resolution). Trying to change these variables after the init phase will, in most cases, have nasty side-effects. Even in the case you could manage to properly adjust one of these variables during the game, you'd still face the issue that they don't participate on save/load.Formedras wrote:The reason I don't think that config variables are accessible from Ren'Py blocks is that I tried to access config.developer from the "start" block and it gave me an error.
So, you need to set these variables on init (or init python) blocks. Setting them from a non-python init block is OK (as long as you prefix them with "$"), but doing so from a python block that is not part of the init stage wouldn't work.
That wouldn't achieve anything useful: as you mention, the window size wouldn't be updated (I think there are ways to resize it, but that'd be non-trivial). But, in addition, the change wouldn't persist upon a save and reload.Formedras wrote:In other words, the proper way to change those variables outside of the options.rpy file would be to make an "init python" block and make a routine that changes those. Not that that does any good if it occurs after the window is generated, since the window size doesn't change along with it.
There might be workarounds for many of the variables, but they are complex in the best case, and a hell of cryptic code mess in the worst.
This is exactly one of the causes of the problem; and PyTom already mentioned it.Twar3Draconis wrote:The debug messages make it sound as if you don't have correct indents.
I'll try to explain as simply as I can to make it easier for muffin to understand :
First, and the most critical fact: both python and ren'py rely on indentation (ammount of whitespace preceeding a line) to figure out which lines are inside of each block: for example, after a init: statement, everything below it that has a deeper indentation is considered the content of that block, until a line is found that has the same or less indentation than the "init:" opener. This applies to all other kinds of blocks as well. Looking at your code:
Code: Select all
init:
config.screen_height = 1024
Code: Select all
init:
config.screen_height = 1024
config.screen_width = 768
Code: Select all
init python: # this tells the engine that the statements inside this init block are all python
config.screen_height = 1024
config.screen_width = 768
Code: Select all
init:
# The '$' symbol is used to introduce a single-line python statement:
$ config.screen_height = 1024
$ config.screen_width = 768
HTH
I have failed to meet my deadlines so many times I'm not announcing my projects anymore. Whatever I'm working on, it'll be released when it is ready
Re: resolution
thank you everyone for the quick reply, and making it simple for a non-programmer to understand.
I'm going to try and set this up when I get home.
thanks again everyone!
I'm going to try and set this up when I get home.
thanks again everyone!
Re: Hello. Hope anyone could help me with my problem.
Hello everyone. Well right now I am in process making my 1st Renpy game. I already success to put my character in the game. Then I decided to put some options to choose for my game. I follow instruction given by some blog I visit when I google for the tutorial. When I try to launch my game suddenly the errors above occurs. So I need help from anyone who know how I could solve my problems.
Here is the problems I have :
http://i669.photobucket.com/albums/vv54 ... cats-2.jpg.
Hope anyone could help me out. I'd really appreciate it. Well I am newbie to this Renpy stuff so I need lots of help
Here is the problems I have :
http://i669.photobucket.com/albums/vv54 ... cats-2.jpg.
Hope anyone could help me out. I'd really appreciate it. Well I am newbie to this Renpy stuff so I need lots of help
Re: resolution
Rule of thumb - if a line end with :Killa92 wrote:Hello everyone. Well right now I am in process making my 1st Renpy game. I already success to put my character in the game. Then I decided to put some options to choose for my game. I follow instruction given by some blog I visit when I google for the tutorial. When I try to launch my game suddenly the errors above occurs. So I need help from anyone who know how I could solve my problems.
Here is the problems I have :
http://i669.photobucket.com/albums/vv54 ... cats-2.jpg.
Hope anyone could help me out. I'd really appreciate it. Well I am newbie to this Renpy stuff so I need lots of help
then the next line need to be indented more by at least 1 space (more than 1 is fine, Tab=4 spaces); but without the : you cannot indent extra; the details can be found here
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot]