[SOLVED] {nw} being ignored

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
Kinmoku
Miko-Class Veteran
Posts: 591
Joined: Mon Aug 11, 2014 9:39 am
Completed: One Night Stand
Projects: VIDEOVERSE
Tumblr: gamesbykinmoku
itch: kinmoku
Location: Germany
Contact:

[SOLVED] {nw} being ignored

#1 Post by Kinmoku »

Hi all,

To try and fix my cut-scenes (thread here: viewtopic.php?f=8&t=63295) I decided to add auto-advancing dialogue (so the timing can still match the music). However, it seems {nw} is being ignored. My default cps is 0 (I'd like the keep this with {w=2.0} instead}, and I thought perhaps that was the problem, but even with the code below, the dialogue still doesn't advance without a click.

Code: Select all

$ text_cps = 1

    hanzo "I'm sorry, Master.{fast}{w=2}{nw}" with ffpopup
I tried without "$ text_cps = 1", "{fast}" and "with ffpopup" but nothing has worked. Any ideas what is going on?

Thank you in advance.

EDIT: This is the character. There is quite a lot going on here as this textbox design looks very different from the others I'm using, but I don't think there is anything here to cause a problem like this:

Code: Select all

define hanzo = Character(None, what_xalign=0.0, what_yalign=0.0, window_right_padding=40, window_left_padding=40, window_top_padding=120, window_xpos=330, window_ypos=180, window_xmaximum=844, window_ymaximum=284, what_color="#78f5fa", what_size=60, what_font="fonts/Alkhemikal.ttf", window_background="textbox_hanzo")
Last edited by Kinmoku on Mon Nov 29, 2021 4:27 am, edited 1 time in total.

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

Re: {nw} being ignored

#2 Post by Ocelot »

It works for me. I created a new project with following script:

Code: Select all

style hanzo_what is say_dialogue:
    align (0.0, 0.0)
    color "#78f5fa"
    size 60

style hanzo_window is window:
    xpadding 40
    top_padding 120
    pos (330, 180)
    maximum (884, 284)
    background "textbox_hanzo"

define hanzo = Character(None, window_style="hanzo_window", what_style="hanzo_what")

label start:
    scene bg room

    "Hello"
    $ text_cps = 1
    hanzo "I'm sorry, Master.{fast}{w=2}{nw}"
    "Good Bye"

    return
Do you have voicing or reuse voice channel in these parts? Cecause IIRC {nw} waits for voice to finish.
< < insert Rick Cook quote here > >

User avatar
Kinmoku
Miko-Class Veteran
Posts: 591
Joined: Mon Aug 11, 2014 9:39 am
Completed: One Night Stand
Projects: VIDEOVERSE
Tumblr: gamesbykinmoku
itch: kinmoku
Location: Germany
Contact:

Re: {nw} being ignored

#3 Post by Kinmoku »

Ocelot wrote: Fri Nov 19, 2021 9:44 am Do you have voicing or reuse voice channel in these parts? Cecause IIRC {nw} waits for voice to finish.
No voices in the game. When I toggle self voicing, there is no change either :(

EDIT: I'm using the latest version of Ren'Py: 7.4.10.2178. I tested in an older version but it didn't help. I also tried your code but it didn't help either. It would seem something is wrong somewhere in my project, though I wouldn't know where to start looking.
Last edited by Kinmoku on Mon Nov 22, 2021 4:50 am, edited 1 time in total.

User avatar
zmook
Veteran
Posts: 421
Joined: Wed Aug 26, 2020 6:44 pm
Contact:

Re: {nw} being ignored

#4 Post by zmook »

Out of curiosity, does it make a difference if you put any text (even just a space) between the {w=2} and {nw} tags?
colin r
➔ if you're an artist and need a bit of help coding your game, feel free to send me a PM

User avatar
Kinmoku
Miko-Class Veteran
Posts: 591
Joined: Mon Aug 11, 2014 9:39 am
Completed: One Night Stand
Projects: VIDEOVERSE
Tumblr: gamesbykinmoku
itch: kinmoku
Location: Germany
Contact:

Re: {nw} being ignored

#5 Post by Kinmoku »

zmook wrote: Fri Nov 19, 2021 12:25 pm Out of curiosity, does it make a difference if you put any text (even just a space) between the {w=2} and {nw} tags?
No, it doesn't.

User avatar
Kinmoku
Miko-Class Veteran
Posts: 591
Joined: Mon Aug 11, 2014 9:39 am
Completed: One Night Stand
Projects: VIDEOVERSE
Tumblr: gamesbykinmoku
itch: kinmoku
Location: Germany
Contact:

Re: {nw} being ignored

#6 Post by Kinmoku »

I've ran the test in an older, smaller copy of my project and {nw} still doesn't work, BUT the line gets repeated i.e. I have to click twice to dismiss it:

Code: Select all

    m "Testing a box with no wait...{w=2}{nw}" # {nw} is ignored and I have to click TWICE to dismiss this line
    m "Did it work?" # this line works as normal
This feels like it maybe a clue into what is wrong... :?

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

Re: {nw} being ignored

#7 Post by Ocelot »

Do you have any character callbacks, global text callbacks, custom text tags, anything that could interfere with displayed text?
< < insert Rick Cook quote here > >

User avatar
Kinmoku
Miko-Class Veteran
Posts: 591
Joined: Mon Aug 11, 2014 9:39 am
Completed: One Night Stand
Projects: VIDEOVERSE
Tumblr: gamesbykinmoku
itch: kinmoku
Location: Germany
Contact:

Re: {nw} being ignored

#8 Post by Kinmoku »

Ocelot wrote: Mon Nov 22, 2021 5:57 am Do you have any character callbacks, global text callbacks, custom text tags, anything that could interfere with displayed text?
I don't believe so. Most of my game's text is displayed in screens (I've created a virtual message board/ instant messenger), so nothing should be changed within the typical Ren'Py text.

We created a typer so the player's messages look like they are being typed out. There were some custom tags here, but I removed them and the problem still persists:

Code: Select all

def text_logic(self):
            if self.wait_for > self.last_st and self.fast_type_on == False:
                return

            if self.backspace:
                self.backspace -= 1
                self.showing_line.pop()
            elif self.line[self.index] == "#":
                self.backspace = int(self.line[self.index+1])
                self.index += 2
            elif self.line[self.index] == "|":
                if not persistent.press_to_type:
                    renpy.sound.stop()
                    self.wait_for = self.last_st + float(self.line[self.index+1:self.index+3])
                self.index += 4
            else:
                self.showing_line.append(self.line[self.index])
                self.index += 1
            renpy.restart_interaction()
I use "|1.0" and "#5" to wait for 1.0 and backspace 5 characters. 90% of the game's text looks something like this:

Code: Select all

        $ markus.send(_("Did you have fun? :-D"), wait_for=3)
        $ dm_type_message(_("Yes, thanks."))
Instead of:

Code: Select all

m "Did you have fun?"
e "Yes, thanks."
Since I'm not using dialogue most of the time, I haven't tried to use {nw} or {w=1} until now because I can't use it in my messenger text.

I'll keep removing parts of my code to see if I can pinpoint where it's going wrong, but there doesn't seem to be anything standing out right now.

User avatar
Kinmoku
Miko-Class Veteran
Posts: 591
Joined: Mon Aug 11, 2014 9:39 am
Completed: One Night Stand
Projects: VIDEOVERSE
Tumblr: gamesbykinmoku
itch: kinmoku
Location: Germany
Contact:

Re: {nw} being ignored

#9 Post by Kinmoku »

Okay, this took me quite a while as I ended up deleting most of my test project before I found the issue.

{nw} worked again when I removed zorder, modal and key dismiss from my say screen:

Code: Select all

screen say(who, what):
    #zorder 500
    #modal True
    style_prefix "say"

    #key "dismiss" action Return()
    
    window:
        id "window"

        if who is not None:

            window:
                id "namebox"
                style "namebox"
                text who id "who" color get_primary()

        text what id "what"
I changed the zorder and modal on my say screen because it often appears above other screens with buttons on.
{nw} also didn't work with another screen above it:

Code: Select all

screen disable_click():
    zorder 999
    modal True
    key "mouseup_1" action NullAction()
    key "K_RETURN" action NullAction()
    key "K_SPACE" action NullAction()
    key "K_KP_ENTER" action NullAction()
    key "joy_dismiss" action NullAction()
Which uses similar code. This screen is only used during cut-scenes, where I want to use {nw} so the story is told in time with the music.

Is this a Ren'Py issue? What can I do?

Thanks in advance.

User avatar
PyTom
Ren'Py Creator
Posts: 16093
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: {nw} being ignored

#10 Post by PyTom »

This is Ren'Py working as designed. Modal is meant for things like the confirm screen, and other bits of interface that are meant to be blocked by a screen of higher priority. There isn't a good way to make the game unresponsive to player input.

If you really want to do this, probably the best way is screens with timers. It's not the dialogue system.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
Kinmoku
Miko-Class Veteran
Posts: 591
Joined: Mon Aug 11, 2014 9:39 am
Completed: One Night Stand
Projects: VIDEOVERSE
Tumblr: gamesbykinmoku
itch: kinmoku
Location: Germany
Contact:

Re: {nw} being ignored

#11 Post by Kinmoku »

PyTom wrote: Fri Nov 26, 2021 11:47 pm This is Ren'Py working as designed. Modal is meant for things like the confirm screen, and other bits of interface that are meant to be blocked by a screen of higher priority. There isn't a good way to make the game unresponsive to player input.

If you really want to do this, probably the best way is screens with timers. It's not the dialogue system.
That makes sense. I figured a way around it is to put "modal True" in a conditional, to be used only when I need it (which is luckily when I'm not using {nw}).

My fix, in case anyone experiences something similar in future:

Code: Select all

screen say(who, what):
    if animate_textbox == "open":
        zorder 500
        modal True
        key "dismiss" action Return()

    style_prefix "say"
    # rest of say screen

Post Reply

Who is online

Users browsing this forum: Google [Bot]