<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE doc
  SYSTEM '../../clonk.dtd'>
<?xml-stylesheet type="text/xsl" href="../../clonk.xsl"?>
<doc>
  <title>ActMap</title>
  <h>ActMap</h>
  <part>
  <text>The ActMap property describes possible actions (i.e., activities like walking and scaling for clonks; or opening/closing doors of buildings), of an object. It is almost always inherited from their definition. The animation phases of each activity are placed as adjacent images in the Graphics.png (and/or Overlay.png). These animations are being referenced using image coordinates in the ActMap. Animations may be started by script (see <emlink href="script/fn/SetAction.html">SetAction</emlink>) or directly by the engine. Some activities - especially those of clonks and animals - use an engine-internal <emlink href="definition/procedures.html">procedure</emlink>, which controls the movement of an object while such an activity is set.</text>
  <text>
    <table>
      <caption id="BeliebigvieleSektionenAction">Any number of proplists</caption>
      <rowh>
        <col>Property</col>
        <col>Data type</col>
        <col>Description</col>
      </rowh>
      <row>
        <literal_col>Name</literal_col>
        <col>String</col>
        <col>Name of the activity. See <emlink href="script/fn/SetAction.html">SetAction</emlink>().</col>
      </row>
      <row>
        <literal_col>Procedure</literal_col>
        <col>String</col>
        <col>Internal procedure. See <emlink href="definition/procedures.html">Procedures</emlink>.</col>
      </row>
      <row>
        <literal_col>Speed</literal_col>
        <col>Integer</col>
        <col>The maximum speed in 1/100 px/frame an internal procedure will move the object with. See <emlink href="definition/procedures.html">Procedures</emlink>.</col>
      </row>
      <row>
        <literal_col>Accel</literal_col>
        <col>Integer</col>
        <col>The acceleration in 1/100 px/frame² an internal procedure will apply to the object. See <emlink href="definition/procedures.html">Procedures</emlink>.</col>
      </row>
      <row>
        <literal_col>Decel</literal_col>
        <col>Integer</col>
        <col>The deceleration in 1/100 px/frame² the internal procedure WALK will apply to the object. See <emlink href="definition/procedures.html">Procedures</emlink>.</col>
      </row>
      <row>
        <literal_col>Directions</literal_col>
        <col>Integer</col>
        <col>Number of animation directions. Animation directions are arranged vertically in Graphics.png.</col>
      </row>
      <row>
        <literal_col>FlipDir</literal_col>
        <col>Integer</col>
        <col>If nonzero, this value specifies the first animation phase that is produced by mirroring one of the previous animation directions. If this value is 1, graphics of direction 1 (DIR_Right) will be drawn as a horizontally mirrored graphics of direction 0 (DIR_Left) (see clonks). If it is 7, any directions n &gt;= 7 will be drawn using the mirrored graphics of directions 6 - n, i.e. higher direction values will be drawn using the mirrored graphics in reverse orders (cf. banner in the knights pack).</col>
      </row>
      <row>
        <literal_col>Length</literal_col>
        <col>Integer</col>
        <col>Number of animation phases for this activity (arranged horizontally in Graphics.png)</col>
      </row>
      <row>
        <literal_col>Reverse</literal_col>
        <col>Integer</col>
        <col>0 or 1. If 1, the animation phases will be shown in reverse order.</col>
      </row>
      <row>
        <literal_col>Delay</literal_col>
        <col>Integer</col>
        <col>Time difference in frames (ticks) between two animation phases.</col>
      </row>
      <row>
        <literal_col>Attach</literal_col>
        <col>Integer</col>
        <col>Attachment to surfaces: <emlink href="definition/cnat.html">CNAT Value</emlink>, e.g. value 8 if the object should attach to the floor like a walking clonk does; or 4 for attachment to the ceiling like a hangling clonk. Only evaluated if the procedure is NONE.</col>
      </row>
      <row>
        <literal_col>Facet</literal_col>
        <col>6 integers</col>
        <col>Animation graphics: Target rectangle from Graphics.png relative to upper left corner of unrotated object shape.</col>
      </row>
      <row>
        <literal_col>FacetBase</literal_col>
        <col>Integer</col>
        <col>0 or 1. If 1, the default facet (i.e., the facet shown if the object has no action) will be drawn behind the action facet.</col>
      </row>
      <row>
        <literal_col>FacetTopFace</literal_col>
        <col>Integer</col>
        <col>0 or 1. If 1, the TopFace (see <emlink href="definition/defcore.html">DefCore.txt</emlink>) will be drawn using the animated facet.</col>
      </row>
      <row>
        <literal_col>FacetTargetStretch</literal_col>
        <col>Boolean</col>
        <col>0 or 1. If 1, the graphics will be stretched down towards the upper border of the ActionTarget. Used e.g. for the elevator line.</col>
      </row>
      <row>
        <literal_col>NextAction</literal_col>
        <col>String</col>
        <col>Next action being set after the current one has reached its end.</col>
      </row>
      <row>
        <literal_col>NoOtherAction</literal_col>
        <col>Integer</col>
        <col>0 or 1. If 1, no other action can be set after this one (used e.g. for death or destruction).</col>
      </row>
      <row>
        <literal_col>StartCall</literal_col>
        <col>String (max. 30 chars)</col>
        <col>Object script function which is called when the activity is started.</col>
      </row>
      <row>
        <literal_col>EndCall</literal_col>
        <col>String (max. 30 chars)</col>
        <col>Called when an activity reaches the end of its animation.</col>
      </row>
      <row>
        <literal_col>PhaseCall</literal_col>
        <col>String (max. 30 chars)</col>
        <col>Called whenever the animation phase changes.</col>
      </row>
      <row>
        <literal_col>AbortCall</literal_col>
        <col>String (max. 30 chars)</col>
        <col>Called if an activity is being replaced by another before its regular end; i.e. not by a transition through NextAction. Parameters are the previous animation phase, previous ActionTarget and previous ActionTarget2.</col>
      </row>
      <row>
        <literal_col>InLiquidAction</literal_col>
        <col>String</col>
        <col>Action to be set if the object plunges into water.</col>
      </row>
      <row>
        <literal_col>Sound</literal_col>
        <col>String (max. 30 chars)</col>
        <col>Permanent sound being played during this action.</col>
      </row>
      <row>
        <literal_col>ObjectDisabled</literal_col>
        <col>Integer</col>
        <col>0 or 1. Restricted control of the object during this action.</col>
      </row>
      <row>
        <literal_col>DigFree</literal_col>
        <col>Integer</col>
        <col>Area that is dug free during this action. If 1, the area covered by the object shape is freed (like the elevator case); otherwise, the value is taken as the radius of a circular area (like a digging Clonk).</col>
      </row>
      <row>
        <literal_col>Animation</literal_col>
        <col>String</col>
        <col>Specifies the animation to be played in the mesh of the object. Works only if the object uses a mesh for its graphics. If given all of Facet, FacetBase, FacetTopFace and FacetTargetStretch are ignored. The Length times Delay possible animation phases are mapped linearly on the animation length. If Delay equals 0 only Length will be used and the animation does not play automatically. See <emlink href="definition/animations.html">Animationen</emlink> for further documentation on animations.</col>
      </row>
    </table>
  </text>
  <h id="Example">Example</h>
  <text>The ActMap is defined in the script, an example definition looks like this:</text>
  <code>local ActMap = {
Fly = {
	Prototype = Action,
	Name = "Fly",
	Procedure = DFA_FLOAT,
	Directions = 2,
	FlipDir = 1,
	Length = 1,
	Delay = 10,
	X = 0,
	Y = 0,
	Wdt = 24,
	Hgt = 24,
	NextAction = "Fly",
	StartCall = "FlyingStart",
},
Flutter = {
	Prototype = Action,
	Name = "Flutter",
	Procedure = DFA_FLOAT,
	Directions = 2,
	FlipDir = 1,
	Length = 11,
	Delay = 1,
	X = 0,
	Y = 0,
	Wdt = 24,
	Hgt = 24,
	NextAction = "Flutter",
	StartCall = "Fluttering",
},
};  </code>
  </part>
  <author>Sven2</author><date>2002-04</date>
  <author>matthes</author><date>2004-06</date>
  <author>Günther</author><date>2011-01</date>
</doc>
