[Solved] After First Sentence New NVL Lines Not Appearing

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.
Post Reply
Message
Author
User avatar
Zalor
Newbie
Posts: 22
Joined: Wed Jan 18, 2017 3:02 pm
Contact:

[Solved] After First Sentence New NVL Lines Not Appearing

#1 Post by Zalor »

The problem that I am having is that new lines of nvl code are not appearing. They seem to register, as when I click the mouse (or hit enter) nothing happens. And it will continue like this until I have adv dialogue which works without trouble. For example:

"Despite warnings to remain where you were until the downgrade completed."
"You walked into a room that had not properly rendered in the midst of the transition."
"You are now in an unknown location."
nvl clear
d "Hello Mark!"

The first line appears, but when I click enter I get nothing, and then if I click enter again I still get nothing, but the third time when it gets to the adv portion it will display the "Hello Mark!" dialogue.

What I noticed is that if I separate each sentence with an nvl clear, everything works. But doing that defeats the whole purpose of nvl. I could also keep everything in one line, and that works. For instance:

"Despite warnings to remain where you were until the downgrade completed. {w}You walked into a room that had not properly rendered in the midst of the transition. {w}\n\nYou are now in an unknown location."

Using this work around I can achieve the result I want, as you can see here:
Image

However, I really don't want to have to use \n\n every time I want to put a space between two nvl paragraphs. If I don't use that work around, then you can't see the "You are now in an unknown location." line, since it's a separate line from the previous string.

Here is the relevant portion of my gui.rpy code:

Code: Select all

## NVL-Mode ####################################################################
##
## The NVL-mode screen displays the dialogue spoken by NVL-mode characters.

## The borders of the background of the NVL-mode background window.
define gui.nvl_borders = Borders(10, 20, 0, 15) #Borders(0, 10, 0, 20)

## The maximum number of NVL-mode entries Ren'Py will display. When more entries
## than this are to be show, the oldest entry will be removed.
define gui.nvl_list_length = None #6

## The height of an NVL-mode entry. Set this to None to have the entries
## dynamically adjust height.
define gui.nvl_height = None #115

## 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 = 15 #10

## The position, width, and alignment of the label giving the name of the
## speaking character.
define gui.nvl_name_xpos = 430
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 = 450
define gui.nvl_text_ypos = 8
define gui.nvl_text_width = 590
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 = 240
define gui.nvl_thought_ypos = 450 #0
define gui.nvl_thought_width = 780
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
Here is the NVL portion of my screens.rpy

Code: Select all

## NVL screen ##################################################################
##
## This screen is used for NVL-mode dialogue and menus.
##
## https://www.renpy.org/doc/html/screen_special.html#nvl


screen nvl(dialogue, items=None):

    window:
        style "nvl_window"

        has vbox:
            spacing gui.nvl_spacing

        ## Displays dialogue in either a vpgrid or the vbox.
        if gui.nvl_height:

            vpgrid:
                cols 1
                yinitial 1.0

                use nvl_dialogue(dialogue)

        else:

            use nvl_dialogue(dialogue)

        ## Displays the menu, if given. The menu may be displayed incorrectly if
        ## config.narrator_menu is set to True, as it is above.
        for i in items:

            textbutton i.caption:
                action i.action
                style "nvl_button"

    add SideImage() xalign 0.0 yalign 1.0


screen nvl_dialogue(dialogue):

    for d in dialogue:

        window:
            id d.window_id

            fixed:
                yfit gui.nvl_height is None

                if d.who is not None:

                    text d.who:
                        id d.who_id

                text d.what:
                    id d.what_id


## This controls the maximum number of NVL-mode entries that can be displayed at
## once.
define config.nvl_list_length = gui.nvl_list_length

style nvl_window is default
style nvl_entry is default

style nvl_label is say_label
style nvl_dialogue is say_dialogue

style nvl_button is button
style nvl_button_text is button_text

#style nvl_window:
    #xfill True
    #yfill True

    #background "gui/nvl.png"
    #padding gui.nvl_borders.padding

style nvl_entry:
    xfill True
    ysize gui.nvl_height

