By Thalen

This wonderful feature was initially built in for the note board system (if I remember correctly). It can also be used in several places to help you with editing and formatting of building commands. A good example of this is in making room descriptions, where formatting needs to be set pretty close to perfect if things are going to look good. But there are several other places where this edito can come in handy, such as mob descriptions, and edescs in objects and rooms.

There are several features in the editor that will save you a lot of time once you get to know them. Try to get familiar with each of the commands; once you know how they work, you'll ceratinly find places where they will come in handy.

For illustrative purposes, lets use the example of editing a room description. Without the editor, you'r first type 'brset here desc clear' followed by 'brset here desc <line one of the room desc>' etc. To get the command started in the editor, type:

brset here desc edit

This takes whatever the room already has for a description and puts it into the editor for you.

-=======- Entering APPEND Mode -========-
    Type :h on a new line for help
 Terminate with a ~ or @ on a blank line.
-=======================================-
It is so empty in here
>_

(the underscore character denotes where the curser would be). This is what a new room would look like – the 'It is so empty in here' is the default room description. The first few lines displayed give you the most important things to know: How to get help,and how to quit. If you type :h at this point, you would see:

String Editor help (commands on blank line):
:r 'old' 'new'   - replace a substring
                   (requires '', "")
:h [topic]       - get help (also :h :r for more info on :r)
:d [line]        - delete that line (default: last line)
:i <line> <text> - Insert text before that line
:s               - show string so far
:l               - show string line numbers
:f [width]       - word wrap string
:c               - clear string so far
@ or ~            - end string

In the room desc above, the first thing I'd want to do is to get rid of the default text. To do this, type:

:d

This command deleted the last line in the editor. You can do this several times in succession to remove the last several lines. Now, in order to add a few lines, simply type the lines at the prompt, just like in the note system.

> this is a test of the emergency broadcase syste.
>
> this is ONLY a tes...
> _

(the second line represents hitting enter on a blank line...this can be done for formatting purposes and the editor will insert a blank line, which is something that used to get ignored, but now works fine).

Now, to see what we have so far:

> :s
String so far:
this is a test of the emergency broadcase syste.
this is ONLY a tes...
> _

Now, we have a few problems...to start with, I didn't MEAN to put a blank line between the other two lines. I need to delete just that one line, leaving the other two a they are (for now). Using the other display option, L, gives me this:

> :l
String so far:
 1 this is a tes of the emergency broadcase syste.
 2
 3 this is ONLY a test...
> _

Now, each of the lines displays with it's line number. In order to delete just line 2, I go back to the D command, this time adding the line number I want to delete

> :l
String so far:
 1 this is a test of the emergency broadcase syste.
 2
 3 this is ONLY a tes...
> :d 2
Line deleted.
> :s
String so far:
this is a test of the emergency broadcase syste.
this is ONLY a tes...
>

Better, but still not good...The typos need to be fixed, and rather than retyping the while line in, I'll just replace the bad parts. This will use the R command. From the help screen above, the syntax for this command is:

:r 'old' 'new'
 You need to use either single or double quotes to surround the text lines.  Also note that this will replace only the first instance of the error.
Another note: watch what you type in as replacement text - if you enter something that is very short, the editor may find an example of that text someplace other than where you made a mistake, and do a replacement where you don't want it.  In my example above, if I tried to replace the typo 'tes' with 'test', the editor would search down, find 'tes' in the word 'test' in the first line, and change it to 'testt'.  To be sure, I would type:
:r 'tes...' 'test...'
 While I'm at it, I will:
:r 'syste.' 'system.'

And so now I have:

> :l
String so far:
 1 this is a test of the emergency broadcase system.
 2 this is ONLY a test...
> _

OK so lets say I forgot a line...the command to do so is the I command, and the syntax is:

:i <line> <text>

This inserts the text you enter BEFORE the line you specify. I want a line between 1 and 2, so I type:

:i 2 Please stand by while our billion mega-watt transmitters focus all their power and tecnology on producing a screeching tone designed specifically to drive small dogs insane.

The result of this unfortunate bit of creativity would be:

> :l
String so far:
 1 this is a test of the emergency broadcase system.
 2 Please stand by while our billion mega-watt transmitters focus all their power and tecnology on producing a screeching tone designed specifically to drive small dogs insane.
 3 this is ONLY a test...
> _

Line 2 is rather obviously too long to fit as a room description. But rather than retyping the whole thing, you can use the F command in the editor to change the formatting. The syntax for this is:

:f [width]

You can set the width to any number of columns you want, but don't use more than 80. The default setting is also 80, you you can simply type in:

> :f
String formatted.
> :l
String so far:
 1 This is a test of the emergency broadcase system.  Please stand by while
 2 our billion mega-watt transmitters focus all their power and tecnology on
 3 producing a screeching tone designed specifically to drive small dogs
 4 insane.  This is ONLY a test...
> _

This has the side effect of removing the breaks that you had originally placed in the text. For formatting full paragraphs, this isn't an issue at all. The problem comes when you have more than one paragraph...the :f command removes all blank lines, and combines everything into one big paragraph. If you run into formatting trouble on a multi-paragraph desc, you may need to start from scratch.

To clear out the whole description so you can start over, use the C command:

> :c
String cleared.
> :l
String so far:
> _

It was a pretty silly description anyway....

----------

Lets just go back to what I had a while back, when the desc was just the original 3 lines.

> :l
String so far:
 1 This is a test of the emergency broadcase system.
 2 This is ONLY a test...
> _

Now what I SHOULD have done was to insert a blank line between 1 and 2, and left off the silly bit. However, there is no way to insert a blank line, only a line with text on it...right? WRONG! If you use the insert command, and don't tell it what text to put in...

> :l
String so far:
 1 This is a test of the emergency broadcase system.
 2 This is ONLY a test...
> :i 2
OK, inserted.
> :l
String so far:
 1 This is a test of the emergency broadcase system.
 2
 3 This is ONLY a test...
> _

That's about it, there's not much more to know. The help file says that if you want to use a period instead of a semi-colon, feel free. The only thing left to do is to type the command to finish off the edit (~ or @) and you're all set.

Back to Area Building