#SEQUENCE "follow";
# this_control_jump( 
  "range faction",
  "*faction       = \"evil\";
   *min_dist      = 0.0;
   *max_dist      = 20.0;
   *aggressive    = 1;
   *avoid_faction = \"good\";
   *avoid_dist = rand(2,3);

// The action is going to be kinda hairy, because we've got to insert numerical
// values into a string.
*action =
  \"
    var script = \\\" \\\";
    script =
      add(
        \\\"  *faction       = \\\\\\\"evil\\\\\\\";
            *move_x        = \\\", num_to_str( this_x(),  1 ),\\\"; 
			*move_y        = \\\", num_to_str( this_y(),  1 ),\\\"; 
		    *orig_x        = 0;
            *orig_y        = -1.1;
            *orig_z        = rand(.9,1.0);
            *speed         = 50;
            *shots         = 2;
            *rate          = 2;
            *error         = 1;
            *damage        = rand( 7, 14 );
			*particle      = \\\\\\\"beam_01\\\\\\\";
            *vec_sounds    = { \\\\\\\"monsters/turret_01.wav\\\\\\\", \\\\\\\"monsters/turret_02.wav\\\\\\\", \\\\\\\"monsters/turret_03.wav\\\\\\\"  };
            *line_of_sight = 3.0;
		\\\"
        );

    this_control_push(
      \\\"shoot\\\",
      script,
      1
      );

	*wait = rand( 2.0, 2.2 );
	\";", 1.0);
  wait( 0.1 );
# seq_jump("wait");

#SEQUENCE "wait";
# wait( 10000 );