Using MPI to enhance descs

From TwistedMUCK
Jump to: navigation, search

Using MPI to enhance descs

MPI stands for Message Parsing Interpreter and is a very flexible programming language. More information can be found in 'info' files. This tutorial will only give a very brief description on how to use MPI to show descriptions. The curious and inquisitive (is that redundant?) can type 'mpi' to find help files on MPI.

MPI commands can be interpreted from a person's @desc.

MPI has a number of commands built in that can parse and read lsedit lists. The two we will use are {list:} and {concat:}. The syntax is {list:<listname>} and {concat:<listname>}.

Examples on usage:

 @desc me={list:mydesc}          will show 'mydesc' when people look at
                                 you.
 @desc me={concat:_descs/human}  will show '_descs/human' when people
                                 look at you.
 @desc here={list:roomdesc}      will show 'roomdesc' when someone
                                 looks at the room.

The difference between the two functions is that {list:} shows each lsedit line straight with no formatting. {concat:} will process the list by stringing each line into one large line. It will also format the line. If the last character of a line is a period, then it will insert two spaces, otherwise it will insert one space.

You can have multiple MPI commands on one line.

Ex: @desc me={list:mydesc} {list:_descs/clothes} will first show the 'mydesc' list and then show '_descs/clothes' after it.

If you want to force a blank line, you can use the {nl} command between {list:} and {concat:} commands.

For example, @desc me={list:mydesc}{nl}{list:_descs/clothes}

If you want to have a blank line in the middle of a desc (this usually happens with {concat:}), putting {nl} by itself won't work. In this case it is necessary to put an {eval:} command around the {list:} or {concat:}.

Ex: @desc me={eval:{list:mydesc}}{eval:{list:_descs/clothes}}   or
    @desc me={eval:{list:mydesc}{list:_descs/clothes}}

~ Author Unknown

Further information: Some Notes On Using LSEdit
Personal tools