Manual:Zone Manual/Color and Formatting Codes/Formatting codes

From DikuMUD Wiki
< Manual:Zone Manual‎ | Color and Formatting Codes
Revision as of 11:36, 26 May 2020 by Nove (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Formatting codes

As you may have noticed the string fields on the VME are formatted in an english paragraph style. What that means is all text is formatted with he following rules:

All leading blanks are stripped away. For room descriptions 3 leading spaces are added. This way we ensure a consistent formatting of the displayed room descriptions.

Spaces and blanks (newlines) are contracted to single spaces yielding a correctly 'wrapped' text for any sentence.

If a '.' is encountered followed by a blank, a total of two spaces are inserted after the '.'. These formatting rules are great for normal descriptions and extras but what if you want to make a sign or a map. You don't always want the text to be rapped, if the server rapped your sign it would turn out looking like a jumble of punctuation in the form of a paragraph. (Link to formattable) contains a list of all formatting characters and a short description of them. (Link to formatdescr) contains a more in depth discussion of each format command with examples and (Link to colordescr) deals with the color commands.

Formatting and color codes
Code Description
& Used to make an & character instead of an escape code.
l Text from this point forward will not be formatted. It will

be interpreted literally with newlines, spaces, etc. Useful when making a sign or a map.

f Text from this point forward will be formatted. This option

is the reverse of &l and is default on any section of text.

s<#> Force a singe space character (or <#> if specified, may

come in handy, instead of having to toggle formatting).

n Force a new line, very handy instead of toggling the &l

formatting switch.

h Clears the screen if the terminal of the user supports it.
x A file new line used for split so that you can split a file into lines
c<color> Set the foreground color.
b<color> Set the background color.
[<color>] Set a preset foreground and background color.
Previous: Color and Formatting Codes
Next: Formatting code descriptions and examples