prev | toc | next
 

4.4 Making Vehicles

MUCK has a rather limited set of server commands for using vehicles: objects configured such that players may get inside them, and see what happens outside the vehicle. Many MUCKs also have more elaborate MUF programs for vehicles. But, since these will vary widely from MUCK to MUCK, only the server vehcile commands are discussed here.

A vehicle is in many ways much like a puppet. Whereas a puppet is created by setting the Z(ombie) flag on an object of type THING, a vehicle is created by setting the V(ehicle) flag on an object of type THING. Puppets broadcast anything hearable in their location to their owner; vehicles broadcast anything hearable in their location to all players inside the vehicle. The preface string marking puppet output is set with the @pecho commmand; the preface string marking vehicle output is set with the @oecho command. As with puppets, it is usually necessary to force_lock the vehicle to users who are allowed to drive (or fly or steer) it, and to create an action that implements this. One significant difference between puppets and vehicles: you need to create an action that lets you get inside a vehicle. This done by creating an action that is both attached and linked to the vehicle:

====================================
> @create 1967 Corvette Sting Ray
  1967 Corvette Sting Ray created with number #558.
> @set 1967 = V
  Flag set.
> @act getin = 1967
  Action created with number #559 and attached.
> @link getin = 1967
  Linked to 1967 Corvette Sting Ray(#558V)
> drop 1967
  Dropped.
> getin
  1967 Corvette Sting Ray(#558V)
====================================

To describe the interior of the vehicle, use the @idesc command:

====================================
> @idesc here = The 'vette's interior is pristine: gleaming chrome,
  smooth blue vinyl, and rubbery floormats.
> look
  The 'vette's interior is pristine: gleaming chrome, smooth blue
  vinyl, and rubbery floormats.
====================================

You do not need to create an action that takes you out of the vehicle: the server command leave will do this for you.

You do, however, need to set up an action that will let you control the vehicle. The action will work by forcing the vehicle, so it needs to be set X(forcible) and force_locked to you.

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

If you wanted anyone to be able to drive the vehicle, you would need to set the force lock to something that would succeed for all players, such as @flock 1967 = !#0.

To make an action that controls the vehicle, create an action as normal, attached to the vehicle, lock it to a condition that always fails, and set its @fail message with MPI that forces the vehicle to act as specified by the action's argument:

====================================
> @act drive = 1967
Action created with number 560 and attached.
> @lock drive = me&!me
Locked.
> @fail drive = {force:#558,{&arg}}
Message set.
> drive :vroom vrooOOOOmms!
Outside> 1967 Corvette Sting Ray vroom vrooOOOmms!
> drive n
Outside> ( ... the vette goes north; we see the appropriate output )
====================================

By default, all emits outside the vehicle will be broadcast to the vehicle's interior, prepended with the string outside>. You can change this prepend string with the @oecho command:

====================================
  (Outside the vehicle, Holbrook waves.)
  Outside> Holbrook waves.

> @oecho 1967 = >>>
  Message set.

  (Holbrook waves again for us.)
  >>> Holbrook waves again.
====================================

Note: Soft-coded look, pose, and say commands may alter the behavior of vehicles from what is described here.

prev | toc | top | next