Hey, not sure where the best place to ask about skill editing is, whether there’s a designated thread or discord, but I’m trying to figure something out. I’ve modified the Short Shield skill to negate all close ranged damage. What I did was basically copy to set attackers damage to 0 code from the existing Tower Shield+ skill. And it works! Units with the skill receive 0 damage when attacked at range. The issue is, they also deal zero damage when attacking at range, which is not intended. Essentially the skill makes it so whomever initiates the combat, regardless of which of the two combatants has the skill, deals zero damage. The battle forecast says they’ll do damage but then in combat their damage is just zero. Why is this happening? Here is the code I have.
.thumb
.align
.equ ShortShieldID,SkillTester+4
push {r4-r7,lr} @goes in the battle loop. @r0 is the attacker @r1 is the defender
mov r4, r0
mov r5, r1
Still trying to get my head around what assembly commands mean.
@make sure the enemy is a mage
ldr r0,[r5,#0x4]
mov r1,#0x30
ldr r0,[r0,r1] @so this loads the unit’s staff/anima/light/dark prof
cmp r0,#0x0
beq End @if they’re all 0 the enemy is not a mage
What in the above code is checking the staff/anima/light/dark weapon ranks? I want to edit the skill so it only works with light magic, but I don’t really get what data is being checked for.
r5 contains the defender’s battle struct. This command loads the content of the bytes 0x4-0x7 of said struct, which happens to be a pointer to the class data of the defender.
Here we load bytes 0x30-0x33 of the defender’s class data, which contain the base weapon ranks of the class for Staff, Anima, Light and Dark (in that order).
If the class doesn’t have any weapon rank experience for those weapon types, we skip to the end.
So, to check for Light magic specifically, instead of loading bytes 0x30-0x33, you’d need to load only byte 0x32.
That’s very good for me getting my desired result, but I’d like to understand a bit more. How is #0x30 loading bytes 30-33 and not just byte 33, while loading #032 loads just 32? I’d guess it’s because you’re using a different command of ldrb vs ldr, but I’m not sure what that has on loading byte data in either direction.
Ah, that makes sense. So in the first instances it was saying load data from this address to fill 4 bytes, while in the second it’s load data to fill just one byte and one weapon rank. What if I happened to want to have five weapon ranks loaded (I don’t, just trying to understand the system better)? Is there a command for five bytes or would you just LDR first and then LDRB afterwards?
You cannot load that much into a register. Each register is 32 bits, or 4 bytes. Have you read this guide: GBAFE Assembly for Dummies, by Dummies? It covers some of these more basic ASM things.
I did skim it looking for specific information to accomplish specific tasks. There’s a lot in this. Though deep at the back of my mind the notion that 4bytes is the most you can load does resonate with ancient knowledge from my university days. I suppose the question remains then, if you did want something like this to cover five weapon types, how would one go about it?
Ah, so you can apply the effects and then just load the register with more bytes. I was worried you’d have to basically make the whole skill twice. Good to know.
I’ve tried using the most up to date build file but importing it into FEBuilder has some issues. I’m largely finished with the current project though so what I have is fine. When I start my next project I’ll probably try and use the most modern version of skill systems right away.
See, that’s where you’re doing it wrong. You have to have your buildfile reade, and then run MAKE_HACK_FULL. And after that, you open the new ROM with FEBuilder