Difference between revisions of "Action"

From EDukeWiki
Jump to navigation Jump to search
 
 
(12 intermediate revisions by 7 users not shown)
Line 1: Line 1:
An action is an animation for an [[actor]].
+
An action is an animation for an [[actor]]. Actions are defined outside of an [[actor]].
  
Actions are defined outside of an [[actor]].
+
'''action''' ''<name> <startframe> <frames> <viewtype> <incvalue> <delay>''
  
action <name> <startframe> <frames> <viewtype> <incvalue> <delay>
+
An action is an animation for an [[actor]]. Actions are defined outside of an [[actor]].
  
 
<name> is the name of the action.
 
<name> is the name of the action.
Line 11: Line 11:
 
<frames> is the total number of frames in the action. Must be at least 1.
 
<frames> is the total number of frames in the action. Must be at least 1.
  
<viewtype> is the number of sides. Values are: 1, 5, 7, and 8. 8 is the same as 5 but with no mirror.
+
<viewtype> is the number of sides drawn for the actor.  Prior to 3D models, this method was used to simulate a 3D appearance for sprites.  Valid values are:
 +
:'''1''' - The sprite will appear the same regardless of the angle at which it is viewed.
 +
:'''3''' - The sprite will have 16 angles built from only 4 art tiles. A new frame is drawn every 22.5 degrees in a clockwise pattern beginning with the front of the sprite.  The pattern is as follows, with 1, 2, 3, and 4 being the order of the four tiles used, and M denoting that the tile is mirrored: 1M, 2M, 3M, 4M, 4, 3, 2, 1, 1M, 2M, 3M, 4M, 4, 3, 2, 1.
 +
:'''5''' - The sprite will have 8 angles constructed from 5 art tiles, three of which are mirrored.  A new frame is drawn every 45 degrees in a clockwise pattern beginning with the front of the sprite using the following pattern: 1, 2, 3, 4, 5, 4M, 3M, 2M.  
 +
:'''7''' - The sprite will have 12 angles constructed from 7 art tiles, five of which are mirrored.  A new frame is drawn every 30 degrees in a clockwise pattern beginning with the front of the sprite using the following pattern: 1, 2, 3, 4, 5, 6, 7, 6M, 5M, 4M, 3M, 2M.
 +
:'''8''' - The sprite will have 8 angles constructed from 8 art tiles. A new frame is drawn every 45 degrees in a clockwise pattern beginning with the front of the sprite using the simple pattern: 1, 2, 3, 4, 5, 6, 7, 8.
 +
<!--what if anything do the other values do--?
  
 +
1 is generally used for pickups and often things like fire hydrants.  3 is useful only for very symmetrical actors but does give the most angles. 5 and 7 are for enemies and simila which have a single axis of symetry and where you wan't a front view such that when they face at you they actually look like they are facing at you. 8 is for stuff with little in the way of symetry. -->
 +
 
<incvalue> is the direction of the animation. 1 to advance forward, -1 to go back.
 
<incvalue> is the direction of the animation. 1 to advance forward, -1 to go back.
  
 
<delay> is the delay between frames.
 
<delay> is the delay between frames.
 +
 +
The delay change everytime you add a value of 4, in other words, 1-3 has the same result as zero, 5-7 same as 4, etc.
 +
 +
Also the delay is not proportional to the value, setting 16 doesn't mean double of speed than 8, the calculation is done with this: the speed of a delay 0 equal to a [[ifcount|tic]] counter; the speed of a delay 4 is 1/2 of it; 8 is 1/3; 12 is 1/4; 16 is 1/5; 20 is 1/6; etc.
 +
 
   
 
   
 
To call an action from within an actor simply put:
 
To call an action from within an actor simply put:
Line 21: Line 34:
 
action <name>  
 
action <name>  
  
Note: Every frame advance adds 1 to [[actioncount]]. To reset an animation, either recall the action, or use [[resetactioncount]]. Starting a new animation will also set [[actioncount]] to 0.
+
Note: Every frame advance adds 1 to [[actioncount]]. To reset an animation, either call the action again or use [[resetactioncount]]. Starting a new animation will also reset [[actioncount]] to 0.
 +
 
 +
[[Category:Duke3D 1.3/1.5 commands]]
 +
[[Category:Sprite manipulation]]

Latest revision as of 08:42, 25 September 2017

An action is an animation for an actor. Actions are defined outside of an actor.

action <name> <startframe> <frames> <viewtype> <incvalue> <delay>

An action is an animation for an actor. Actions are defined outside of an actor.

<name> is the name of the action.

<startframe> is the starting frame number (relative to the main sprite of the actor).

<frames> is the total number of frames in the action. Must be at least 1.

<viewtype> is the number of sides drawn for the actor. Prior to 3D models, this method was used to simulate a 3D appearance for sprites. Valid values are:

1 - The sprite will appear the same regardless of the angle at which it is viewed.
3 - The sprite will have 16 angles built from only 4 art tiles. A new frame is drawn every 22.5 degrees in a clockwise pattern beginning with the front of the sprite. The pattern is as follows, with 1, 2, 3, and 4 being the order of the four tiles used, and M denoting that the tile is mirrored: 1M, 2M, 3M, 4M, 4, 3, 2, 1, 1M, 2M, 3M, 4M, 4, 3, 2, 1.
5 - The sprite will have 8 angles constructed from 5 art tiles, three of which are mirrored. A new frame is drawn every 45 degrees in a clockwise pattern beginning with the front of the sprite using the following pattern: 1, 2, 3, 4, 5, 4M, 3M, 2M.
7 - The sprite will have 12 angles constructed from 7 art tiles, five of which are mirrored. A new frame is drawn every 30 degrees in a clockwise pattern beginning with the front of the sprite using the following pattern: 1, 2, 3, 4, 5, 6, 7, 6M, 5M, 4M, 3M, 2M.
8 - The sprite will have 8 angles constructed from 8 art tiles. A new frame is drawn every 45 degrees in a clockwise pattern beginning with the front of the sprite using the simple pattern: 1, 2, 3, 4, 5, 6, 7, 8.

<incvalue> is the direction of the animation. 1 to advance forward, -1 to go back.

<delay> is the delay between frames.

The delay change everytime you add a value of 4, in other words, 1-3 has the same result as zero, 5-7 same as 4, etc.

Also the delay is not proportional to the value, setting 16 doesn't mean double of speed than 8, the calculation is done with this: the speed of a delay 0 equal to a tic counter; the speed of a delay 4 is 1/2 of it; 8 is 1/3; 12 is 1/4; 16 is 1/5; 20 is 1/6; etc.


To call an action from within an actor simply put:

action <name>

Note: Every frame advance adds 1 to actioncount. To reset an animation, either call the action again or use resetactioncount. Starting a new animation will also reset actioncount to 0.