style nvl_label:
    xpos gui.nvl_name_xpos
    xanchor gui.nvl_name_xalign
    ypos gui.nvl_name_ypos
    yanchor 0.0
    xsize gui.nvl_name_width
    min_width gui.nvl_name_width
    text_align gui.nvl_name_xalign

style nvl_dialogue:
    xpos gui.nvl_text_xpos
    xanchor gui.nvl_text_xalign
    ypos gui.nvl_text_ypos
    xsize gui.nvl_text_width
    min_width gui.nvl_text_width
    text_align gui.nvl_text_xalign
    layout ("subtitle" if gui.nvl_text_xalign else "tex")

style nvl_thought:
    xpos gui.nvl_thought_xpos
    xanchor gui.nvl_thought_xalign
    ypos gui.nvl_thought_ypos
    xsize gui.nvl_thought_width
    min_width gui.nvl_thought_width
    text_align gui.nvl_thought_xalign
    layout ("subtitle" if gui.nvl_text_xalign else "tex")

style nvl_button:
    properties gui.button_properties("nvl_button")
    xpos gui.nvl_button_xpos
    xanchor gui.nvl_button_xalign

style nvl_button_text:
    properties gui.button_text_properties("nvl_button")
]
Last edited by Zalor on Tue Dec 07, 2021 10:09 am, edited 1 time in total.

User avatar
Zalor
Newbie
Posts: 22
Joined: Wed Jan 18, 2017 3:02 pm
Contact:

Re: After First Sentence New NVL Lines Not Appearing

#2 Post by Zalor »

Okay, so slight update. In my gui.rpy file I edited the gui.nvl_thought_ypos. I used to gave it set to 450, but I changed it to 100. This is what I get now:

Image

If I change gui.nvl_spacing from 15 to -80 this is what I get:
Image

However, when I change the gui.nvl_thought_ypos back to 450 so I can have the text in the location I want it to be, my previous problem in the OP returns where the, "You are now in an unknown location" text doesn't appear.
Last edited by Zalor on Mon Dec 06, 2021 7:51 am, edited 1 time in total.

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2384
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: After First Sentence New NVL Lines Not Appearing

#3 Post by Ocelot »

define gui.nvl_thought_ypos = 450 That will make second entry appear at y = 900 + height of first entry text, which, I suppose, places it outside the screen.
Right now your screen looks like this:

Code: Select all

== Entry 1 ========================================
    ^
    |
    |
    | 450 px
    |
    |
    V
 Few long line of
 text here.
== End of Entry 1 =================================
== Entry 2 ========================================
    ^
    |
    |
    | 450 px
    |
    |
    V
 Text which is probably
 outside of the screen
== End of Entry 2 =================================
< < insert Rick Cook quote here > >

User avatar
Zalor
Newbie
Posts: 22
Joined: Wed Jan 18, 2017 3:02 pm
Contact:

Re: After First Sentence New NVL Lines Not Appearing

#4 Post by Zalor »

Ocelot wrote: Mon Dec 06, 2021 7:46 am define gui.nvl_thought_ypos = 450 That will make second entry appear at y = 900 + height of first entry text, which, I suppose, places it outside the screen.
Thank you, that makes sense. What would be the best way to have my nvl text start at the bottom half of the screen, without effecting the second entry's spacing?

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2384
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: After First Sentence New NVL Lines Not Appearing

#5 Post by Ocelot »

I would add a null displayable with height I want to the NVL screen before first element:

Code: Select all

#...
        style "nvl_window"

        has vbox:
            spacing gui.nvl_spacing
        null height 450
#...
< < insert Rick Cook quote here > >

User avatar
Zalor
Newbie
Posts: 22
Joined: Wed Jan 18, 2017 3:02 pm
Contact:

Re: After First Sentence New NVL Lines Not Appearing

#6 Post by Zalor »

Ocelot wrote: Mon Dec 06, 2021 8:00 am I would add a null displayable with height I want to the NVL screen before first element:

Code: Select all

#...
        style "nvl_window"

        has vbox:
            spacing gui.nvl_spacing
        null height 450
#...
Thank you, that worked perfectly!

Post Reply

Who is online

Users browsing this forum: No registered users