But your eyes were open!

If you have a habit of sleeping in public places you might want to have a different description for when people look at you when you are sleeping. It's also nice if you happen to share a sleeping space with one or more other people, it adds to the ambiance of the room to have sleepers that actually look like they are sleeping.

First, we need to make sure your description is read from a file. The simplest way is to use editplayer. If you've done some of my other tutorials you've already seen how to do the work of editplayer by hand. In either case I'll include a quick run through for those that haven't done either.

If typing editplayer does something other than tell you there is no such command then use it to describe your character. Otherwise you need to do the following:

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

Now go into lsedit and write your description.

lsedit me=redesc

When you are done with your description type .end

Now let's write your sleeping description:

lsedit me=sleep

Write your sleeping description just like you did your regular 'awake' description.

Now for the actual MPI.

@desc me={if:{ne:{awake:me},0},{eval:{list:redesc}},{eval:{list:sleep}}}

Breaking this down you have a simple {if:} statement, the condition {ne:{awake:me},0}, and two expressions (the {eval:} bits).

The primitive {awake:} takes the name of the player and checks to see if they're connected, if they are it returns the number of connections they have. Because {awake:} can return any number (in theory) if the player has connected we make our condition based on the player not being connected, when {awake:} returns 0.

The way this MPI is set up it means "If I'm not sleeping show my awake description, otherwise show my sleeping description." You could also set it up to mean "If I'm sleeping show my sleeping description, otherwise show my waking description" this way:

@desc me={if:{eq:{awake:me},0},{eval:{list:sleep}},{eval:{list:redesc}}}

Which order you use it up to your personal preference.

The only downside of this MPI trick if you can't see it yourself. To test your description you will either need to have someone that can come, watch you fall a sleep, look at you, watch you wake up and tell you want they saw (somewhat complicated) or you need to have a second character on the muck you can log into and use to look at your sleeping character. However if you pasted the @desc line of your choice from this page and have created both descriptions properly this MPI will work.


Code Main

 

©1997-2001 Lynn A. Davis