[FE6/7/8] Circles' Spell Animation Creator [UPDATED TO V1.1]

For frames that are too big, resize them to half height like for feditor spells and use the C000153/C000053 commands to toggle screen stretching

I was thinking in doing that, but again, this engine breaks my hack.
I didn’t change any pointer besides the CSATable and the pointer for the spell.

So i’ve been having a very weird error. Both my custom animations and animations from Eliwan and Alusq which both work for them will go through the creator fine, and a .event file will be outputted, but there will be none of the .bin files. Wan’s and Alusq’s both work for them, so this is incredibly strange. send help soon

outsource your spell anims to wan/alusq

uhh redownload??

Tried redownoading, no success. I’ll attach the folder
https://www.dropbox.com/s/xhnzcn35irki8ie/Ice.rar?dl=1

Fixed my error, thank you for helpin

Hello. I’m having some problems… as usual.

I’m trying to convert a spell, Aircalibur, as a test, and I get this error (along with other spells I try).

[details=Error]Traceback (most recent call last):
File “CSA_Creator.py”, line 144, in processBG
KeyError: ‘blankbg’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “CSA_Creator.py”, line 232, in
File “CSA_Creator.py”, line 229, in main
File “CSA_Creator.py”, line 67, in processScript
File “CSA_Creator.py”, line 191, in addFrame
File “CSA_Creator.py”, line 146, in processBG
File “CSA_Creator.py”, line 165, in gritify
File “subprocess.py”, line 383, in run
File “subprocess.py”, line 676, in init
File “subprocess.py”, line 955, in _execute_child
FileNotFoundError: [WinError 2] The system cannot find the file specified
Press Enter key to exit.[/details]

Here’s the script I’m using. The only edits are adding C000153 and removing the " -p" before frames.

[details=Script][code]/// - Start Animation
C00
C00
C00
C00
C00
C00
C00
C000040
C000153
C00
C00
C00
O blank.PNG
B blankbg.PNG
1
O windo01.PNG
B blankbg.PNG
1
C02BF48
O windo02.PNG
B blankbg.PNG
1
O windo03.PNG
B blankbg.PNG
1
O windo04.PNG
B blankbg.PNG
1
O windo05.PNG
B blankbg.PNG
1
O windo06.PNG
B blankbg.PNG
1
O windo07.PNG
B blankbg.PNG
1
C012248
O windo08.PNG
B blankbg.PNG
1
O windo09.PNG
B blankbg.PNG
1
O windo10.PNG
B blankbg.PNG
1
O windo11.PNG
B blankbg.PNG
1
O windo12.PNG
B blankbg.PNG
1
O windo13.PNG
B blankbg.PNG
1
O windo14.PNG
B blankbg.PNG
1
O windo15.PNG
B blankbg.PNG
1
O windo16.PNG
B blankbg.PNG
1
O windo17.PNG
B blankbg.PNG
1
O windo18.PNG
B blankbg.PNG
1
O windo19.PNG
B blankbg.PNG
1
O windo20.PNG
B blankbg.PNG
1
O windo21.PNG
B blankbg.PNG
1
O windo22.PNG
B blankbg.PNG
1
O windo23.PNG
B blankbg.PNG
1
O windo24.PNG
B blankbg.PNG
1
O windo25.PNG
B blankbg.PNG
1
O windo26.PNG
B blankbg.PNG
1
O windo27.PNG
B blankbg.PNG
1
O windo28.PNG
B blankbg.PNG
1
O windo29.PNG
B blankbg.PNG
1
O windo30.PNG
B blankbg.PNG
1
O windo31.PNG
B blankbg.PNG
1
O windo32.PNG
B blankbg.PNG
1
O windo33.PNG
B blankbg.PNG
1
O windo34.PNG
B blankbg.PNG
1
O windo35.PNG
B blankbg.PNG
1
O windo36.PNG
B blankbg.PNG
1
O windo37.PNG
B blankbg.PNG
1
O windo38.PNG
B blankbg.PNG
1
O windo39.PNG
B blankbg.PNG
1
C00
C00001A
C1F

C00
CFFFF29
O blank.PNG
B windb01.PNG
1
C101029
O blank.PNG
B windb02.PNG
1
O blank.PNG
B windb03.PNG
1
O blank.PNG
B windb04.PNG
1
O blank.PNG
B windb05.PNG
1
O blank.PNG
B windb06.PNG
1
O blank.PNG
B windb07.PNG
1
O blank.PNG
B windb08.PNG
1
O blank.PNG
B windb09.PNG
1
O blank.PNG
B windb10.PNG
1
O blank.PNG
B blankbg.PNG
1
/// - End Animation[/code][/details]

[s]I'm suspecting that my background frames are the wrong size, but I'm not sure. What size should the object and background frames be if I'm using screen stretching?[/s]

Never mind. Got help on Discord.

SOLUTION: YOU NEED TO HAVE GRIT IN THE FOLDER FOR IT TO WORK.

