Closed evilenzo closed 1 year ago
This sounds like a good idea to me.
We're definitely agreed that having a way to include line breaks in a line is important, for multi-paragraph "lines" in games. However, adding the ability to break a Yarn line across multiple source code lines is less important, and would complicate the parser.
What we think might be a better solution is to provide a text-replacement marker like, for example, [br/]
(which doesn't currently exist), which expands out to a newline character.
As a work-around for Unity, it's possible to include TextMeshPro markup to insert a line break right now, using the <br>
tag.
Thank you for your well-thought-out proposal!
Closed in favour of #347
Introduction
Currently there is no special character in
yarn
that makes parser treat multiple lines as one. Since most of languages deal with such problem one way or another we can say thatyarn
lacks expressiveness. Example:Rationale
Currently such functionality can be achived by tags and custom views. But it looks like a such common problem that people must solve each time by making their own workarounds. I don't think that such language logic must always be coded by end user.
Proposed solution
We already have
\
special character that helps us to show some other special characters to user. Why can't it be also a symbol for treating next line as a part of previous like inpython
?Detailed design
It looks like it's a minor change in parser. It should just check the end of a line for this character and then decide to parse or to append next line to this.
Backwards Compatibility
Currently having only one
\
character will cause error. So I think it would not affect previous versions.Alternatives considered
In addition, you can think about other special symbols to make so-called
monologue mode
that other engines have: