Using Vlue's Animated Battlers
Vlue's Animated Battlers and you! Oh boy, here we go...
This is a confusing script, especially for those who don't have much experience using or editing scripts. But hopefully this short (hah) guide will lead you to understanding how the script works and to easily set up your own animations and animated battlers. First and foremost you'll need some animated battlers.. duh! I don't provide them myself, but various artists have made some cool ones, and you can always use the ones found in the RTP for Rpg Maker 2003. (Resource links at the bottom) For this guide, I'll be using Holder's Animated Battlers since they are pretty and easy to set up.
Setting up the images:
First things first is getting the images ready to use. All images you get go in the Battler folder. After you do that, you go into the script and let the script know what images to use and how many frames they have. This allows the script to pull out the right frames of the right size from each image.
To do this we'll be editing ANIMATION_FILES. The base options for ANIMATION FILES is:
I'm going to use these Holder's Battlers that I've named Fighter, Paladin, Archer, Warrior, and Slime, and set them up accordingly.
The first step is finding out how many frames are across the image and how many are up. This is our rows and columns, and it's as easy as counting them out. For all of Holder's, they are a simple 4 frames across and 14 frames up, so my ANIMATION_FILES will look like this:
The reason we have to do this is so the script knows the size of the frame to pull from the image based on how many frames are across and up. This also means that separate images can have different frame sizes from others, allowing for bigger monsters or heroes.
Setting up the frames:
Since more often then not, each animated battler you have will have the same layout, it's easier to set up frame information separate from the image instead of once for each image. (Imagine what a pain that'd be!) There are three base animations we'll want to have, and three more that are helpful but not necessary: Idle, Dead, Run, and Attack, Hurt, Cast.
It's those six animations that I'll set up immediately, and as luck would have it, Holder's Battlers have something that fit each bill. So we'll just find the frames of the animation we want, count it out until we get the numbers we want (the top left frame is 0 and then we go up by 1 from left to right), and then set up our frames. Since all our images are laid out the same we only need to do this once to cover all of them.
We'll be editing ANIMATIONS for this one, which has the base option of:
Counting it out, I've determined the frames I need for it are 0-3 for idle, 52-55 for dead, 32-35 for run, 16-19 for attack, 12-15 for hurt, and 20-23 for cast. So now we just set up ANIMATIONS, and in my case it'll look something like this: (I've chosen a duration of 10 for each frame, giving each animation a length of 40)
You'll notice that I only gave one frame for dead, because well.. they aren't moving, each frame is the same so let's save it some trouble. And just like that all our animation frames are set up and ready to use!
Actors and Enemies:
Before we jump right into setting up cool animations for skills and whatnot we'll need to set the default animations for each actor/enemy that require them. If we don't then we'll.. you won't be able to see anything and then what's the point!
Just like with the animation frames, there's three mandatory poses, and then the three that you pretty much want anyways. And on top of that you can add as many more as you want to, but we'll talk about that later. For a reminder the mandatory poses are Dead, Idle, and Run, and the three that you'll want anyways are Attack, Hurt, and Cast.
The notetag (that you can use in Actors, Classes, or Enemies) is this: <???Anim ["file",:frame]>
That might look a little confusing but it's easy. ??? is the pose name (Dead, Idle, Run, Attack, Hurt, Cast, or whatever you want for extra default poses), :frame is the name of the frame data that we just set up in ANIMATIONS and "file" is the name of the image file, like the ones we set up in ANIMATION_FILES. Now I'm not going to be silly and show an example for each one, but here's what I would set up for Warrior, using my previous work.
<IdleAnim ["Warrior",:idle]>
<RunAnim ["Warrior",:run]>
<DeadAnim ["Warrior",:dead]>
<AttackAnim ["Warrior",:attack]>
<HurtAnim ["Warrior",:hurt]>
<CastAnim ["Warrior",:cast]>
And there we go, our Warrior now has his poses for the six most important ones. If we wanted to take it further, like if we had a special animation for using items, we could even add our own like... <ItemAnim ["Warrior",:item]> and we can actually call it later on in our skill animations with no extra work. (Provided we also set up an :item frame thingy).
Making a Skill Animation (The Meat and Potatoes):
Here's where it gets complicated. Setting up a Skill Animation. This is where we tell all the sprites what to do and when to do it, from running to the enemy, playing a certain animation, to flashes and se's. Hopefully with this guide though, you'll have a lot less questions on what the commands do and how to do them!
The first thing we are going to do is go over all 14 possible steps and what they do:
:moveto ( [:moveto,:target,:align,speed] ) - This step moves the user to a position based on the target. The options for :target are: :self, :target, :target# (from 0-?), or :origin (the default location of the user). For move commands, :self is useless. The options for :align are :align and :align_o, :align will move the user to the side of the target closest to itself, while :align_o does the opposite, good for getting the user on the other side of the target. Speed is the number of frames it takes for the user to get from point a to point b, with 1 being instant and 1.0*10^9000 being a real.. real long time. (Dont' do that).
:jumpto ( [:jumpto,:target,:align,speed] ) - This step is exactly the same as :moveto with the exception that the user will leap into the air instead of just running. It uh.. doesn't work exactly that well right now, so use sparingly.
:move ( [:move,:target,x,y,speed] ) - This step will move the user to a position offset of the target by the x and y values. :target and speed are the same as they are explained in the first step with the exception that :self is not useless at all here. The y value is absolute but the x value offset is added to a portion of the width of the target sprite to accomodate different sized sprites, no clipping!
:jump ( [:jump,:target,x,y,speed] ) - This step is exactly the same as :move with the exception that the user jumps to the location! But yah, just like in :jumpto, it doesn't work exactly that well, so use sparingly.
:play ( [:play,:target,"filename",:frames,:wait] or [:play,:target,:base,nil,wait] ) - This step causes the :target (same as explained in the first step, can be :self) to play a sprite animation. The first option allows you to designate a filename and a :framedata (similar to the notetags set up earlier) and the second option, which you'll probably use more often, directly uses the notetag data which allows for non-specific animations. To use the second option, :base would be the symbol related to the ??? portion of the notetag, :Hurt, :Attack, :Idle, or like in our extra example, :Item are all valid options. Note the capitalization! The final option, wait, is the number of frames to wait until the next step is preformed. You may also set it to nil to wait the entire duration of the sprite animation.
:anim ( [:anim,:target,anim_id,wait] ) - This step simply plays an animation from the database on the target (same as explained in the first step, can be :self). anim_id is the id number of the animation to play and wait is the number of frames to wait before the next step, can be set to nil to wait the entire duration of the animation.
:mirror ( [:mirror,:target,boolean] ) - This step is very straight forward, mirrors the target sprite based on the boolean (true/false).
:wait ( [:wait,timer] ) - This step is even simpler, it waits a number of frames equal to timer.
:flash ( [:flash,:target,color,duration] ) - This step is familiar to anyone who's played around with animations, it flashes the :target (same as explained in the first step, can be :self, can also be :screen to flash the entire screen) the specific color for the specific number of frames. color is a color object, Color.new(red,green,blue,alpha) where each value is a number from 0-255 and alpha is optional (it's transparency).
:tint ( [:tint,tone,duration] ) - This step changes the tint of the screen to whatever you want it to be, with tone being a tone object (Tone.new(red,green,blue,grey) where each value is a number from -255-255) and duration being how long it takes for the tint to apply.
:se ( [:se,"name",volume,pitch] ) - This step is explained pretty easily, "name" is the name of the se to play, volume is the volume to play it at (0-100), and pitch is the pitch! (50-150).
:missile ( [:missile,:target,icon_id,:effect] ) - This step creates a sprite image of an icon and hurls it at the :target (same as explained in first step). Useful for throwing knives or fireballs I suppose. icon_id is the id number of the icon to use (icons only for now) and :effect is either :none for no effect and :rotate for a spinning effect.
:damage ( [:damage,:target,amount] ) - (Requires the script Basic Damage Popup). This step allows you to display a portion (or all) of the damage being dealt to the :target (same as explained in first step but only for targets) at different intervals in the animation. amount is the amount of damage being dealt as a percentage, for example 10 would be 10%. amount can also be replaced by :rest to display the remaining damage to be dealt. (It's better to use rest at the end then a percentage due to rounding errors).
:field ( [:field,id] ) - (Requires the script Field Effects). This step changes the background to the same as the one designated by the id in Field Effects.
Whoo, a lot of steps! Explained pretty nicely if I do say so myself. Which I do. But how do you set it up? How do they all go together!? Hold on, hold on, we're getting to that. The easiest way of course is by example, so I'm going to show you three skills: A basic attack skill, a fireball skill, and a special skill.
For the first example, our attack skill, we will have it so the user rushes over to the enemy, attacks them, and runs back to their position. We'll also want to play an animation and have the target show that they were hit as well. We'll be using the commands, :moveto, :play, and :anim. And we'll set it up in SKILL_ANIMATIONS so it looks like this:
And in that animation our user rushes to the target, plays their attack animation, has an animation played on the target, the target plays their hurt animation, and the user runs back to his post. Simple!
For the next example, the fireball skill, we'll get a little more fancy by having our user move forward, prepare their cast, hurl the fireball, then play an animation. For this one, the commands we'll use are: :moveto, :move, :play, :missile, :anim. And it'll look something like.. this:
And now this animation has the user move forward, use his cast animation, launch a fireball at the enemy (icon #96 is a fireball!), play an animation on the target, have the target play their hurt animation, and then returns to his position. Not too shabby!
And for our last example, we're going to have a special skill. One where the user attacks the enemy several times before returning. The commands we're going to use for this one are: :moveto, :jumpto, :play, :anim, :mirror. And I think it'll look like this when it's done:
I uh.. don't even know if I want to try and explain that one.. basically the user will use their cast animation then run to the enemy, hit them, jump to their other side, hit them again, jump back, hit them again, then return to their position. (If you're trying to read it it goes left to right, top to bottom)
And that's three examples of skill animations that you can do! Their really is a lot of cool animations and skills you could make with this with the right dedication and knowhow! And now it's your turn!
But now what?:
Good question! There's only one more step... setting the right animation for the right skill! And it's an easy one, just go to your skill and put this in the notebox: <ANIMATION animation_skill>
Where animation_skill is the name of the animation you set up in SKILL_ANIMATIONS, using our previous example, that'd be:
<ANIMATION special1>
It's that easy! (Note however the lack of a : in that notetag, it's important. Probably).
And the final step is..
..actually that's it. You should now know everything you need to know to properly set up and use this animated battlers script. Hopefully! If not then.. we'll read it again. That should do it!
Resource Links:
This is a confusing script, especially for those who don't have much experience using or editing scripts. But hopefully this short (hah) guide will lead you to understanding how the script works and to easily set up your own animations and animated battlers. First and foremost you'll need some animated battlers.. duh! I don't provide them myself, but various artists have made some cool ones, and you can always use the ones found in the RTP for Rpg Maker 2003. (Resource links at the bottom) For this guide, I'll be using Holder's Animated Battlers since they are pretty and easy to set up.
Setting up the images:
First things first is getting the images ready to use. All images you get go in the Battler folder. After you do that, you go into the script and let the script know what images to use and how many frames they have. This allows the script to pull out the right frames of the right size from each image.
To do this we'll be editing ANIMATION_FILES. The base options for ANIMATION FILES is:
- "filename" => [columns,rows].
I'm going to use these Holder's Battlers that I've named Fighter, Paladin, Archer, Warrior, and Slime, and set them up accordingly.
The first step is finding out how many frames are across the image and how many are up. This is our rows and columns, and it's as easy as counting them out. For all of Holder's, they are a simple 4 frames across and 14 frames up, so my ANIMATION_FILES will look like this:
- ANIMATION_FILES = {
- "Fighter" => [4,14],
- "Paladin" => [4,14],
- "Archer" => [4,14],
- "Warrior" => [4,14],
- "Slime" => [4,14] }
The reason we have to do this is so the script knows the size of the frame to pull from the image based on how many frames are across and up. This also means that separate images can have different frame sizes from others, allowing for bigger monsters or heroes.
Setting up the frames:
Since more often then not, each animated battler you have will have the same layout, it's easier to set up frame information separate from the image instead of once for each image. (Imagine what a pain that'd be!) There are three base animations we'll want to have, and three more that are helpful but not necessary: Idle, Dead, Run, and Attack, Hurt, Cast.
It's those six animations that I'll set up immediately, and as luck would have it, Holder's Battlers have something that fit each bill. So we'll just find the frames of the animation we want, count it out until we get the numbers we want (the top left frame is 0 and then we go up by 1 from left to right), and then set up our frames. Since all our images are laid out the same we only need to do this once to cover all of them.
We'll be editing ANIMATIONS for this one, which has the base option of:
- :name => [ [id,duration] , [id,duration] , ... ],
Counting it out, I've determined the frames I need for it are 0-3 for idle, 52-55 for dead, 32-35 for run, 16-19 for attack, 12-15 for hurt, and 20-23 for cast. So now we just set up ANIMATIONS, and in my case it'll look something like this: (I've chosen a duration of 10 for each frame, giving each animation a length of 40)
- ANIMATIONS => {
- :idle => [ [0,10] , [1,10] , [2,10] , [3,10] ],
- :dead => [ [52,0] ],
- :run => [ [32,10] , [33,10] , [34,10] , [35,10] ],
- :attack => [ [16,10] , [17,10] , [18,10] , [19,10] ],
- :hurt => [ [12,10] , [13,10] , [14,10] , [15,10] ],
- :cast => [ [20,10] , [21,10] , [22,10] , [23,10] ], }
You'll notice that I only gave one frame for dead, because well.. they aren't moving, each frame is the same so let's save it some trouble. And just like that all our animation frames are set up and ready to use!
Actors and Enemies:
Before we jump right into setting up cool animations for skills and whatnot we'll need to set the default animations for each actor/enemy that require them. If we don't then we'll.. you won't be able to see anything and then what's the point!
Just like with the animation frames, there's three mandatory poses, and then the three that you pretty much want anyways. And on top of that you can add as many more as you want to, but we'll talk about that later. For a reminder the mandatory poses are Dead, Idle, and Run, and the three that you'll want anyways are Attack, Hurt, and Cast.
The notetag (that you can use in Actors, Classes, or Enemies) is this: <???Anim ["file",:frame]>
That might look a little confusing but it's easy. ??? is the pose name (Dead, Idle, Run, Attack, Hurt, Cast, or whatever you want for extra default poses), :frame is the name of the frame data that we just set up in ANIMATIONS and "file" is the name of the image file, like the ones we set up in ANIMATION_FILES. Now I'm not going to be silly and show an example for each one, but here's what I would set up for Warrior, using my previous work.
<IdleAnim ["Warrior",:idle]>
<RunAnim ["Warrior",:run]>
<DeadAnim ["Warrior",:dead]>
<AttackAnim ["Warrior",:attack]>
<HurtAnim ["Warrior",:hurt]>
<CastAnim ["Warrior",:cast]>
And there we go, our Warrior now has his poses for the six most important ones. If we wanted to take it further, like if we had a special animation for using items, we could even add our own like... <ItemAnim ["Warrior",:item]> and we can actually call it later on in our skill animations with no extra work. (Provided we also set up an :item frame thingy).
Making a Skill Animation (The Meat and Potatoes):
Here's where it gets complicated. Setting up a Skill Animation. This is where we tell all the sprites what to do and when to do it, from running to the enemy, playing a certain animation, to flashes and se's. Hopefully with this guide though, you'll have a lot less questions on what the commands do and how to do them!
The first thing we are going to do is go over all 14 possible steps and what they do:
:moveto ( [:moveto,:target,:align,speed] ) - This step moves the user to a position based on the target. The options for :target are: :self, :target, :target# (from 0-?), or :origin (the default location of the user). For move commands, :self is useless. The options for :align are :align and :align_o, :align will move the user to the side of the target closest to itself, while :align_o does the opposite, good for getting the user on the other side of the target. Speed is the number of frames it takes for the user to get from point a to point b, with 1 being instant and 1.0*10^9000 being a real.. real long time. (Dont' do that).
:jumpto ( [:jumpto,:target,:align,speed] ) - This step is exactly the same as :moveto with the exception that the user will leap into the air instead of just running. It uh.. doesn't work exactly that well right now, so use sparingly.
:move ( [:move,:target,x,y,speed] ) - This step will move the user to a position offset of the target by the x and y values. :target and speed are the same as they are explained in the first step with the exception that :self is not useless at all here. The y value is absolute but the x value offset is added to a portion of the width of the target sprite to accomodate different sized sprites, no clipping!
:jump ( [:jump,:target,x,y,speed] ) - This step is exactly the same as :move with the exception that the user jumps to the location! But yah, just like in :jumpto, it doesn't work exactly that well, so use sparingly.
:play ( [:play,:target,"filename",:frames,:wait] or [:play,:target,:base,nil,wait] ) - This step causes the :target (same as explained in the first step, can be :self) to play a sprite animation. The first option allows you to designate a filename and a :framedata (similar to the notetags set up earlier) and the second option, which you'll probably use more often, directly uses the notetag data which allows for non-specific animations. To use the second option, :base would be the symbol related to the ??? portion of the notetag, :Hurt, :Attack, :Idle, or like in our extra example, :Item are all valid options. Note the capitalization! The final option, wait, is the number of frames to wait until the next step is preformed. You may also set it to nil to wait the entire duration of the sprite animation.
:anim ( [:anim,:target,anim_id,wait] ) - This step simply plays an animation from the database on the target (same as explained in the first step, can be :self). anim_id is the id number of the animation to play and wait is the number of frames to wait before the next step, can be set to nil to wait the entire duration of the animation.
:mirror ( [:mirror,:target,boolean] ) - This step is very straight forward, mirrors the target sprite based on the boolean (true/false).
:wait ( [:wait,timer] ) - This step is even simpler, it waits a number of frames equal to timer.
:flash ( [:flash,:target,color,duration] ) - This step is familiar to anyone who's played around with animations, it flashes the :target (same as explained in the first step, can be :self, can also be :screen to flash the entire screen) the specific color for the specific number of frames. color is a color object, Color.new(red,green,blue,alpha) where each value is a number from 0-255 and alpha is optional (it's transparency).
:tint ( [:tint,tone,duration] ) - This step changes the tint of the screen to whatever you want it to be, with tone being a tone object (Tone.new(red,green,blue,grey) where each value is a number from -255-255) and duration being how long it takes for the tint to apply.
:se ( [:se,"name",volume,pitch] ) - This step is explained pretty easily, "name" is the name of the se to play, volume is the volume to play it at (0-100), and pitch is the pitch! (50-150).
:missile ( [:missile,:target,icon_id,:effect] ) - This step creates a sprite image of an icon and hurls it at the :target (same as explained in first step). Useful for throwing knives or fireballs I suppose. icon_id is the id number of the icon to use (icons only for now) and :effect is either :none for no effect and :rotate for a spinning effect.
:damage ( [:damage,:target,amount] ) - (Requires the script Basic Damage Popup). This step allows you to display a portion (or all) of the damage being dealt to the :target (same as explained in first step but only for targets) at different intervals in the animation. amount is the amount of damage being dealt as a percentage, for example 10 would be 10%. amount can also be replaced by :rest to display the remaining damage to be dealt. (It's better to use rest at the end then a percentage due to rounding errors).
:field ( [:field,id] ) - (Requires the script Field Effects). This step changes the background to the same as the one designated by the id in Field Effects.
Whoo, a lot of steps! Explained pretty nicely if I do say so myself. Which I do. But how do you set it up? How do they all go together!? Hold on, hold on, we're getting to that. The easiest way of course is by example, so I'm going to show you three skills: A basic attack skill, a fireball skill, and a special skill.
For the first example, our attack skill, we will have it so the user rushes over to the enemy, attacks them, and runs back to their position. We'll also want to play an animation and have the target show that they were hit as well. We'll be using the commands, :moveto, :play, and :anim. And we'll set it up in SKILL_ANIMATIONS so it looks like this:
- :attack => [
- [:moveto,:target,:align],
- [:play,:self,:Attack,nil,20],
- [:anim,:target,7,0],
- [:play,:target,:Hurt,nil,20],
- [:moveto,:origin] ],
And in that animation our user rushes to the target, plays their attack animation, has an animation played on the target, the target plays their hurt animation, and the user runs back to his post. Simple!
For the next example, the fireball skill, we'll get a little more fancy by having our user move forward, prepare their cast, hurl the fireball, then play an animation. For this one, the commands we'll use are: :moveto, :move, :play, :missile, :anim. And it'll look something like.. this:
- :fireball => [
- [:move,:self,-10,0],
- [:play,:self,:Cast],
- [:missile,:target,96,:rotate],
- [:anim,:target,57,nil],
- [:play,:target,:Hurt,nil,20],
- [:moveto,:origin] ],
And now this animation has the user move forward, use his cast animation, launch a fireball at the enemy (icon #96 is a fireball!), play an animation on the target, have the target play their hurt animation, and then returns to his position. Not too shabby!
And for our last example, we're going to have a special skill. One where the user attacks the enemy several times before returning. The commands we're going to use for this one are: :moveto, :jumpto, :play, :anim, :mirror. And I think it'll look like this when it's done:
- :special1 => [
- [:move,:self,-10,0], [:play,:self,:Cast],
- [:moveto,:target,:align], [:play,:self,:Attack,nil,20],
- [:anim,:target,7,0], [:play,:target,:Hurt,nil,20],
- [:jumpto,:target,:align_o], [:mirror,:self,true],
- [:play,:self,:Attack,nil,20],[:anim,:target,7,0],
- [:mirror,:target,true], [:play,:target,:Hurt,nil,20],
- [:jumpto,:target,:align_o], [:mirror,:self,false],
- [:play,:self,:Attack,nil,20],[:anim,:target,7,0],
- [:mirror,:target,false], [:play,:target,:Hurt,nil,20],
- [:moveto,:origin] ]
I uh.. don't even know if I want to try and explain that one.. basically the user will use their cast animation then run to the enemy, hit them, jump to their other side, hit them again, jump back, hit them again, then return to their position. (If you're trying to read it it goes left to right, top to bottom)
And that's three examples of skill animations that you can do! Their really is a lot of cool animations and skills you could make with this with the right dedication and knowhow! And now it's your turn!
But now what?:
Good question! There's only one more step... setting the right animation for the right skill! And it's an easy one, just go to your skill and put this in the notebox: <ANIMATION animation_skill>
Where animation_skill is the name of the animation you set up in SKILL_ANIMATIONS, using our previous example, that'd be:
<ANIMATION special1>
It's that easy! (Note however the lack of a : in that notetag, it's important. Probably).
And the final step is..
..actually that's it. You should now know everything you need to know to properly set up and use this animated battlers script. Hopefully! If not then.. we'll read it again. That should do it!
Resource Links: