ActMap
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 SetAction) or directly by the engine. Some activities - especially those of clonks and animals - use an engine-internal procedure, which controls the movement of an object while such an activity is set.
Property | Data type | Description |
---|---|---|
Prototype | proplist | Must be Action. See below in the example. |
Name | String | Name of the activity. See SetAction(). |
Procedure | String | Internal procedure. See Procedures. |
Speed | Integer | The maximum speed in 1/100 px/frame an internal procedure will move the object with. See Procedures. |
Accel | Integer | The acceleration in 1/100 px/frame² an internal procedure will apply to the object. See Procedures. |
Decel | Integer | The deceleration in 1/100 px/frame² the internal procedure WALK will apply to the object. See Procedures. |
Directions | Integer | Number of animation directions. Animation directions are arranged vertically in Graphics.png. Default 1. |
FlipDir | Integer | 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 >= 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). |
Length | Integer | Number of animation phases for this activity (arranged horizontally in Graphics.png). Default 1. |
Reverse | Integer | 0 or 1. If 1, the animation phases will be shown in reverse order. |
Delay | Integer | Time difference in frames (ticks) between two animation phases. |
Step | Integer | How many animation phases the animation should advance after Delay frames. Default 1. |
Attach | Integer | A bitmask for the attachment to surfaces. See CNAT Values for a documentation of possible values. Only evaluated if the procedure is NONE. |
X | Integer | Animation graphics: X coordinate from Graphics.png. |
Y | Integer | Animation graphics: Y coordinate from Graphics.png. |
Wdt | Integer | Width of the animation graphic from Graphics.png. |
Hgt | Integer | Height of the animation graphic from Graphics.png. |
OffX | Integer | X-Offset at which to display the animation graphics. |
OffY | Integer | Y-Offset at which to display the animation graphics. |
FacetBase | Integer | 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. |
FacetTopFace | Integer | 0 or 1. If 1, the TopFace (see DefCore.txt) will be drawn using the animated facet. |
FacetTargetStretch | Integer | 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. |
NextAction | String | Next action being set after the current one has reached its end. If it is not specified, the action will be kept and the animation phase resets to 0 and the animation begins anew. If it is "Hold", the action will also be kept but stops at the last animation frame. If it is "Idle", the object will have no action after this one. |
NoOtherAction | Integer | 0 or 1. If 1, no other action can be set after this one (used e.g. for death or destruction). |
StartCall | String | Object script function which is called when the activity is started. |
EndCall | String | Called when an activity reaches the end of its animation. |
PhaseCall | String | Called whenever the animation phase changes. |
AbortCall | String | 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. |
InLiquidAction | String | Action to be set if the object plunges into water. |
Sound | String | Permanent sound being played during this action. The same can be achieved with Sound which is the more flexible solution. |
ObjectDisabled | Integer | 0 or 1. Restricted control of the object during this action. |
DigFree | Integer | 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). |
Animation | String | 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 Animations for further documentation on animations. |
Example
The ActMap is defined in the script, an example definition looks like this:
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", }, };