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.
I've been customizing my nvl textbox using information in this tutorial: viewtopic.php?f=51&t=17232 but I've run into some issues and was wondering if anyone had some insight!
This is the code posted in the thread for adjusting the position of the nvl text:
## The position, width, and alignment of nvl_thought text (the text said by the
## nvl_narrator character.)
define gui.nvl_thought_xpos = 240
define gui.nvl_thought_ypos = 0
define gui.nvl_thought_width = 780
define gui.nvl_thought_xalign = 0.0
I'm wanting my nvl text to start a bit lower on the screen so I changed gui.nvl_thought_ypos to 150. However, when I do that, it is also adding 150px spacing between lines! Even though I've set gui.nvl_spacing to only 10. It seems to me that it should be spacing normally, but just starting the text 150px lower? Here's the exact code, any help is much appreciated!
init python:
## ---- No Frame (non-adjustable) Nvl Box------
style.nvl_window.background = "gui/nvl.png"
define config.nvl_list_length = 6 # How many nvl lines will be displayed max.
## The height of an NVL-mode entry. Set this to None to have the entries
## dynamically adjust height.
define gui.nvl_height = None
## The spacing between NVL-mode entries when gui.nvl_height is None, and between
## NVL-mode entries and an NVL-mode menu.
define gui.nvl_spacing = 10
## The position, width, and alignment of the label giving the name of the
## speaking character.
define gui.nvl_name_xpos = 1140
define gui.nvl_name_ypos = 0
define gui.nvl_name_width = 150
define gui.nvl_name_xalign = 1.0
## The position, width, and alignment of the dialogue text.
define gui.nvl_text_xpos = 1160
define gui.nvl_text_ypos = 8
define gui.nvl_text_width = 650
define gui.nvl_text_xalign = 0.0
## The position, width, and alignment of nvl_thought text (the text said by the
## nvl_narrator character.)
define gui.nvl_thought_xpos = 940
define gui.nvl_thought_ypos = 0
define gui.nvl_thought_width = 950
define gui.nvl_thought_xalign = 0.0
## The position of nvl menu_buttons.
define gui.nvl_button_xpos = 450
define gui.nvl_button_xalign = 0.0
Last edited by noeinan on Tue Apr 28, 2020 12:31 am, edited 1 time in total.
Have you tried style.nvl_window_padding? I'm not really good with styles, but your problem sounds like ypos is always relative to the most recent entry and you need to change the style of the window instead.
Crappy White Wings (currently quite inactive)
Working on: KANPEKI!
(On Hold: New Eden, Imperial Sea, Pure Light)
Thanks for the response! This has really been bugging me but I haven't made any progress so far.
After trying out your suggestion, I got an error "Value is not a style." so it seems like maybe this isn't programmed into the new style format? (Unless I just messed up and did something wrong, I just added 150px since that's what I'm hoping for in terms of padding.)
I'm sorry, but an uncaught exception occurred.
While running game code:
File "game/screens.rpy", line 1863, in script
init python:
File "game/screens.rpy", line 1867, in <module>
style.nvl_window_padding = 150
Exception: Value is not a style.
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "game/screens.rpy", line 1863, in script
init python:
File "E:\_RenPy\renpy-7.3.2-sdk\renpy\ast.py", line 912, in execute
renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
File "E:\_RenPy\renpy-7.3.2-sdk\renpy\python.py", line 2004, in py_exec_bytecode
exec bytecode in globals, locals
File "game/screens.rpy", line 1867, in <module>
style.nvl_window_padding = 150
File "style.pyx", line 202, in renpy.style.StyleManager.__setattr__
Exception: Value is not a style.
Windows-8-6.2.9200
Ren'Py 7.3.2.320
Mon Apr 27 01:21:55 2020
As I said, I'm not good with styles So I'm not sure what the style you need is called. I don't fully understand the naming system. I'd try gui.nvl_window_padding next, and if that doesn't work, ask for help in the Discord maybe - I'm 99% sure some kind of padding style is what you need. Sorry I couldn't be of more help.
Crappy White Wings (currently quite inactive)
Working on: KANPEKI!
(On Hold: New Eden, Imperial Sea, Pure Light)
is what's used to change the nvl window padding. Changing the second value in Borders with adjust the height at which the dialogue will start appearing.
Else you can use style.nvl_window.top_padding