
Using the func_frame object
---------------------------

func_frame objects are used to define complex scripted brush-based objects
which may interact with the player and other entities.

A simple definition of all of the func_frame entries follows:

{
   "classname" "func_frame"     // Classname
   "origin" "x y z"             // Where to put this object
   "wait" "t"                   // How long, minimum, to wait between frames
   "sounds" "s"                 // Sound to make when animating
   "targetname" "t"             // Activation targetname
   "firstframe" "f"             // First frame to display
   "spawnflags" "s"             // Spawnflags
}

The sounds range from 0 to 7, and are as follows:

	sounds = 0		No sound
	sounds = 1		Platform sound
	sounds = 2		Platform sound
	sounds = 3		Ratchet metal moving train
	sounds = 4		Stone door sound
	sounds = 5		Military base door sound
	sounds = 6		Stone chain door sound
	sounds = 7		Screechy metal door sound

The spawnflags currently only have one possibility:

	spawnflags == 1 	Block by the bounding box instead of the BSP.

The classname and firstframe entries are required.  The firstframe entry must
match one of the available frame_def targetnames.  Even if the targetname
entry is defined for a func_frame object, it can still continue to animate;
this entry merely defines what name to activate on.

Each func_frame object is defined by a series of linked func_framedef
definitions.  Each func_framedef, in turn, points at a func_framemodel which
contains the actual model to display for that func_framedef.  Since models
are not attached to the scripting definitions, they can be reused in
multiple scripting definitions.  One possible example is the ability to have
a spinning wheel which can spin both forward and reverse.  Since the models
are split from the frame definitions, they can be reused; the forward
script and the reverse script can use the same models.

The class "func_framemodel" is a very simple class:

{
   "classname" "func_framemodel" // Classname
   "targetname" "t"              // Name of this model

   ... DEFINE BRUSHES ...
}

The "func_framedef" class is somewhat more complex, since it defines the
full scripting behavior for this object.

{
   "classname" "func_framedef"  // Classname
   "targetname" "f"             // Name of this framedef
   "showmodel" "m"              // Actual func_framemodel to display.
   "origin" "x y z"             // Where to move the model to before
				//   displaying it.  To determine where
				//   the model will actually go, add the
				//   model coordinate to this value, and
				//   add this value to the origin of the
				//   owner func_frame object.  The result-
				//   ing coordinate is the actual display
				//   coordinate.
   "nextframe" "f"              // Framedef to display after wait time
				//   If undefined, the script will stop.
   "wait" "n"                   // How long to wait.  The true wait time
				//   is the sum of the func_frame wait
				//   time and this wait time.  If -1, the
				//   script will stop.
   "touchframe" "f"             // Which framedef to display if touched
				//   by something.  This works both when the
				//   script is running and when it is
				//   not running.  This is true for all of
				//   the "xxxframe" entries.
   "targetframe" "f"            // Which framedef to display if activated
				//   by something.
   "playerframe" "f"            // Which framedef to display if touched by
				//   the player.
   "shootframe" "f"             // Which framedef to display if shot.
   "target" "t"                 // Sends out an activate to this target
				//   when this frame gets displayed.
}

Usage Notes
-----------

1.  If the player is inside the brush of the next frame when it spawns, it
    will *not* hurt the player, but the player may be trapped inside the
    brush.

2.  Both switches/buttons/levers and activated platforms/doors/etc. may be
    made of func_frame objects, since framed objects can respond to touching
    and can respond to activation.

3.  Try to keep models to a minimum, as they are memory-intensive/expensive.
    On average, each new brush adds between 1K and 4K to the .BSP file, so
    a framed object with 10 models and 10 brushes per model could cost 100K.

