Here's a typical entry from an .air file. We will explain the
format next.
; Standing Animation
[Begin Action 000]
Clsn2Default: 2
Clsn2[0] = -10, 0, 10,-79
Clsn2[1] = -4,-92, 6,-79
0,1, 0,0, 7
0,2, 0,0, 7
0,3, 0,0, 7
0,4, 0,0, 50
0,5, 0,0, 7
0,6, 0,0, 7
0,7, 0,0, 7
0,8, 0,0, 60
Semicolon (;) is used for comments. They can be used anywhere and
everything after the semicolon on the same line is ignored.
[Begin Action n]
This defines an action. The number n is called the action number.
Each action must have a unique action number in order to be
distinguishable from other actions. You can have many actions,
but keep in mind that there are reserved actions numbers. These
numbers and their associated actions are listed below.
Clsn2Default: 2
This says that there are two collision boxes being defined and they
will be defined for all the entries below the Clsn definition. In
this case for every sprite in this action. If you don't want to
have a default collision box, then change Clsn2Default to Clsn2.
You must put the Clsn definition before a sprite entry. Each
sprite entry can have its own collision boxes. Clsn2 refers to a
plain collision box and Clsn1 refers to an "attacking" box. You
use attacking boxes when making attacking actions such as punching
and kicking or special moves. To define collision boxes, use
AirEdit, a program included in the M.U.G.E.N development toolset.
0,3, 0,0, 7
An entry looking like this is called an "animation element", or
just "element" for short.
1st number is the sprite's group number.
2nd number is the sprite's image number.
You assign these numbers to your sprites when you make an .sff file.
So group #0 and image #3 were defined with sprmaker with an entry
such as:
work/mypic.pcx
0 (group number)
3 (image number)
40 X axis
40 Y axis
The 3rd and 4th numbers of the element are the X and Y offsets from
this sprite's axis. If you want the sprite to appear 5 pixels
forwards, put "5" for the 3rd number. To make the sprite 15 pixels
up, put "-15" for the 4th number, and so on. In most cases, it is
fine to keep the offset as 0,0.
5th number is the length of time to display the element before moving
onto the next, measured in game-ticks. There are 60 game-ticks in
one second at normal game speed.
For the 5th number, you can specify "-1" if you want that element
to be displayed indefinitely (or until you switch to a different
action). If you choose to do this, do it only on the last element
of the action.
The "looptime" of an action is the sum of all the times of each
element. Basically, it is the total length of the action in
game-ticks. If the last element has a time of "-1", the looptime
will be considered infinite. We call that "no loop". Actions
with a finite loop time will go back to the first element
after it has finished displaying the last element, and keep
looping until the you switch to another action.
In the example action above, the looptime would be:
7 + 7 + 7 + 50 + 7 + 7 + 7 + 60 = 152 ticks
; Standing Animation
[Begin Action 000]
Clsn2Default: 2
Clsn2[0] = -10, 0, 10,-79
Clsn2[1] = -4,-92, 6,-79
0,1, 0,0, 7
0,2, 0,0, 7
Loopstart
0,3, 0,0, 7
0,4, 0,0, 50
0,5, 0,0, 7
0,6, 0,0, 7
0,7, 0,0, 7
0,8, 0,0, 60
Adding a line with the word "Loopstart" will make the animation
begin looping from the element on the following line. In the
example above, when the element with sprite 0,8 is displayed,
the next element to be shown will be the one with sprite 0,3.
When testing out your animations, you may find the pause and
frame-advance functions useful. To pause, hit the "Pause" button.
To advance the game by one game-tick, press Scroll Lock. Frame-
advance only works when the game is paused.
Here's an entry:
15,1, 0,0, 5
If you want to flip the sprite horizontally and/or vertically, you
will need to use the "flip" parameters: V for vertical flip, and
H for horizontal flip. These parameters will be 6th on the line.
For example:
15,1, 0,0, 5, H ;<-- This flips it horizonally
15,2, 0,0, 5, V ;<-- This flips it vertically
15,3, 0,0, 5, VH ;<-- This flips it both ways, ie. rotates 180 deg
Flipping the sprite around is especially useful for making throws.
The opponent who is being thrown will temporarily get the player's
animation data, and enter the "being thrown" animation action.
You'll might have to flip the sprites around to make the "thrown"
action look correct.
For certain things such as hit sparks, you might like to use
color addition to draw the sprite, making it look "transparent".
You won't need to use this to make a character, so you don't have
to worry about this if you choose not to. The parameters for
color addition and subtraction are "A" and "S" respectively, and
should go as the 7th on the line.
For example:
15,4, 0,0, 5, ,A ;<-- Color addition (flip parameter omitted)
15,4, 0,0, 5, H, S ;<-- Flips horizontally and does color subtraction
If you wish to specify alpha values for color addition, use the
parameter format "AS???D???", where ??? represents the values of the
source and destination alpha respectively. Values range from 0 (low)
to 256 (high). For example, "AS64D192" stands for "Add Source_64 to
Dest_192". Also, "AS256D256" is equivalent to just "A". A shorthand
for "AS256D128" is "A1".
15,4, 0,0, 5, ,A1 ;<-- Color addition to 50% darkened dest
15,4, 0,0, 5, ,AS128D128 ;<-- Mix 50% source with 50% dest
for some 1.1b+ optional parameters.