Some formating of the display
ferguson4848
02 Jul 2014, 21:13Does anyone know of a way to do one or both of these. I'd like to be able to have a new sentence indented and double space the whole thing.
Or if not actually double space, put more padding in the <br>.
So as an example:
Here is now it is now:
This is some text. This paragraph runs to the edge and
rolls over.
Here is some more.
This is how I'd like it to look:
This is some text. This paragraph runs to the edge and
rolls over.
Here is some more.
Thanks for any ideas.
Or if not actually double space, put more padding in the <br>.
So as an example:
Here is now it is now:
This is some text. This paragraph runs to the edge and
rolls over.
Here is some more.
This is how I'd like it to look:
This is some text. This paragraph runs to the edge and
rolls over.
Here is some more.
Thanks for any ideas.
HegemonKhan
02 Jul 2014, 21:24HegemonKhan wrote:found this post by Jay:"jaynabonne"
Just to insert a thought for some point in this discussion, in case it helps - for basic conditional string handling, I'd go with the text processor:
http://quest5.net/wiki/Text_processor
You still need to set flags, but once you do, it's trivial to make part of your text show up only sometimes (no scripting to concatenate strings, etc). For example, if you put the following in your room description:The bedroom is brightly painted, with numerous posters on the wall of bands from the 1980s. {if not player.hassword:There is a sword on the floor.}
then "There is a sword on the floor" will only show up if "player.hassword" is false.
ah, this is actually pretty simple, I should be able to help you get this to work.
----
there are also the other inline code stuff too, such as '<br></br>' (line breaks ~ line spaces, I think), but I'm not knowledgeable with inline coding yet.
----
as for spaces (and thus indenting and etc), if you choose 'print a message [EXPRESSION]' in the GUI~Editor, or just work with the code directly, you can add in spaces: using the quatation marks, as it 'saves' the characters and spaces~lack of characters between them:
"(spaces)"
msg (" " + player.alias + " is a " + player.gender-string + " " + player.race_string + " " + player.class_string + ".")
return~output, an example:
HK is a male human warrior.

jaynabonne
03 Jul 2014, 06:33Actually, HK, that doesn't work. HTML collapses whitespace down to a singe space (just as it did in the poster's original question). If you try what you just posted, you'll see only a single space.
You can get spaces to work using HTML non-breaking spaces. It's ugly, but it works:
That's only five, but you should get the idea. An easier way to do it would be to define a string attribute in the game, perhaps named "leadin" with however many spaces (as s you want). For example, in your room description, you'd be able to have this for your description text (no coding required!):
(Note that the Quest editor converts line breaks into <br>s for you in descriptions and things. If you're using msg in scripts, you'll have to put them in yourself - but you could always define another game attribute!)
You can get spaces to work using HTML non-breaking spaces. It's ugly, but it works:
msg (" " + player.alias + " is a " + player.gender-string + " " + player.race_string + " " + player.class_string + ".")
That's only five, but you should get the idea. An easier way to do it would be to define a string attribute in the game, perhaps named "leadin" with however many spaces (as s you want). For example, in your room description, you'd be able to have this for your description text (no coding required!):
{game.leadin}It was a dark and stormy night. You didn't normally like to take part in cliches, but you had no option tonight as your boss had just called and demanded you work the night shift for a change.
{game.leadin}As you drove along the twisty road high above the ocean, you wondered how your life had come to this.
etc
(Note that the Quest editor converts line breaks into <br>s for you in descriptions and things. If you're using msg in scripts, you'll have to put them in yourself - but you could always define another game attribute!)
HegemonKhan
03 Jul 2014, 06:57ah, thanks Jay, I wasn't aware of how HTML works, not use to the symbol heaviness of these languages yet (as I haven't gotten around to trying to learn this language yet, laughs).
though, doesn't quest have some kind of already built-in formating~indenting already (as this is a pretty basic thing to have, especially for text games, focusing on story~writing), or does it only have the alignment (center, left, right) stuff ?
but ya, making a string attribute containing the ugly space-creating symbols, is the way to go.
game.one_inch_indenting_atrtibute = (whatever the symbols are to do this) &hfbfi&cihss
game.two_inch_indenting_attribute = &ncsh&dshhb&shjnb&hdknsb
etc etc etc
or... maybe you could even create a hotkey~'hook' possibly somehow, (so you can just use the TAB key like you normally do with writing softwares), to input the indenting_attribute, laughs
msg (game.one_inch_indenting_attribute + "Hi, welcome to the world of ....")
though, doesn't quest have some kind of already built-in formating~indenting already (as this is a pretty basic thing to have, especially for text games, focusing on story~writing), or does it only have the alignment (center, left, right) stuff ?
but ya, making a string attribute containing the ugly space-creating symbols, is the way to go.
game.one_inch_indenting_atrtibute = (whatever the symbols are to do this) &hfbfi&cihss
game.two_inch_indenting_attribute = &ncsh&dshhb&shjnb&hdknsb
etc etc etc
or... maybe you could even create a hotkey~'hook' possibly somehow, (so you can just use the TAB key like you normally do with writing softwares), to input the indenting_attribute, laughs
msg (game.one_inch_indenting_attribute + "Hi, welcome to the world of ....")