(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.
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…
…and you can have a different animation for missing (as opposed to just terminating)…
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):
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.