Hi, it’s me, again with more questions about the assembly code, I thanks in advance everyone who will read this post, because with my English it will not be easy
I have several questions, I start from the simplest to the most complex:
Unit's Magic with Str/Mag split
I’ve tried to create an ability that checks whether character X’s magic value differs from Y’s physical defense
and if the difference was positive for X, X got a bonus, I say in advance that I succeeded, and it seems to work but …
.thumb .equ SavageMagicID, SkillTester+4 .equ gBattleData, 0x203A4D4 push {r4-r7, lr} mov r4, r0 @atkr mov r5, r1 @dfdr @has the skill ldr r0, SkillTester mov lr, r0 mov r0, r4 @attacker data ldr r1, SavageMagicID .short 0xf800 cmp r0, #0 beq End @make sure we're in combat (or combat prep) ldrb r3, =gBattleData ldrb r3, [r3] cmp r3, #4 beq End mov r6, #0x3A @take magic of atk ldrb r0, [r4, r6] @magic atk ldrb r1, [r5, #0x17] @defender defense cmp r0, r1 ble End @skip if str is less or equal @add 2 damage mov r1, #0x5a ldrh r0, [r4, r1] @atk add r0, #2 strh r0, [r4,r1] @ add 10 crit mov r0, r4 add r0,#0x66 @Move to the attacker's crit. ldrh r3,[r0] @Load the attacker's crit into r3. add r3,#10 @add 10. strh r3,[r0] @Store. End: pop {r4-r7} pop {r0} bx r0 .align .ltorg SkillTester: @Poin SkillTester @WORD SavageMagicID
to make this code work I had to enter a string (the first of the second box)
I wanted to ask if it is correct to do so because not inserting it doesn’t work as if not going to take the value of the unit’s magic.
mov r6, #0x3A @take magic of atk ldrb r0, [r4, r6] @magic atk ldrb r1, [r5, #0x17] @defender defense cmp r0, r1 ble End @skip if str is less or equal
Blow Skill
I tried to create a skill with the effect similar to hose “Blow”
My idea was that when X attacks Y, and if Y has less than 50% life total, X gets a bonus
> WindStrikeSkill: > ldr r0, =0x203a56c @defender > ldrb r1, [r0, #0x12] @maxhp > lsr r1, #1 @max hp/2 > ldrb r0, [r0, #0x13] @currhp > cmp r0, r1 > beq SkillReturn *line 189* > ldr r0,=0x203A4EC @Move attacker data into r0. > add r0,#0x5a @Move to the attacker's dmg. > ldrh r3,[r0] @Load the attacker's dmg into r3. > add r3,#3 @Add 3 to the attacker's dmg. > strh r3,[r0] @Store attacker dmg. > add r0,#0x60 @Move to the attacker's hit. > ldrh r3,[r0] @Load the attacker's hit into r3. > add r3,#0x0F @Add 15 to the attacker's hit. > strh r3,[r0] @Store attacker hit. > add r0,#0x66 @Move to the attacker's crit. > ldrh r3,[r0] @Load the attacker's hit into r3. > add r3,#0x0A @Add 10 to the attacker's crit. > strh r3,[r0] @Store attacker crit. > add r0,#0x5E @Move to the attacker's AS. > ldrh r3,[r0] @Load the attacker's AS into r3. > add r3,#0x02 @Add 2 to the attacker's AS. > strh r3,[r0] @Store attacker AS. > b SkillReturn @Attacker's attack. Redundancy? Nah.
I put this code in Check Blows because I believe it falls into that category … but my problem is that when I try to assemble all the code it brings me an error
in the code box I have indicated which line 189 is
my idea is that i got out of the control loop … i went to see and made this change
CheckLoop: mov r0, r5 ldr r2,BlowIDList @Load in the list of Blow Skills. ldrb r1,[r2,r4] @Load in the next Blow Skill in the list. ldr r3,SkillTester mov lr, r3 .short 0xf800 @Call Skill Tester. cmp r0, #0 @Check if unit has the corresponding Faire skill. bne SkillChecks SkillReturn: add r4, #0x01 cmp r4, #0x0B *0x0A to 0x0B* bne CheckLoop b EndProgram SkillChecks: cmp r4, #0x00 beq DuelistsSkill cmp r4, #0x01 beq DeathSkill cmp r4, #0x02 beq DartingSkill cmp r4, #0x03 beq WardingSkill cmp r4, #0x04 beq CertainSkill cmp r4, #0x05 beq ArmoredSkill cmp r4, #0x06 beq QuickDrawSkill cmp r4, #0x07 beq ChivalrySkill cmp r4, #0x08 beq PragmaticSkill cmp r4, #0x09 beq HeroesDeathSkill cmp r4, #0x0A *my* beq WindStrikeSkill *my* b SkillReturn
in the same folder, in the EVENT file I also inserted “WindStrikeID” (my skill)
ALIGN 4 BlowCheck: #incbin "BlowCheck.dmp" POIN SkillTester POIN BlowIDList ALIGN 4 BlowIDList: BYTE DuelistsBlowID DeathBlowID DartingBlowID WardingBlowID CertainBlowID ArmoredBlowIDQuickDrawID ChivalryID PragmaticID HeroesDeathBlowID WindStrikeID
but it keeps giving me the same error and I don’t understand why
Mounted unit problems
I have tried to change the function of the calculation of mounted aid, my idea would simply be to allow a mounted unit to be able to assist any type of unit, except other other mounted units.
to solve my problem I decided to use Pikmin’s “preventRescue” code and to change the calculation of for mounted unit:
In the base game, through No$gba I made this little change:
ORG $18A12 SHORT 0x1840 // change to add
instead of doing (20+[5])-Unit’s costitution) now it adds up and works in the Vanilla game, but obviously not in my buildfile, because I believe that the Skill System is going to change the position of the code so I started looking for the file that made this change, and I found this:
(the path that I have followed: Engine Hacks->Neessary->StatGetters->Aid.event)
to give it a try I made a change 19 to 40
#ifndef MODULAR_GETTER_AID_EVENT #define MODULAR_GETTER_AID_EVENT #include "_Common.event" pAidModifiers: // Aid POIN prAddUnitFinalConstitution prSubstractOne prAdjustAidIfMounted #ifdef DEBUFFS_MIN_ZERO POIN prMinZero #endif WORD 0 prAddUnitFinalConstitution: rAdd(rCallExternal(prConGetter)) prSubstractOne: rSubConst(1) prAdjustAidIfMounted: { rIfUnitHasAttribute(CA_MOUNTEDAID) rCallSequence(_prNegate _prAddBaseMountedAidBonus _prAddMoreIfNotFemale) _prNegate: rMinus(rCurrent) _prAddBaseMountedAidBonus: rAddConst(40) *my change* _prAddMoreIfNotFemale: // Stupid mechanic imo, but we're going vanilla so :shrug: rIfUnitHasNotAttribute(CA_FEMALE, rAddConst(5)) } #endif // MODULAR_GETTER_AID_EVENT
now I finally tested this gearbox, and it seems to solve my problem, but I’d rather add up, and not increase the value, but I can’t understand what should be changed, also because I’m afraid of breaking everything
i think the solution is same inside this file, but i can’t figure out how to do it
My second problem is that also for some strange reason I can’t get the Pikmin code related to the class IDs to work:
ALIGN 4 NewRescueTargetList: #incbin "TryAddUnitToRescueTargetList.dmp" POIN RescuerTable POIN RescueeTable PUSH ORG $25344 GotoNewRescueFunc: #incbin "GotoNewFunc.dmp" POIN NewRescueTargetList + 1 POP ALIGN 4 RescuerTable: #incbin "BlankTable.dmp" ALIGN 4 RescueeTable: #incbin "BlankTable.dmp" #define CannotRescue(unitid) "PUSH; ORG RescuerTable + unitid; BYTE 0x1; POP" #define CannotBeRescued(unitid) "PUSH; ORG RescueeTable + unitid; BYTE 0x1; POP" // Vanilla FE8 Phantoms CannotRescue(0x3B) CannotRescue(0x3E) CannotRescue(0x3F) CannotBeRescued(0x3B) CannotBeRescued(0x3E) CannotBeRescued(0x3F) // my CannotRescue(0x01) CannotRescue(0x02) CannotBeRescued(0x05) CannotBeRescued(0x07)
CannotRescue commands seem to work for me but the commands CannotBeRescued they don’t work…or rather the strange thing, which only sees my first definition
`
CannotBeRescued(0x05)
and not the second, now my perplexity is that there is an ID limit that I can go to put
(0x05 is cavalier class and 0x07 is paladin class)
I think I have correctly made the changes indicated on the post of the relevant code on the class IDs
I don’t understand what he did wrong, because it doesn’t fit in my buildfile than in the Vanilla game someone who uses this code, can help me?
I already feel guilty for making a post on pikmin’s one to report a bug that was not related to its code, for this I prefer to ask it here, and I apologize to Pikmin
Shove like Tellius
Final question, I thought I’d recreate how the “shove” mechanic works like in Tellius’ games my idea was to insert a check in the shove skill code
the check I would like to do at the end would be similar to the one using a unit in the base game to see if it can rescue another unit
with the only change, to change the position of the “constitution” and “Aid”
ie if X has higher costitution than Y aid, then you can use shove in order to do this, I think I just need to find the CanRescue function of a Unit
but I will be dumbbut I would not know where to look, especially due to the fact of the various changes that I would like to make above
so i guess it’s better to get the above thing working first, and then do this?
Sorry for the stupid questions, but I need some help
and thank you very much again for all those who will waste time reading this post, thanks