Home Samus MUGEN Fushigi Yuugi Help Links Games
Samus Aran

SAMUS'S TUTORIAL PAGE

PART 6
ADVANCED BACKGROUND DEFINITION - ANIMATION


Overview: Bringing your background to life.
What background would not be complete without pretty animations to distract the player while in the middle of an intense fight? This section se will discuss how to incorporate your animations and to make them as professional looking as possible. Sounds exciting right??? If so... you don't get out much do you? Just kidding... let's move on.

OK remember that text file you created in section 3, "CREATING THE SPRITE FILE"? Well a good idea would have been to group all of your common images together. For example, if you have 3 images of a man waving, group them under the same group number and seperate the individual images with the image number. work\stages\backgroundname\man1.pcx
5
0
0
0
work\stages\backgroundname\man2.pcx
5
1
0
0
work\stages\backgroundname\man3.pcx
5
2
0
0

And unless you really really really know what you are doing, a good idea would be to keep the same X and Y values for that group.
OK so everything is how it should be. Great.

Now the actual first step in the def file would be in the main background definition, create an element like you normally would except include:

type = anim
The anim parameter defines that this element will be an animation. If this is not included MUGEN will not run the stage correctly.

actionno = integer
This assigns the element to an animation. The number will link to an animation of the same number.
A little side note is that you do not have to include spriteno = x,y, because it will be useless. Why? Because we will be defining what sprites to be displayed next.

For the final part of this section, we will go over the "Begin Action" declaration... which has the same properties as an air file for a character. So if you have any experience with creating an air file this will be cake. And for more info, please reffer to air.txt in the mugen\docs\ folder.
To start off, we must first include:

[Begin Action integer]
This defines an action. The integer must be the number that you want to link to in the main background definition with actionno = integer. Each action must have a unique action number in order to be distinguishable from other actions. You can have many actions, and you can also link multiple elements to the same action. Next we declare what image to show and for how long.

group number, image number, X, Y, time, flip (opt), trans (opt)
It's not as scary as it looks. Let me explain.

group number, image number
This assigns the image to that animation. Make sure you remember what group and index numbers you assigned each image in your SPRMAKER text file.

X, Y
This is the offset of the image based on the position set by the element. If you have already set the position in the element there is no reason for these numbers not to be 0. But if not, you may need to move around these numbers until you get it just right. Also this must be an integer, no decimal places.

time
This number is the length of time to display the animation before moving onto the next animation, measured in game-ticks. There are 60 game-ticks in one second at normal game speed. Also you can specify "-1" if you want that animation to be displayed indefinitely. If you choose to do this, do it only on the last element of the action... otherwise this whole section would be pointless. Again this must be an integer, no decimal places

flip (optional)
If you want to flip the sprite horizontally and/or vertically, you will need to use the flip parameters: "V" for vertical flip, "H" for horizontal flip, and "VH" flips it both ways. You do not have to include this at all... it is strictly an option for you to use if necessary.

transparent (optional)
If you wish to make the images in your animation transparent, this is the option for you buddy. There are 3 transparent parameters: "A" for color addition, "S" for color subtraction, and "A1" for a 50% color addition.

Once you have the first action together the others should be a piece of cake to do. Here is an example of a normal completed action:
[Begin Action 1]
5,0, 0,0, 4
5,1, 0,0, 4
5,2, 0,0, 4

Here is an example of a completed action that includes some of the options:
[Begin Action 1]
5,0, 0,0, 4, ,A - Color addition. flip parameter omitted.
5,1, 0,0, 4, H, S - Color subtraction and flipped horizontally.
5,2, 0,0, 4, VH - Flipped 180 deg. Trans parameter omitted.

One last option you have is adding a line with the word "Loopstart". Which will make the animation begin looping from the element on the following line.

Got it? It may seem alot... but it really isn't. There is just alot of options for you to use while creating your background. And you will need them... oh yes you will.




Put your tray tables and chairs in the upright position... we are ready for takeoff!
Hosted by www.Geocities.ws

1