Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Fire Emblem Ultimate Tutorial.doc
Скачиваний:
1
Добавлен:
01.07.2025
Размер:
7.86 Mб
Скачать

Chapter 59: Custom Spell Animations

Oh my. Custom spells. It is one of the hardest things to do in hacking, and one of the most mysterious aspects of hacking. Very few people have done custom spells successfully, and very few know much of anything about this.

Of course, this is where this chapter comes in. This is actually the very final chapter I am writing for this tutorial, despite the order. Every other chapter has been completed as far as I know (there are so many I can’t be sure). This is also going to be one of the lengthiest chapters, despite the fact that I am going to try and be concise and straight-forward as much as possible. Before you advance, please make sure of the following:

  • You are able to insert your own custom battle animations. Many of the aspects of battle animations are very similar to spell animations. If you cannot do the former, you have little hope of doing the latter.

  • You have a lot of free time and patience.

  • You should have some basic knowledge of the following terms: opaque, transparency, background, foreground, object, translucent, frame. Knowing the definitions and understanding them should be sufficient.

  • You have some spell sprites to work with. I of course cannot supply you with those. It is up to you to make or find them.

Alright. Let us begin.

Before we start, we must check the spell sprites you have. The spell sheet as a whole does not have to be 16 colors, but each individual frame has to be 16 colors. Thus we will not be quantizing colors to change images to 16 colors (if they aren’t already) until we have made the individual image first.

You will need FEditor Adv and an image editing program. I suggest Usenti if your computer supports it as that is what this tutorial will use. It has the ability to reduce colors and do basic graphic operations in a simplistic manner. It was also intended for GBA use, if you didn’t already know, and so it’s just perfect for GBA hacking. If Usenti does not work for you you either A) need to know how to do the same things with a program like Photoshop, PSP, or Gimp or B) are screwed. This is why I always stick to Windows, that and all the other reasons.

But anyway before I get e-mails about how Macs are better (>________> longface) let’s get on with the show.

Create a folder for all your spell frames. Include everything in there—reference videos, the spell sheet, the README, and a blank text file named “[Spell Name] Script” where you will code your spell script. In my case I am actually doing the entire process for this tutorial (not just faking it) and am inserting a spell called Shaver. The spell frames are ripped from Fire Emblem: New Mystery of the Emblem ~Heroes of Light and Shadow~, and thus they have more colors than the GBA supports. They are also not in the perfect format for GBAFE. Thus the process will be thorough and I may do something that aren’t necessary for you but may be necessary for certain spell animations.

tl;dr I’m trying to covering everything.

There are two main layers for spells: the object and the background. The object is always opaque. The background can be set to be translucent. The level of translucency is decided by the script. Thus you won’t be doing any fancy photo-shopping to create translucency. It will all be done by the game.

You must divide your spell sheet into these two layers. This is up to you as this is a spriting matter. Decide which is which.

To start, we’ll want to test a very basic spell script. Start with two blank frames. One will be a blank object frame, and the other will be a blank background frame. To do this you must know the dimensions of the frames. The documentation on spells that comes with FEditor Adv will help with this (and possibly other things) so take note of this.

Object:

Background:

I named mine “blank” and “blankbg” respectively for sake of ease. You may just want to name yours something even shorter like “bo” (blank object) and “bbg” (blank background). I’m too lazy to rename mine though.

If you’re using the doc version of this tutorial you may be able to just copy the images into an image program and save them. If you’re using the HTML version (online) you should be able to right-click them and hit “save image as…” to save them. If you’re using the PDF version all I can do is suggest you try another version or simply make an image knowing the dimensions, 488x160 and 264x64 respectively. The background color does not particularly manner but I suggest making it something that will not clash with any of the spell frames (or perhaps it should clash to standout and rather not blend in with any of the spell frames) and something that will most obviously be the background color.

When you have those two frames copy this into your spell script text file (just a standard .txt file):

/// - Start Animation

C00

C00

C00

C00

C00

C00

C00

C000040

O p- blank.PNG

B p- blankbg.PNG

1

C00001A

C1F

~~~

O p- blank.PNG

B p- blankbg.PNG

1

/// - End Animation

Noting that “blank.PNG” and “blankbg.PNG” change depending on the filename and extension of the blank object and blank background files respectively.

Now open up FEditor Adv with your ROM. I always use a testing ROM for my animations and back-up the test ROM so that if something screws up, nothing bad that I can’t fix will result. I always perfect it in a test ROM and if your hack gets messed up because you tried to do this straight on your real hack, don’t blame me. Though you can’t blame me for any of this as this is just a profit-free guide to hacking and you’re using it out of your own will with no responsibility or liability on me.

ANYWAY…

Open up the scary spell animation inserter under tools. Should look like this:

Don’t freak out. Most everything on the top half is for manually making spells. We are using a script so this is not necessary. Scripts are much, much better—much more convenient, much easier to use, much easier to fix, much easier to share. So just forget about everything before the “Add Miss Terminator” button, including that button.

“Max index” refers to the max # of spells you can have, which you can change to increase the amount of spells you can have. (Derp)

Input index refers to the spell animation hex… that is, which animation you’re replacing. You should be able to find a list with any spell association editor, that is the nightmare module named so, though I believe it’s oddly called the Custom Item Animation List module for FE8—regardless here’s an excerpt from the FE8 list (named Ranged Attack Animations.txt)

74

0x00 - Nothing

0x01 - Hand Axe

0x02 - Arrow

0x03 - Javelin #1

0x04 - Javelin #2

0x05 - Javelin #3

0x06 - Javelin #4

0x07 - Javelin #5

0x08 - Javelin #6

0x09 - Javelin #7

0x0A - Javelin #8

0x0B - Javelin #9

0x0C - Javelin #10

0x0D - Javelin #11

0x0E - Dance/Play (Regular)

0x0F - Dance/Play (Regular)

0x10 - Ballista (Glitchy Arrow)

0x11 - Nothing (Stalls Battle Screen)

0x12 - Sword of Seals Fire

0x13 - Flametongue

0x14 - Fa's Holy Dragon Stone (BGM/SFX-kill)

0x15 - Iodun's Dark Dragon Stone (Mirrored)

0x16 - Fire

0x17 - Elfire

0x18 – Nothing

As you can see the hex is on the left with the name of the spell animation on the right. If you didn’t already know, anything that is a projectile is considered a spell, including javelins, arrows, and hand axes-it doesn’t have to actually be magic. This is just to simplify the naming of things, it’s easier to refer to everything as spells.

I am going to replace 0x16, Fire, because it is very easy to just get a mage unit to use Fire. In fact, my animation testing ROM has a save state with a mage (with a custom battle animation nonetheless) using Fire, so this is totally perfect. *wink*

Regardless of whatever you replace you’ll likely need to use Nightmare to get a situation where you can actually test the spell animation. I also suggest upping the critical a little bit and keeping Nightmare handy so that you can ROM hack the character or weapon’s stats as to force misses, hits, criticals, etc., to test various different situations. If you know how to RAM hack to change those stats on the spot, that’s even better, but I won’t teach that here.

Back to FEditor Adv, type in the input index and load your script using the obvious button. There should be no errors unless you somehow got the wrong image or typed in the wrong path in the script. When it’s done the log at the bottom will show some stuff but not much else will happen. You have to hit “terminate animation” to finish the spell insertion and insert it to the input index. In the case that you’ve messed up, be sure to hit “reset animation” before loading a script again, or you’ll load over an existing script.

Lastly if you want to dim the screen you can click that box. For things like arrows and javelins you probably won’t want that but actual magic spells will probably want the screen dimmed to make it more authentic as most if not all spells do so.

When it’s inserted the spell animation hit “quit” and save with FEditor Adv. If you need to, setup a mage or something to use the spell (using Nightmare or the Event Assembler or whatever is needed) and test the animation. Just be sure to close FEditor Adv after you’re done so that you don’t end up overwriting changes (see the chapter on how to have good hacking habits, wherever that one is, and why you shouldn’t have FEditor Adv and Nightmare opened up simultaneously).

Congrats! You’ve inserted your first spell animation! It’s especially bland and should just involve a basic hit and a quick screen dimming. That’s the point though—to make sure you know how to insert it. Now all we have to do is add in actual sprites and spice it up with some codes.

Easier said than done thuogh.

Now we’re off to making frames. I’m going to start with the object frames first because I feel they are easier. The image is divided into 3 parts: a 240x160 section, another 240x160 section, and an 8x160 section.

