I am having trouble with indenting the start of each paragraph. I already went into the style.css and added a css property to the body selector (text-align: justify;) but I couldn’t figure out how to indent just the paragraphs, because when I added the text-indent property it also indented the text of the choices.
I never mess with the code directly for this - only in the text editor( ie. Notepad) or scripting tool (CSIDE). I tend to use “spaces” but within the above tools, indents by tab also work. You’ll just need to be consistent whichever direction you go.
So, basically, you wanted to indent the text and not the code, am I right?
There’s a workaround in this case by using white space character to the text. However, if yo’re looking to align the text itself, I’m afraid CScript currently can’t handle that (although it’ll be nice if such feature is planned to be implemented)
Actually, I already figured out how to align the text (using the CSS property text-align). What I am looking for is indenting the start of each paragraph of text, not code. I was wondering if I could get help to implement this feature. Maybe the ChoiceScript developers could implement a property like *indent. I would do it myself if I could, the problem is that I don’t know what part of the code I need to edit to achieve this.
Thanks.
An actual command like *indent
would be pretty sweet!
For now, at least, our best option is probably as @Szaal suggested: To use one of the various space-like characters that don’t technically count as spaces for the purpose of ChoiceScript code.
Not to say this is a particularly good option. Some whitespace characters may be difficult to type, and others may prove impossible to type, requiring copy-paste actions. For example, the “No-Break Space” from that list may be typed on a standard English-language Windows machine by holding Alt and typing 0160 on the numberpad.
Another possibility is use of the Input Method Editor if your computer’s OS includes one. Once enabled, the IME will allow you to switch from one form of input to another. For example, from English to Chinese, Japanese, or Korean. Why bother? Well, a “standard” space in a language like that may use a different width than a standard space in English, thus requiring a different character. A character that ChoiceScript won’t recognize as a “space” for coding purposes, even though it very much is a space.
The Windows 7 IME offers five options once you switch from English to Japanese.
Spaces typed with the last two on that list (half-width Katakana and half-width Alphanumeric) count as regular spaces for ChoiceScript’s code. But spaces typed in the first three? Neither the Hiragana, Full-width Katakana, nor the Full-width Alphanumeric options count as spaces for coding purposes, so they all work for indentation the player can see.
Here are some examples of both the No-Break Space and the full-width spaces, "live" in a functional ChoiceScript test.
Neither one displays exactly as expected: The No-Break Spaces seem narrower than a normal space once in-game, while the full-width spaces are notably wider.
I’m not entirely sure if I can post the code for that sample through the forums, or if some of the spaces will be “converted” into regular English spaces in the process. But I’ll try! Here’s, to the best of my ability to share, the code I used to produce that zig-zag.
0 No-Break Spaces.
*line_break
2 No-Break Spaces.
*line_break
4 No-Break Spaces.
*line_break
6 No-Break Spaces.
*line_break
8 No-Break Spaces.
*line_break
0 Full-width spaces.
*line_break
2 Full-width spaces.
*line_break
4 Full-width spaces.
*line_break
6 Full-width spaces.
*line_break
8 Full-width spaces.
I should note that setting up and getting used to an IME is probably more difficult than the instructions make it appear. I set mine up long enough ago I don’t remember the tricks, traps, or confusions anymore. Could it be worth it anyway? Probably not! But if it seems interesting, maybe look into it?
EDIT: It seems the forums converted both the No-Break Spaces and full-width spaces in my code sample into regular spaces. I tried copy-pasting the version of the code sample displayed here back into my test game, and it didn’t work anymore. Disappointing, but not terribly unexpected.
Paragraphs only need indent if they are not spaced between one another. Indentation is not stylistic; it’s functional.
Without indentation:
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec augue odio, consequat in luctus non, posuere quis nisl. Donec vitae tellus non justo dictum mattis ac eu quam.
Curabitur pellentesque orci tristique velit fringilla condimentum. Etiam maximus lorem et lobortis sodales. Etiam ut felis ornare, efficitur urna in, dignissim sem.
Aenean et elit ex. Nunc nec pretium sapien, elementum posuere felis. Sed ac commodo nisi. Ut faucibus tempus arcu, id porta libero vehicula vel.
Donec gravida eget mi eget luctus. Maecenas ultricies congue leo eu dignissim. Proin pulvinar ipsum pretium, commodo dui id, maximus est.
With indentation (notice the first line):
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec augue odio, consequat in luctus non, posuere quis nisl. Donec vitae tellus non justo dictum mattis ac eu quam.
____Curabitur pellentesque orci tristique velit fringilla condimentum. Etiam maximus lorem et lobortis sodales. Etiam ut felis ornare, efficitur urna in, dignissim sem.
____Aenean et elit ex. Nunc nec pretium sapien, elementum posuere felis. Sed ac commodo nisi. Ut faucibus tempus arcu, id porta libero vehicula vel.
____Donec gravida eget mi eget luctus. Maecenas ultricies congue leo eu dignissim. Proin pulvinar ipsum pretium, commodo dui id, maximus est.
This looks better with Justified text, of course. Another thing, though this only applies to conventional books, is that, when you want to separate two different scenes in a chapter, even if you add a symbol or an asterisk (which is, again, only decorative), the first paragraph of the new scene must begin without indentation.
I don’t think indenting online text is that much of a great idea, unless you plan to print it or something. It won’t make the text look better, if that’s where you’re going; it actually gives off an amateurish vibe, no offense meant.
(Sample text from https://www.lipsum.com)