@circleseverywhere asked me to ask here from Discord, so…
I keep getting too many tiles errors in my spells that are already squished from FEditor format.
I’ve tried many common spells like Boganone and Aura, but I keep getting the same error.

Follow up: Can this be used in conjunction with FEditor, or will it have problems with the CSA table?

Double-check your blank frames in Usenti and make sure that the background colour comes first in the palette and there are no other colours in the palette that are the exact same as the background. I had this problem with my blank.png because the background was 0,0,0 but there was another slot in the palette that was 0,0,0, so the assembler was reading the image as a screen full of black tiles. I changed the background colour to be unique and the problem was fixed.

1 Like

Holy hell thank you so much.
Never mind my second question them.

Hi guys, I found a spell problem.
spells are aligned to the screen. but the enemy position on screen changes between melee and range.

Is there any way to solve it?

Fixed c18 command crashing custom animations

Um

This is from a relatively clean ROM with the most recent updated engine and installer format. I’ve only changed the installer to be a little bit to be more buildfile friendly.

Dead link edited out, problem has been fixed with a patch in the new CSA .event installer.

Here’s my installer. This happens with all custom spells when they miss on units that do this type of dodge.

Does anyone have a CSA system with working dodges?

Updated the spell engine to allow dodges to the front

4 Likes

Yes, finally a release for me

CSA Creator v1.1 has a glitch.
(This problem does not occur with FEditorAdv’s magic routine.)

It is necessary to fulfill all the following conditions.

In Custom Spell Animation, there are multiple animations after miss terminate.
For example, an animation such as Ragnarok.

the Enemy’s counterattack is miss.
This bug does not occur if the enemy counterattack does not make a mistake.

Player unit is Hero or Sniper.
It does not occur in other classes.

CSACreator freezes when all these are fulfilled.

UPS
https://cdn.discordapp.com/attachments/235253973588639747/590084159486165002/csa_creator_glitch.7z

unknown%20(1)

It seems that an infinite loop occurs in the AIS_ExecAll function.

I am using CSA Creator v1.1.
Is there a newer version that fixes this problem?

Snakey1’s patch seems to work properly.
I made the FE8J version.

I registered as a “Fix dodge to front glitch” in the FEBuilderGBA patch item.

3 Likes

I found a problem in the CSA routine (CSACreator and FEditorAdv). This routine breaks the background 0x35.

  ORG $95d780
  CSAEngine:
  #incbin "CSA System_fe8.dmp" //the custom spell engine. All custom spells point here. //HINT=ASM
  POIN CSATable //needed for the routine

These routines install the routine at 0x95d780. Probably It is Procs. This place is the one used in the background 0x35. 0x35 is a black image, but it is used for production. This routine is a variety of games already used, so if you need background 0x35, I think there is no choice but to change the address of the background.


0x95d780 is part of the lz77 image with background 0x35.

In FEBuilderGBA, you can force a reallocation by exporting the background image 0x35, then setting the image address to 0, and then importing the image again.
If you forget to set the image address to 0, it will wipe existing routines and may hurt your CSA routines.
Therefore, it is recommended to set the image address to 0 once.

5 Likes

(Please forgive my bad gifs. I don’t know what’s gone wrong, but I have low amounts of continuous time.)

The documentation from Hex’s version of this engine claims that a script’s order is

Frames
C00001A (“hit”, ergo deal damage/flash battler/screen shake)
C00001F (hit sound)
Frames
~ (“miss terminator”; “animation will exit if this is reached & caster will miss”, must go after “hit” code)
Frames

However; doing this as written yields a rather unexpected result – the whole animation plays on miss, but it also incorrectly updates the caster’s animation sheet.

If we move the single ~ to the end, the animation hangs on miss for many seconds.

By adding a second ~ at the end

Frames
C00001A (“hit”, ergo deal damage/flash battler/screen shake)
C00001F (hit sound)
Frames
~ (“miss terminator”; “animation will exit if this is reached & caster will miss”, must go after “hit” code)
Frames
~ (terminator)

I still didn’t get the expected “early end on miss”, and had bad sound effects as well; but the battler stops animating wrong.

2021-11-02_17-12-56

It seems from my tests that the word that ~ maps to, 0x80000100, is a label that gets jumped to, and is not the same as the animation-terminating 0x80000000, if I understand it correctly.

This makes the actual pattern be:

Frames
C00001A (“hit”, ergo deal damage/flash battler/screen shake)
C00001F (hit sound)
Frames
~ (“label 1”, skip to here on miss)
Frames
~ (‘false’ terminator)

What that, in turn, means, is that you can easily have commands that only play on hits, like a transparency change, by putting it after the C00001A but on the same frame as it…

2021-11-02_17-18-57

…and you can have a different animation for missing (as opposed to just terminating)…

2021-11-02_17-57-14

However, that alternate animation would play after any successful hits as well; it plays an incorrect sound, and at ranged this scrolling oddity happens (sometimes?).

HOWEVER: Manually sandwiching the 0x8000100 between a pair of end-of-animation 0x80000000, fixes both of these in my tests.

