Basic Text Formatting
From ElanVital
Contents |
Paragraphs
Paragraphs are probably the easiest thing to format, code-wise. It's as simple as this: %r creates a return, and %t causes a tab. So:
-> Jane did this.%rJane did that.
gets:
Jane did this. Jane did that.
And:
-> Jane did this.%r%tJane did that.
gets:
Jane did this.
Jane did that.
Tada. Simple as that.
ANSI
ANSI code is only slightly more difficult than paragraph breaks. The basic format is [ansi(<codes>,<text>)] where <codes> are the codes in the in-game helpfile (HELP ANSI() ) and <text> is the text you wish to color (remember your square brackets--if you don't, things go wonky).
The codes are:
f - flash F - not flash h - hilite H - not hilite u - underscore U - not underscore i - inverse I - not inverse n - normal d - default foreground D - default background x - black foreground X - black background r - red foreground R - red background g - green foreground G - green background y - yellow foreground Y - yellow background b - blue foreground B - blue background m - magenta foreground M - magenta background c - cyan foreground C - cyan background w - white foreground W - white background
Thusly:
-> [ansi(b,text)]
will give you:
text
And so on and so forth. I recommend experimenting with it in-game to get a good feel for which colors are what--a good way is to prefix your command with th or think so that you repeat it to yourself. E.g., th [ansi(hg,text)]
Repeating
To repeat text, all you have to do is use the syntax [repeat(<text>,<number of times to repeat>)]
Such as:
-> [repeat(*,5)]
*****
Mind, whatever you plug in for <text>, the whole thing will repeat as many times as you specify. That is not a number of characters you're plugging in.
-> [repeat(_+*,5)]
_+*_+*_+*_+*_+*
Centering
Centering text is handy in certain situations, and not terribly difficult to do. It runs something like this:
To center, use the syntax [center(<text>,<line width>,{<fill>,{right fill}})] - which looks a lot trickier than it really is. The basic is just [center(<text>, <line width>)], where <text> is the text you wish to center and <line width> is the number of characters across your screen is. For most people, it's either 80 or 78, but it varies. <Fill> is a character or string of characters you can plug in that will pad your <text> on either side, and <right fill> is a character or string of characters that will pad the right side of the <text> only, allowing you to alter the padding on either side if you want to.
Examples!
-> [center(Yada yada,80)]
Yada yada
-
-> [center(Yada yada,80,+)]
++++++++++++++++++++++++++++++++++++Yada yada++++++++++++++++++++++++++++++++++
-
-> [center(Yada yada,80,+,-)]
++++++++++++++++++++++++++++++++++++Yada yada----------------------------------
If we alter the line width to make it a number smaller than eighty, the center it's basing off of will shift towards the left margin, like so:
-> [center(Yada yada,31,-)]
-----------Yada yada-----------
Yon Grande Example (Putting It Together)
Using everything explained on this page together, we can do this:
-> [center([ansi(b,Wa)][ansi(c,te)][ansi(b,r)] [ansi(hr,Fi)][ansi(r,re)],30,[ansi(g,-)])]
----------Water Fire----------
or
-> [repeat([ansi(hg,-)][ansi(hc,*)][ansi(r,_)],10)]
-*_-*_-*_-*_-*_-*_-*_-*_-*_-*_