Simple question about dialogue

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
bdaywans
Newbie
Posts: 15
Joined: Sat Jul 13, 2019 2:54 pm
Contact:

Simple question about dialogue

#1 Post by bdaywans » Mon Jul 22, 2019 10:24 am

So I know I can use \n for line breaks if I wanted things like

Code: Select all

npc "This is \ntwo lines of text"
to produce:

Code: Select all

This is
two lines of text
but if I had a speech or monologue with a lot of dialogue for a character is there a shortcut I've missed or would I have to do

Code: Select all

npc "First sentence"
npc "Second sentence"
npc "Third sentence"
npc "and so on..."
or is there a way to add returns in a paragraph I've overlooked?

srksrk 68
Newbie
Posts: 18
Joined: Fri Jul 19, 2019 8:10 pm
Contact:

Re: Simple question about dialogue

#2 Post by srksrk 68 » Mon Jul 22, 2019 10:48 am

Well, in your second example, sentence two clears out sencence one when displayed, and thereafter sentence three clears sentence two and so on, so you only see one sentence at a time.

I do not quite know what you want to achieve. If you want to have all sentences displayed (each after a mouse click for instance), you could do something like:

Code: Select all

npc "First sentence{p}Second sentence{p}Third sentence{p}and so on..."

User avatar
Remix
Eileen-Class Veteran
Posts: 1456
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: Simple question about dialogue

#3 Post by Remix » Mon Jul 22, 2019 11:19 am

\n is going to be easier than typing {p=0} each time...

For info, if you wanted one character to 'say' multiple lines, one after another (with a click between each) you could use:

Code: Select all

    npc """First paragraph (line of dialogue)

        Second line (spoken as a new dialogue due to 2 preceding line-breaks)

        Third dialogue
        with no line-breaks between the words (all condensed to one line as only 1 line-break here)

        Fourth{p=0}with a line-break

        Fifth{vspace=10}with a line-break that is 10px larger"""
Frameworks & Scriptlets:

bdaywans
Newbie
Posts: 15
Joined: Sat Jul 13, 2019 2:54 pm
Contact:

Re: Simple question about dialogue

#4 Post by bdaywans » Mon Jul 22, 2019 2:31 pm

srksrk 68 wrote:
Mon Jul 22, 2019 10:48 am
Well, in your second example, sentence two clears out sencence one when displayed, and thereafter sentence three clears sentence two and so on, so you only see one sentence at a time.

I do not quite know what you want to achieve. If you want to have all sentences displayed (each after a mouse click for instance), you could do something like:

Code: Select all

npc "First sentence{p}Second sentence{p}Third sentence{p}and so on..."
Thanks both. I think I poorly explained this though.

I quoted @srksrk 68 because of their point about each npc quote clearing the window which was my intent. As a better example, if I were to have a character making several comments in one window I will use \n but the {p} sounds like a good idea in case I want to emphasize something, or have a pause between a reaction (right now I'm doing things like

Code: Select all

npc "..."
npc "... ..."
npc "... ... ..."
where as

Code: Select all

npc  "... {p}... {p}..." 
would be a LOT easier so thanks for that.

However, what I was referring to more was if there was a LOT of dialogue from a single character that I wanted to spread out across a number of screens. If they have 4 lines of long dialogue and I only wanted 2 sentences max per screen I could do

Code: Select all

npc "Sentence one. \nSentence two"
# or
npc "Sentence One {p} Sentence two."
But if I wanted these spread out I am under the impression I'd have to do it like...

Code: Select all

npc "Sentence One \nSentence Two"
npc "Sentence Three \nSentence Four"
What I was wondering about is if I have to add the "npc" portion for ever time I want to clear the screen and add new dialogue is is there a short hand that will keep my character speaking but use a click to advance to the next screen like:

Code: Select all

npc "Sentence One {p}Sentence Two (#some sort of click to advance the screen) Sentence Three (#click again to advance the screen) Sentence Four"
@remix, is that what your use of the """ would do? Sorry, too new to know what that meant.

Based on your replies I'm guessing no but hope I explained it better this time

srksrk 68
Newbie
Posts: 18
Joined: Fri Jul 19, 2019 8:10 pm
Contact:

Re: Simple question about dialogue

#5 Post by srksrk 68 » Mon Jul 22, 2019 4:26 pm

Have you already found this?

https://www.renpy.org/doc/html/text.html

There are all the text tags and more explained. It is also possible to define your own tags. If you don't find what you need there, I do not know where else to look...

User avatar
Remix
Eileen-Class Veteran
Posts: 1456
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: Simple question about dialogue

#6 Post by Remix » Mon Jul 22, 2019 5:07 pm

bdaywans wrote:
Mon Jul 22, 2019 2:31 pm
@remix, is that what your use of the """ would do? Sorry, too new to know what that meant.
Yes... inside triple quotes, if you do 2 line-breaks it effectively creates a new say

Code: Select all

    npc "Line 1"
    npc "Line 2"
Is the same as

Code: Select all

    npc """Line 1
    
    Line 2"""
    
    # or 
    
    npc """
    Line 1
    
    Line 2
    """
However, what I was referring to more was if there was a LOT of dialogue from a single character that I wanted to spread out across a number of screens.
If they have 4 lines of long dialogue and I only wanted 2 sentences max per screen I could do

Code: Select all

npc "Sentence one. \nSentence two"
# or
npc "Sentence One {p} Sentence two."
But if I wanted these spread out I am under the impression I'd have to do it like...

Code: Select all

npc "Sentence One \nSentence Two"
npc "Sentence Three \nSentence Four"
You'd maybe use

Code: Select all

    npc """Sentence One \nSentence Two
    
    Sentence Three \nSentence Four"""
    
    # or (for neatness, maybe)
    
    npc """
    Sentence One 
    \nSentence Two
    
    Sentence Three 
    \nSentence Four"""
Frameworks & Scriptlets:

bdaywans
Newbie
Posts: 15
Joined: Sat Jul 13, 2019 2:54 pm
Contact:

Re: Simple question about dialogue

#7 Post by bdaywans » Mon Jul 22, 2019 11:59 pm

Remix wrote:
Mon Jul 22, 2019 5:07 pm
bdaywans wrote:
Mon Jul 22, 2019 2:31 pm
@remix, is that what your use of the """ would do? Sorry, too new to know what that meant.
Yes... inside triple quotes, if you do 2 line-breaks it effectively creates a new say

Code: Select all

    npc "Line 1"
    npc "Line 2"
Is the same as

Code: Select all

    npc """Line 1
    
    Line 2"""
    
    # or 
    
    npc """
    Line 1
    
    Line 2
    """
However, what I was referring to more was if there was a LOT of dialogue from a single character that I wanted to spread out across a number of screens.
If they have 4 lines of long dialogue and I only wanted 2 sentences max per screen I could do

Code: Select all

npc "Sentence one. \nSentence two"
# or
npc "Sentence One {p} Sentence two."
But if I wanted these spread out I am under the impression I'd have to do it like...

Code: Select all

npc "Sentence One \nSentence Two"
npc "Sentence Three \nSentence Four"
You'd maybe use

Code: Select all

    npc """Sentence One \nSentence Two
    
    Sentence Three \nSentence Four"""
    
    # or (for neatness, maybe)
    
    npc """
    Sentence One 
    \nSentence Two
    
    Sentence Three 
    \nSentence Four"""
WONDERFUL! Thanks!

I was initially hoping to us it to save lines but if it'll at least save me having to add so many quotes and keep typing npc over and over that's still a win!

Post Reply

Who is online

Users browsing this forum: Google [Bot]