I suspect this is because it jumps to the label +4, but I’m not competent at debugging so I didn’t even try.

That is to say, after processing the animation with CSA_Creator.exe; editing the file directly lets us get hugely different results:

WORD 0x8500001a
WORD 0x8500001f
WORD 0x80000000 //added
WORD 0x80000100
WORD 0x80000000 //added
SHORT 1; BYTE 28 0x86; POIN _000_BM_LilFire_objimg_0; WORD 336 336; POIN _000_BM_LilFire_bgImage_27 _000_BM_LilFire_objPalette _000_BM_LilFire_bgPalette_27 _000_BM_LilFire_TSA_27
WORD 0x8503ac48

By adding these, the animation will play on miss, and terminate on hit (a reverse of the listed functionality):

2021-11-02_20-15-52

And if we combine that with the previous sample;

Frames
C00001A
Frames-only-on-hit
(manually added 0x80000000)
~
(manually added 0x80000000)
Frames-only-on-miss
~

Something like this becomes possible for us; and this is not otherwise doable in this editor.

SHORT 1; BYTE 47 0x86; POIN _000_BM_LilFire_objimg_0; WORD 564 564; POIN _000_BM_LilFire_bgImage_0 _000_BM_LilFire_objPalette _000_BM_LilFire_bgPalette_0 _000_BM_LilFire_TSA_0
WORD 0x80000000 //Here.
WORD 0x80000100
WORD 0x80000000 //and here.
SHORT 1; BYTE 48 0x86; POIN _000_BM_LilFire_objimg_0; WORD 576 576; POIN _000_BM_LilFire_bgImage_25 _000_BM_LilFire_objPalette _000_BM_LilFire_bgPalette_25 _000_BM_LilFire_TSA_25

This yields the desired full effect: Actually different animation on hit or miss and not whiplash-scrolling.

2021-11-02_20-27-34

8 Likes

Since there wasn’t a command to scroll the camera from the target to the attacker (like Nosferatu does), I decided to add it myself:
Resire4

Use C000080 to make this happen, preferably at some point after C000040 is used.
This is only for FE8, but I think it can be implemented for FE6 and FE7 too.
I just added this pointer to the PC_Array (For FE7 and FE6 most certainly it’s another pointer):

.long 		0x0805A9F4 + 1

Tthen I added a comparison for FRAME_TYPE_85:

  cmp       r1, #0x80   @
  beq       COMMAND_80

And the functionality:

    COMMAND_80:
    mov r0, r5    @
    mov r1, #0x1    @
    neg r1, r1    @

    @bl       0x080533D0 - origin
    push  {r7}      @
    mov r7, #0x0B   @
    bl        CALLFAR
    pop {r7}      @

    push  {r7}      @
    mov r7, #0x10   @
    bl        CALLFAR
    pop {r7}      @

    b       COMMAND_COMPLETE

I also had to add/move some labels so the branches weren’t out of range.

This was pure trial and error, and luck, I’m not entirely sure what 0x0805A9F4 is meant to do, but without it I had some weird results (ignore the garbage frames, I was using unstretched frames at first) :

Resire1Resire2
Resire3

10 Likes

I found out recently that the CSA engine for FE6 is not compatible with the fan translation. I dug into it myself and saw that it uses its own version of CSA (FEditor?), where the code was largely the same but in a different order. Not only that, but it has two extra functions at the tail end that jump back to even more new code that takes place after the 01 Command Hack area. Unfortunately, whatever magic system is already there doesn’t fully work; it plays custom spells very slow, the screen shakes constantly for some reason, and the background is garbled unless you dummy out a big chunk of code.

However, I had a bit of inspiration: there’s enough room for the CSA engine before the new save data asm, so I was able to shift some of the LDR data below the save data asm and manually adjust everything that points to them. The result…seems to work! And, FEBuilder is even smart enough to automatically find the shifted location of the CSA table pointer. Custom spells play as expected and saves can be made.

One potential issue with my method, though, is that it bleeds into the anti-Huffman patch area… However, it seems the translation patch uses its own take on anti-Huffman because there is absolutely nothing there, but FEbuilder has it labeled as such. I don’t think it’s an issue, but it’s something to keep in mind, possibly.

Now, l don’t know if I commit some subtle assembly-writing sin with this, but l’ll post what l have regardless. I converted it into bin files, so you can install it just by running the .event file with Event Assembler.

https://cdn.discordapp.com/attachments/243267327586598912/949496880377757716/CSA_for_the_FE6_Translation.zip

l lightly tested it on the 1.1.3 translation patch and the basics worked. My own project is on an older version of the patch, but it works there, too, and l’ll be testing that more thoroughly.

Two years later…

It turns out the in-game side of this allows each object frame to have its own palette.
CSA Creator doesn’t support inserting these palettes, so I decided to add that functionality.

Here are gifs that use an animation by @Struedelmuffin to demonstrate:

Without palettes per frame:
Palette_Old

With palettes per frame:
Palette

Executable downloads:

Source code, for those interested:

12 Likes