prev| toc| next
 

4.3 Making Puppets

A puppet (or `zombie') is a player-like object of type thing, set up so that it can move and act independently, relaying everything it sees and hears to the controlling character.

In the strictest sense, all that is required to turn an object into a zombie is to set its Z(ombie) flag. This will cause it to relay messages, and to be treated as a zombie by programs which distinguish between zombies and players. In practice, two other steps are required to create a working puppet: locking and setting the puppet so that it can be forced, and creating an action to control it. First, create the puppet object. Since the puppet will often be in a different location than your character, it's a good idea to give it a registered name as well. Then, set its Z(ombie) flag.

====================================
> @create Squiggy == pup
  Squiggy created with number 128629.
  Registered as $pup
> @set squig = Z
  Flag set.
====================================

Next, set the puppet's X(forcible) flag, and force_lock it to you.

====================================
> @set squiggy = X
  Flag set.
> @flock squiggy = me
  Force lock set.
====================================

It would be possible to stop at this point, and use the @force command to make the puppet do what you want.

====================================
> @force $pup =:jumps!
  Squiggy jumps!
====================================

In practice, it will be more convenient to create an action that simplifies frequent typing. Use an action name that's short and easy to type, and won't conflict with other common exit names. `Z' is a frequently used command name for controlling a zombie. Then, link the action to a do-nothing program, lock it to a condition that always fails, such as `me&!me', and set its fail with an MPI string that forces the puppet.

====================================
> @act z = me
  Action created with number 128630 and attached.
> @link z = $nothing
  Linked to do-nothing.muf(#197FLM2)
> @lock z = me&!me
  Locked.
> @fail z = {force:$pup,{&arg}}
  Message set.
====================================

'&arg' is a variable: it holds whatever was typed after the command. If you typed `z :jumps!', &arg would hold the string `:jumps!'. The fail set on the control action would force the puppet with `:jumps!'.

====================================
> z :jumps!
  Squiggy jumps!
> z out
  Squiggy heads out to the park.
  Squiggy has departed.
  Squiggy> You head out to the park...
  Squiggy> Alcot Park
  Squiggy> A sweep of close-cropped green grass extends...
====================================

As indicated in the example above, output from the puppet is preceded with the puppet's name, and a > greater than symbol to distinguish it from your own output. This prefix string can be changed with the @pecho command: @pecho <puppet object> = <prefix string>

====================================
> @pecho squiggy = *
  Message set.
> z look
  *Alcaot Park
  *A sweep of close-cropped grass extends...
====================================

prev| toc| top| next