How do I indent?!
No1Looks4Me
03 Jan 2016, 20:33

XanMag
04 Jan 2016, 01:20Ha. That does sound simple, but I have not seen that question before. I fiddled, very briefly with it, and could not figure it out either. If it is an absolute must that you indent and no one offers a better solution you can always copy-paste this "hack-job" wherever you want to indent.
That is assuming that your background is white. If it is red, or blue, or whatever color, you can substitute that color where it says "white". All this does is print the word "indent" in white text. Obviously, to the game player, it looks like a blank space of white where indenting is appropriate.
I'm sure there is a better way, but I cannot think of one. So, if no one offers a simpler, more sensible solution... you can use this.

<font color = "white">indent</font>The night was sultry. Blah blah blah....
That is assuming that your background is white. If it is red, or blue, or whatever color, you can substitute that color where it says "white". All this does is print the word "indent" in white text. Obviously, to the game player, it looks like a blank space of white where indenting is appropriate.
I'm sure there is a better way, but I cannot think of one. So, if no one offers a simpler, more sensible solution... you can use this.

OurJud
04 Jan 2016, 02:13I nearly offered this as a solution, but was too embarrassed 

HegemonKhan
04 Jan 2016, 03:44I couldn't figure out how to get quest to preserve~accept multiple whitespaces, as I've tried to create an indenting~margining function (very easy to do in python, lol), as it seems that in quest's underlying coding, it unfortunately removes multiple whitespaces. I've tried concatenating, using stringlists (splitting and joining), and etc methods (\t, while and for loops, and etc) in other languages, but quest still automatically~underneath removes any multiple whitespaces.
....
HOWEVER, I found out how to do it, hehe:
http://docs.textadventures.co.uk/quest/ ... tting.html (this showed that you can use HTML tags, and not seeing any for indenting~margining, I looked it up, see link below):
http://www.simplehtmlguide.com/text.php (not the best site for html, but it's what came up on google, using search: html formatting)
and it, <blockquote>xxx</blockquote>, works!
an example of doing it in coding:
(if you're doing this in code, you need the 'CDATA' tag block)
to do this in the GUI~Editor, an example:
run as script -> output -> 'print a message' Script -> print [MESSAGE] <blockquote>Hello</blockquote>
OR (if you want to use dynamic~variable outputting), an example:
run as script -> output -> 'print a message' Script -> print [EXPRESSION] "<blockquote>Hello</blockquote>"
example of actually using dynamic~variable usage:
run as script -> variables -> 'set a variable or attribute' Script -> set variable x = [EXPRESSION] "Bye"
run as script -> output -> 'print a message' Script -> print [EXPRESSION] "<blockquote>Hello " + x + "</blockquote>"
// outputs:
-------------
off-topic, in Python (credit to my Python prof), three simple but useful Formatting Functions:
(the 'def' key word~command is Python's Functions)
(simple stuff, but it's much better than having to manually do the formatting of each message line~block, hehe)
....
HOWEVER, I found out how to do it, hehe:
http://docs.textadventures.co.uk/quest/ ... tting.html (this showed that you can use HTML tags, and not seeing any for indenting~margining, I looked it up, see link below):
http://www.simplehtmlguide.com/text.php (not the best site for html, but it's what came up on google, using search: html formatting)
and it, <blockquote>xxx</blockquote>, works!
an example of doing it in coding:
(if you're doing this in code, you need the 'CDATA' tag block)
<game name="xxx">
<start type="script"><![CDATA[
msg ("<blockquote>Hello</blockquote>")
// outputs:
//: Hello
]]></start>
</game>
to do this in the GUI~Editor, an example:
run as script -> output -> 'print a message' Script -> print [MESSAGE] <blockquote>Hello</blockquote>
OR (if you want to use dynamic~variable outputting), an example:
run as script -> output -> 'print a message' Script -> print [EXPRESSION] "<blockquote>Hello</blockquote>"
example of actually using dynamic~variable usage:
run as script -> variables -> 'set a variable or attribute' Script -> set variable x = [EXPRESSION] "Bye"
run as script -> output -> 'print a message' Script -> print [EXPRESSION] "<blockquote>Hello " + x + "</blockquote>"
// outputs:
Hello Bye
-------------
off-topic, in Python (credit to my Python prof), three simple but useful Formatting Functions:
(the 'def' key word~command is Python's Functions)
(simple stuff, but it's much better than having to manually do the formatting of each message line~block, hehe)
// this is vertical tabbing~spacing (how many lines are skipped, or aka: how many empty lines):
def LineEject (A):
K = 0
while K < A:
print
K += 1
// this is indenting ~ horizontal tabbing (setting how many spaces to indent):
def LeftMargin (A):
K = 0
while K < A:
print "",
K += 1
// this is to center a string:
(80 is the default pixel width of a command prompt box)
def Center (A,B):
K = (80 - len (A)) / 2
LeftMargin (K)
print A
LineEject (B)

jaynabonne
04 Jan 2016, 07:32HTML doesn't support a tab character as such, and it collapses multiple spaces down to one space. However, there is something called a "non-breaking space", which will not get collapsed down. It has a special sequence:
So, for example, if you wanted "<three spaces>Hello, world", then you'd enter:
I would have sworn The Pixie had created a function for adding multiple spaces as a string, but I can't find it at the moment.
So, for example, if you wanted "<three spaces>Hello, world", then you'd enter:
Hello, world
I would have sworn The Pixie had created a function for adding multiple spaces as a string, but I can't find it at the moment.
The Pixie
04 Jan 2016, 07:53jaynabonne wrote:I would have sworn The Pixie had created a function for adding multiple spaces as a string, but I can't find it at the moment.
End of the third post here:
viewtopic.php?f=18&t=5614
HegemonKhan
04 Jan 2016, 18:15ah, so Pixie had to use the special command or char data type ( ) to get it to preserve the whitespaces, and then simply using that in a Function to concatenate the number of spaces.
ah, so it's the HTML of quest that removes the multiple whitespaces, not quest's internal coding directly itself. Always learning from you guys~girls, much appreciated!
------------------------------
again, there's also HTML's '<blockquote>xxx</blockquote>' command which works too in quest for at least simple indenting (I haven't tested it beyond seeing that it does work~indent in quest).
For full control, use the ' ' with a Function, as Pixie done.
ah, so it's the HTML of quest that removes the multiple whitespaces, not quest's internal coding directly itself. Always learning from you guys~girls, much appreciated!
------------------------------
again, there's also HTML's '<blockquote>xxx</blockquote>' command which works too in quest for at least simple indenting (I haven't tested it beyond seeing that it does work~indent in quest).
For full control, use the ' ' with a Function, as Pixie done.
The Pixie
04 Jan 2016, 21:37It is not just the HTML of Quest, it is all HTML.
The blockquote thing will indent the whole paragraph; I was assuming it was just the first line to be indented.
The blockquote thing will indent the whole paragraph; I was assuming it was just the first line to be indented.

jaynabonne
04 Jan 2016, 21:41Blockquote also puts top and bottom margins on the block, which make it less than useful when it's not what you want. (But when it does what you want, it works fine!)