The first section is the foreground. I think. It’s the sprite that shows up in front of the battle animations. The second 240x160 section (P.S., 240x160 is the size of the GBA screen, which you should know from the battle animation tutorial) is the background. It’s what appears BEHIND the battle animations. All you have to do is copy/paste your spell sprite to the appropriate section depending on what you want. As for actually knowing where to put it, that is an animation issue, which is more of an artistic thing. I suggest taking a screenshot of the GBA game and finding where you want your spell to start, then taking the pixel co-ordinates of that point, doing that as you animate the frames. Again, the battle animation tutorial teaches this so I will NOT go through this in detail.

If the frames are already fit to be 240x160 and animated for GBAFE, then that is absolutely awesome. Just one more reminder: the spell should assume that the screen is NOT shifted. The screen’s view sliding/shifting is a trick of the game, a code in the script.

The final portion is for the palette. You can enter in a palette like you did battle animations but it’s tedious and mostly pointless so I suggest leaving it as the transparent color and FEditor Adv + the game will handle the rest. Hextator did a good job of making this convenient, no? Props to him. XP

Believe it or not this Shaver spell I am inserting does not have ANY object frames; everything is translucent and thus I have to use the background frames. However here is an example.

I suggest saving each frame as a new file numbered in the order they appear. Take note that you load an object frame and background frame at the same time so one sprite may appear simultaneously with another. Oh, the beauty of spell animations.

The object frames are a bit more of a pain in the butt. They are 264x64. Yes, only 64 height, when the screen is 160 pixels. You see, these frames only use a specific portion of the screen. 160-128=32. They ignore 32 pixels. 16 on the top of the screen, 16 on the bottom. Why is it 64 height? The image is resized to be half. Why? Hextator (the creator of FEditor Adv and the CSA system) had to do this in coding the new spell animation format. He actually made a completely new system for spell animations. That’s why everything’s so different. And he worked hard on this. I would know. I was there. So live with what you get and don’t be a whiner. ^_^

The actual width of the actual image here is 256x64. The last 8x64 portion is of course for the optional forced palette. The image is 256x64 because you have to remember that the screen can slide here in which case the range of the spell can become more than just 240 pixels, if you get what I mean… (if you don’t get it, don’t worry about it; act like everything’s normal).

Time to do this. For my spell animation, my ripped frame starts off looking like this, though I happened to pick a frame in the middle just for a first frame test (once we make our first background frame, along with the object frame we learned to do earlier, we’re going to do another spell insertion test).

Oooh, shiny. However, that won’t do for insertion. Gonna take off the bottom half first, then resize it to 240x160.

Well it still looks pretty good to me. So let’s remove 16 pixels off the top and bottom then since this part of the spell only takes part in the middle area…

All that’s left is to resize it to half again:

Add the 24x64 portion to the right to make it 264x64:

Aaaaand make it 16 colors. Oh wait, how do we do that? Well, I use Usenti (found on google).

Palette -> Requantize -> #colors = 16, “OK”

Result:

Thoughts: Blegh.

The quality has gone down. Even if the image will ultimately be stretched back to 240x128 height like it should be (that’s just how these frames work, has to do with the transparency), the post-resized result won’t be as good as the original and now that it onlny has 16 colors it doesn’t look nearly as shiny or cool.

And what can we do?

Not much.

That’s hacking for you. Especially on the GBA system. There are limitations. You can’t always get what you want, definitely not get it to be perfect. If you get it even close you should consider yourself lucky.

So we suck it up, save the frame, and go to our script to add it in there:

To do that though, you have to learn about the format of scripts. Before I go through a script though, I suggest you open up the 0x85 command list for spells (found in FEditor Adv\doc\Custom Spell Animations) and readup on that a little. Just a little, for old Blazer here. Then you can read my explanation of each code below.

/// - Start Animation – always at beginning

C00 – buffer code. Stalls. Needed. If you encounter random looking graphic or palette errors you probably need some of these. Sometimes if the spell progresses too fast it loads the wrong palette or other data in the VRAM or elsewhere interferes with the spell. In short, just add these and take it easy.

C00

C00

C00

C00

C00

C00

C000040 – makes the screen slide. Always have it, and early.

O p- blank.PNG – object frame, followed by the path. This code must be proceeded by the next two codes, they are all jumbled up together, you can’t load one frame by itself. Or if you can you couldn’t back in the day. :P

B p- blankbg.PNG – the background frame. Same deal.

1 – the length of the frame. 1 is the shortest. Has to be a whole number. 3 is like slow. Most frames will probably be 1-3. This is more of an animating thing, but you can test different times yourself to get a feel for it.

C00001A – hit code, must have

C1F – hit sound, recommended

