Golden Sun Hacking Community

Golden Sun Resources => Misc. GS Hacking => Topic started by: Caledor on 02, September, 2016, 08:32:51 PM

Title: [SOLVED] Merman line stands still while "casting" issue
Post by: Caledor on 02, September, 2016, 08:32:51 PM
I was trying to add new abilities to the merman line to differentiate things a bit, but i noticed that they stand still for most of them and i don't really like that. I want them to use the same animation they use for Hydro Slash and attacking for other abilities as well.

Basically make animation 3 of the merman line sprite a carbon copy of their animation 2, just like how the lizardmen line works.

My random guess (read: hope) is that enemy sprites use a pointer table to reference their animations so the whole thing can be fixed by changing a few bytes

So far i tried looking for sprite data at 08300000, which is too short to hold them all, and at 0802E91C but there's no info about what these number represents.

Long story short... does anybody know where/how enemy sprites and their animations are stored?

Thanks in advance
Title: Re: Merman line stands still while "casting" issue
Post by: Daddy Poi's Oily Gorillas on 03, September, 2016, 07:53:51 AM
Took me a sec to realize what you meant... But I think I get it now? - Basically, abilities (Or their animations(?)) can pick which animation index the enemy should use - 2 or 3? - So instead of us just setting said value to be 2 (haven't looked at how that was done.), we can just replace the enemy's animation 3 to match 2... (As you say.)

0x08300000 is likely the table, then....

Quote08300000 = Sprite Data
BYTE - Sprite width
BYTE - Sprite height
SHORT - Image scale.  A value of 0x0100 is 100%, 0x0200 is 200%, and 0x0080 is 50% (In hex 0x080 is half of 0x100).
BYTE - Number of directions the sprites have (Party members have 5, NPCs have 3, battle sprites have 2, e.t.c.  Sometimes this value is different to represent that some of the directions are mirrored compared to how they usually are)
BYTE - Number of animations
BYTE - X offset
BYTE - Y offset
BYTE - Unknown
BYTE - Collision Radius
BYTE - Compression format
BYTE - Unused (Version 0.4+ of the editor uses this space to store the number of sprites)
WORD - Pointer to a collection of pointers to the graphical sprite data
WORD - Pointer to a collection of pointers to the animation data
Sprite data was one of those things I didn't do much research on... (Welll, the code for it is not documented?) ... But I'm guessing it is the last pointer that we want to look into?

0x08300000 + id * 0x14.... where id=0x23D (573) for Merman.... = 0x08302CC4 , +0x10 for that pointer.... and.... follow it to 0830686C , I'm assuming that each pointer is each animation... (didn't verify)... so let me know if changing the pointer in the last column (if viewing in 32-bit) to match the one in the third column works or not.


Looks like most are having six animations?
0 = Paused
1 = Idle
2=Attacking
3=Casting?? (Almost makes me want to check if this could be related to the Ability Type Values?? No idea.)
4=?
5=Hit

Edit again:
Quotejust like how the lizardmen line works.
I think his animation 3 is a tad slower than his animation 2.... which makes me wonder if that is casting as well.... Human enemies like Saturos and Menardi, make it seem like the casting animation for sure.
Title: Re: [SOLVED] Merman line stands still while "casting" issue
Post by: Caledor on 03, September, 2016, 11:13:32 AM
Worked flawlessly. Sadly i also realized that i could've done this without bothering you, cause when i tried before posting i made a few stupid mistakes with hex conversions that sent me off track.

So, sorry for the hassle and thanks again, man ;)
Title: Re: [SOLVED] Merman line stands still while "casting" issue
Post by: Daddy Poi's Oily Gorillas on 03, September, 2016, 07:24:26 PM
No problem. That's what we're here for. Hacking conversations....

It's nice to know about the Attack and Casting animations, though... maybe I look into fixing up the battle mechanics section of my doc later on... Hmm...