How to replace one line of dialogue with another

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
CSK
Newbie
Posts: 15
Joined: Sat Sep 10, 2022 2:42 pm
Contact:

How to replace one line of dialogue with another

#1 Post by CSK » Sat Sep 10, 2022 3:42 pm

What I was trying to achieve and managed to, is to have the nvl textbox open and showing on the right side all the time, but also using adv from time to time without the nvl textbox disappearing. But there is still a small issue with the solution I found:

Code: Select all

define narrator = nvl_narrator
define a = Character(kind=nvl)
define b = Character ("b")

label start:

    window show

    a "Test line nvl one"
    a "Test line nvl two"

    b "Test line adv one" (multiple=2)
    " " #a line of no text that shows in the nvl textbox at the same time as the line above in the adv textbox

    a "Test line nvl three" #the adv textbox vanishes and the nvl textbox stayed the whole time, but this line is now below the " " line and 
                                       #not directly below the "Test line nvl two"

    return
What I am looking for is a way to have "Test line nvl three" replace the empty " " line, instead of being shown below it.

The closest I have found that looks like it might be a solution for it is this:

Code: Select all

init python:
    def upper(s):
        return s.upper()

$ upper_string = renpy.transform_text("{b}Not Upper{/b}", upper)
https://www.renpy.org/doc/html/text.htm ... -functions

But not being a programmer I could be completely off, as I didn't even know how to implement it to test if it might work.

So what I am looking for is either a way to replace the line, another way to show both the nvl and the adv textbox at the same time without that small issue or, be told that neither is possible and go with "..." instead, which has a better feel to it than just an empty line.

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], Majestic-12 [Bot]