~~~ - miss terminator. This makes it so that the animation stops if a miss occurs. Stupidly enough this HAS to be after hit code, meaning you can’t have an animation miss before it would have hit. It has to miss after it would have hit. Yeah, I know. Silly and inconvenient. That’s life.

O p- blank.PNG – another frame loading code identical to the one above. Nothing special here.

B p- blankbg.PNG

1

/// - End Animation - ends loading code from the animation script

Now that that’s explained, let me go through the command list:

0x00 through 0x13 (except 0x08) - Ignored/unused – self-explanatory

0x08 Attack (becomes critical automatically) with HP stealing – never used this before but I believe you use it either instead of C00001A or after C00001A. Find out for yourself if you’re really curious.

0x14 through 0x28 - passed to attacker's animation; it is recommended that all possible caster/

spell animation combinations are considered such that no combination conflicts – this means that using a code with one of these command values is like using a code for the battle animation user, not for the spell. You’d have to see the 0x85 command list for battle animations to know what codes C14-C28 would do.

0x29 Set brightness and opacity levels for the background. – opacity refers to the translucency (the opposite in a way)

Argument XX is the brightness level from 0 to 100% (0x0 through 0x10) – 0x00 = 0, 0x10 = 100%, values in the middle reflect a percent in the middle

Argument YY is the opacity level from 100% to 50% (0x0 through 0x10) – 0x00 = 100% opacity (can see everything), 0x10=50% opacity (is translucent and you can see halfway through). As above, values in the middle reflect a percent in the middle.

0x2A Sets whether maps 2 and 3 of the GBA screen should be visible.

Argument YY is the boolean for whether to display those two maps:

The value 0 means "false to display"; all other values mean "true". – thus C00002A would stop maps 2 and 3 from being visible, C00YY2A where YY is any value but zero would mean it shows. This is used to make parts of the screen black.

0x2B through 0x3F - passed to attacker's animation; see note above – see my own note above, heheh

0x40 Scrolls the screen from being centered on the attacker to being centered on the defender.

This should not be used more than once per animation. – has been used/explained before

0x41 through 0x47 - passed to attacker's animation; see note above – see my own note above… again. teehee

0x48 Plays sound or music whose ID corresponds to those documented in Music List.txt of the Nightmare module packages. - very awesome code, used for almost all sounds. Is pretty much explained enough already.

Argument XXYY is a 16 bit music ID.

0x49 through 0x52 - passed to attacker's animation; see note above for commands 0x14 through 0x28 – bla bla bla, see above

0x53 through 0xFF - Ignored/unused – derp

Okay, now that I’ve broken down the format of and the possible codes used in spell animations, we can start adding in some own frames and codes. Here’s the bulk of my script for my next test:

C000040

C100D29 – Set brightness to 0x10 = 100%, and opacity to 0x0D—given that 100%-50%=50% = range of opacity change, and 0x10 = 16 values, 50/16=3.125 meaning each increase in 0x01 is equal to a little bit more than a 3% decrease in opacity. 0x0D =13 x 3.125% = 40.625% opacity decrease. 100%-40.625%=59.375% opacity level. That’s some math for you. =D

O p- blank.PNG – this frame load here is just a buffer blank frame load that’s good to have

B p- blankbg.PNG

2

C02F948 – this is command 48, loading sound 02F9, which happens to be a swishy sound I’m testing out (to see if it fits Shaver).

O p- blank.PNG

B p- s1.PNG – another frame load but this time I’m loading frame s1, the new background frame I made. Since I applied an opacity change code it should appear somewhat translucent.

10 – the length is 10 to make sure I can see it clearly, since this is just a test of one frame.

C00001A (after this the rest of the script continues on)

Wooh. Alright, time to save our script and test it. Here goes nothing!

Oops! An error! How do we figure out what went wrong? Well, thankfully we’re early on so we only have a few frames to check and a few codes to check. Sometimes it’ll say that an image’s dimensions are wrong, in which case you must of course check that. Other times FEditor Adv might be a bit more cryptic and say:

Great, I could have told myself that. Thankfully the log can help us a little. We can look at the last frame it attempted to load and check that frame and the codes around it for any errors.

“…\Shaver (DS)\s1.PNG”

Okay, s1.PNG. Wait, that’s the new frame I did! What’s wrong?

After a look at my programs, I realized I never saved my 16color version (yes, this actually happened to me, haha, and it was a perfect chance to write about it). If it were a code problem I could have looked at this information:

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]