A Fur of a Different Color

Maybe you do more than just change your clothing with MPI, like change your eye color or fur color or your jewelry. You can change multiple properties with one command if you arrange them in 'sets'. This is basically a simplified version of MPI morphing.

I'm going to use an abbreviated version of Tephra's 'color me' command for this example. The original changes 10 properties at once, this one only changes 3.

Start by making the action that you'll use to change your properties. Choose something you'll remember easily, then link it to do-nothing, set it haven, and lock it to yourself.

@action clrme;qclrme=me
@link clrme=$nothing
@set clrme=h
@lock clrme=me

You might have noticed that I actually gave my action two names, clrme and qclrme. This will let me make two commands with only one action. On MUCKs with quotas this can be a very handy trick.

Now store values for your properties in sets. I'm going to put all my sets in a propdir called _colors on the action like this:

@set clrme=_colors/ivory/eyes:warm amber
@set clrme=_colors/ivory/horns:burnished gold
@set clrme=_colors/ivory/color:warm ivory, slightly darker on her back than her belly

@set clrme=_colors/purple/eyes:violet
@set clrme=_colors/purple/horns:ebon
@set clrme=_colors/purple/color:deep, glossy purple with a metallic sheen, growing a bit lighter at the feathered edges

Replace eyes, horns, color and their values with whatever properties you want to change in your description of course.

Now make a key so you can recall what sets you have stored, when you have many it's easy to forget. I use a two part key, one part works as an error message in the command and the other as a quick index.

This one is required for my MPI:

@set clrme=_colors/list:Current color schemes are ivory, burgundy, ice, paisley, purple, and black.

This second key is merely handy to have. If you forget what sets you have available you can just look at your command.

@desc clrme={eval:{list:redesc}}

Then make the list redesc. As you can see I have a few more schemes than the two I'm using for this lesson.

Color Schemes:
ivory - ivory and gold
burgundy - burgundy and gold with pink sapphires
ice - icy white, blue, and silver
paisley - pastel paisley
purple - metallic purple and black
black - black with silver jewelry

Now to write the MPI of the command.

The action needs to figure out which command you typed, this can be discovered with {&cmd}. Once you have the command you can move on to the proper success and osuccess MPI.

@success clrme={exec:_{&cmd}/succ}
@osuccess clrme={exec:_{&cmd}/osucc}

Now we have to write the MPI for the properties _clrme/succ, _clrme/osucc, _qclrme/succ, and _qclrme/osucc.

First, _clrme/succ, which is what you see when you run the command. [This would be entered all in one line, I've artificially wrapped it for clarity.]

@set clrme=_clrme/succ:{if:{strlen:{prop:_colors/{&arg}/eyes,this}},
{null:{tell:Your scales ripple and shift to a new color.},
{store:{prop:_colors/{&arg}/eyes,this},_dragprop/eyes,me},
{store:{prop:_colors/{&arg}/horns,this},_dragprop/horns,me},
{store:{prop:_colors/{&arg}/color,this},_dragprop/color,me}},
{null:{tell:I don't know what{&arg} means.},{exec:_colors/list}}}

Pretty ugly but actually very simple. The condition portion of the {if:} checks to see if the property set you asked for exists or not by looking for one of the properties in the set. You'd replace eyes with one of your property names of course.

The next four lines are the true case of the {if:} statement, the {null:} simply groups the commands together. First a {tell:} primitive to inform you that your command has worked, then one {store:} primitive for each property that you want to change.

When writing the {store:} segments the first argument is a {prop:} primitive which gets the value from the set stored on the command. The {&arg} will be replaced with the argument you used with your command, for instance clrme ivory would put ivory where {&arg} is in the statement. The second argument is the property in your description to store the value in, and the third is to specify that the property is on your character.

The final line is what to do if you type an argument that there's no match for in the properties. First it will tell you that it doesn't know the argument you typed means and then it will give you the listing of valid sets that you stored in the property _colors/list.

Now for _clrme/osucc:

@set clrme=_clrme/osucc:{null:{if:{strlen:{prop:_colors/{&arg}/eyes,me}},
{otell:'s scales ripple and shift to a new color.}}}

A simple check to see if the command will work, what to tell others in the room if it does, and nothing to do if it does not (so nothing will be displayed to the room). Note that your name will be put in front of whatever you write in the {otell:} and if you use any commas in the be sure to escape them with backslashes.

Do _qclrme/succ, and _qclrme/osucc the same way, notice the changes I've made. The message to me has ==> to indicate it's something only I see and there's nothing happening in _qclrme/osucc at all.

@Set me=_qclrme/succ:{if:{strlen:{prop:_colors/{&arg}/eyes,me}},
{null:{tell:==> Your scales quietly ripple and shift to a new color.},
{Store:{prop:_colors/{&arg}/eyes,this},_dragprop/eyes,me},
{store:{prop:_colors/{&arg}/horns,this},_dragprop/horns,me},
{store:{prop:_colors/{&arg}/color,this},_dragprop/color,me}},
{null:{tell:==>I don't know what{&arg} means.},{Exec:_colors/list}}}

@set me=_qclrme/osucc:{null:}

Tephra actually has two more commands on her version, patme and qpatme. These change the pattern of her scales on her giant snake morph. All four commands use only one action, a major savings in her quota on FurryMUCK.

To add commands to the action simply add the names to the action and then write the success and osuccess messages.

@name clrme=clrme;qclrme;patme;qpatme

@set clrme=_patme/succ:{some MPI}
@set clrme=_patme/osucc:{short MPI}
@set clrme=_qpatme/succ:{quiet MPI}
@set clrme=_qpatme/osucc:{null:}

Theoretically you could have dozens of commands on one action this way.


Code Main

 

©1997-2001 Lynn A. Davis