Break after text?

New guy here again. I notice that there is only a single "return" or "break" after most lines of text. Makes it look like a huge mass sometimes. Is there a way to add a second break after text for easier reading during gameplay?


(filler to get my edited post, updated/posted)
(again, filler to get my edited post, updated/posted)
(again, filler to get my edited post, updated/posted)


see the bottom half of this post, for how to do: line breaks / new lines / return feed

(top half of this post, gets into more detailed use of the 'msg' Script, along with coding examples of and along with how to do it in the GUI/Editor)


the '[MESSAGE]' option-command is for TEXT ONLY (but 'html' code, and quest's text processor commands*, do work in it, I think, lol), and you don't need the double quotes encasing your message as quest handles it for you (if you do add in the double quotes, those will get displayed/shown in the message to the person playing the game: for example if you want to show that a character is "speaking" within the game)

examples (but: not of using test processor commands, nor not of using the html code):

(at the bottom half of this post, I have examples of using the 'html' code)

add new script -> 'output' section/category -> 'print a message' Script -> (see below)

// TEXT ONLY:

print [MESSAGE] hi
// output/displays:
// hi

print [MESSAGE] "hi"
// output/displays:
// "hi"

print [MESSAGE] hi, my name is HK, what is your name?
// output/displays:
// hi, my name is HK, what is your name?

print [MESSAGE] "hi, my name is HK, what is your name?"
// output/displays:
// "hi, my name is HK, what is your name?"

print [MESSAGE] hi, my name is "HK", what is your name?
// output/displays:
// hi, my name is "HK", what is your name?

*quest's text processor commands: https://docs.textadventures.co.uk/quest/text_processor.html


the '[EXPRESSION]' option-command is for writing in your own code (you can use the text processor commands*in it too, and also the 'html' code as well, I think): TEXT ONLY, VARIABLE ONLY, or both: TEXT and VARIABLE, any/all TEXT needs to be encased within the double quotes (and if you want to display any double quotes, such as if you want to show that a character is speaking within the game, you got to use the 'double quote' escape command:

 \"

examples (not showing the text process commands: they actually make it much easier to write/code, as you don't need the all the '+' and not all the double quotes as well, as seen below for the "normal" coding way of doing it):

add new script -> 'output' section/category -> 'print a message' Script -> (see below)

// TEXT ONLY:

print [EXPRESSION] "hi"
// output/displays:
// hi

print [EXPRESSION] "\"hi\""
// output/displays:
// "hi"

print [EXPRESSION] "hi, my name is HK, what is your name?"
// output/displays:
// hi, my name is HK, what is your name?

print [EXPRESSION] "\"hi, my name is HK, what is your name?\""
// output/displays:
// "hi, my name is HK, what is your name?"

print [EXPRESSION] "hi, my name is \"HK\", what is your name?"
// output/displays:
// hi, my name is "HK", what is your name?

// VARIABLE ONLY:

// in code: string_variable = "hi"
print [EXPRESSION] string_variable
// output/displays:
// hi

// in code: string_variable = "\"hi\""
print [EXPRESSION] string_variable
// output/displays:
// "hi"

// TEXT and VARIABLE:

// in code: string_variable = "hi"
print [EXPRESSION] "\"" + string_variable + "\""
// output/displays:
// "hi"

// in code: string_variable = "hi"
print [EXPRESSION] string_variable + ", my name is HK, what is your name?"
// output/displays:
// hi, my name is HK, what is your name?

// in code: string_variable = "hi"
print [EXPRESSION] "\"" + string_variable + ", my name is HK, what is your name?\""
// output/displays:
// "hi, my name is HK, what is your name?"

// in code: string_variable = "hi"
print [EXPRESSION] string_variable + ", my name is \"HK\", what is your name?"
// output/displays:
// hi, my name is "HK", what is your name?

How to do the: line breaks / new lines / return feed

(this is the bottom half of my post, on doing the: line breaks / new lines / return feed, stuff)


you can use (at least some of the) 'html' code within the 'msg' Scripts:

add new script -> 'output' section/category -> 'print a message' Script -> (see below)

print [EXPRESSION] "line 1<br>line 2<br><br>line 4<br><br><br>line 7"

or (I think it'll work, maybe not)

print [MESSAGE] line 1<br>line 2<br><br>line 4<br><br><br>line 7

using this in this forum post:

print [EXPRESSION] "line 1<br>line 2<br><br>line 4<br><br><br>line 7"

or (I think it'll work, maybe not)

print [MESSAGE] line 1<br>line 2<br><br>line 4<br><br><br>line 7

.
.
you can see in action even on this forum post itself too, lol:

print [EXPRESSION] "line 1
line 2

line 4


line 7"

or (I think it'll work, maybe not)

print [MESSAGE] line 1
line 2

line 4


line 7


in code:

msg ("line 1<br>line 2<br><br>line 4<br><br><br>line 7")

you can also use blank 'msg' Scripts too:

add new script -> 'output' section/category -> 'print a message' Script -> (see below)

print [MESSAGE]
(yes, leave it blank, as seen above)

// or

print [EXPRESSION] ""
(yes, leave it blank, but you still need the double quotes, as seen above)

an example:

in code (lazy)

msg ("line 1")
msg ("line 2")
msg ("")
msg ("line 4")
msg ("")
msg ("")
msg ("line 7")

Alright, I try to keep it simple.

If you can't just use enter twice to add a double linebreak, your best choice is <br> which adds a linebreak. When making a list, you better use <ul> and </ul> though.

Messages automatically end in a linebreak, so if you want an empty line inbetween, just add a "blank" messages that has no text.

If all this has no avail, you can always try the more obscure characters Unicode has to offer, like " ", " ", etc. They should be invisible to the players, and "fill up" a line so you don't have two breaks directly after each other.


As Zesc says, the default way to do this is by using msg("") - just printing out a blank line. You can also put <br /> in a message, which will act as an extra line break.

It may also be possible to use CSS. Off the top of my head, I think that the command:

JS.eval ("$('<style>').appendTo('head').text('#divOutput div span:last { margin-bottom:  1em;}');")

should add space after every line. However, this may cause some of Quest's built-in output (like room descriptions) look too spaced out where they already output blank paragraphs.
Something like that would remain in effect as long as the game is loaded; you'd probably want to put it in the UI Initialisation Script ('Advanced scripts' tab on the game element) to make sure it is run when starting a new game, or when loading a saved game.
(haven't tried this yet, so I could be wrong)


Okay I'm not sure where exactly to put all the commands suggested but when I have more time I will read in more detail and figure out where :D


@sceritz <br> is your friend. There are only very few situations in which it doesn't work, most of which you really don't have to worry about.

When used, it just adds a line break .


Log in to post a reply.

Support

Forums