Modding => Help! => Topic started by: MysticKnightFF5 on January 29, 2012, 08:48:21 pm
Title: Multiple Formula Mods...Can Replace Any Formulas
Post by: MysticKnightFF5 on January 29, 2012, 08:48:21 pm
I'll be honest, I don't care which formulas they replace, as these are the only formulas I intend to use. Though, it would be preferable they stay consecutive in the list.
Dmg_(X+MA) Hit_(Y%) Dmg_(X+MA) Hit_(Y%) 100% Status DmgMP_(X+MA) Hit_(Y%) DmgMP_(X+MA) Hit_(Y%) 100% Status Heal_(X+MA) Hit_(Y%) Heal_(X+MA) Hit_(Y%) 100% Status HealMP_(X+MA) Hit_(Y%) HealMP_(X+MA) Hit_(Y%) 100% Status AbsHP_(X+MA) Hit_(Y%) AbsHP_(X+MA) Hit_(Y%) 100% Status AbsMP_(X+MA) Hit_(Y%) AbsMP_(X+MA) Hit_(Y%) 100% Status Hit_(Y%) EDIT: HealMP_(X) Hit(Y%)
Please keep formula 4B. I know this is a lot to ask for, I'm sorry.
Title: Re: Multiple Formula Mods...Can Replace Any Formulas
Post by: MysticKnightFF5 on March 27, 2012, 11:50:09 am
Bump for help >.>"
Title: Re: Multiple Formula Mods...Can Replace Any Formulas
Post by: Rfh on March 29, 2012, 08:53:12 am
Well, I am now trying to edit the formula Hit_(MA+X)% in to Hit_(X)%. It will help you.
Title: Re: Multiple Formula Mods...Can Replace Any Formulas
Post by: MysticKnightFF5 on March 29, 2012, 12:21:52 pm
Yay!
Title: Re: Multiple Formula Mods...Can Replace Any Formulas
Post by: Glain on March 29, 2012, 03:42:02 pm
These are actually too vague to implement. For each one, you'd have to specify things like:
1. Is the ability affected by elemental? a. The weapon's, or the ability's? b. If so, can the ability be strengthened?
2. What kind of evasion? Physical/magical?
3. What damage type (Physical/magical)? i.e.: a. Is it affected by Attack UP, Defense UP, etc (physical)? b. Is it affected by Magic Attack UP, etc (magical)?
4. Can it status proc? (For non-100% status; I'd assume yes since you didn't specify NS)
Unfortunately all this stuff has to be done on a per-formula basis.
Is Hit_(Y)% a 100% Status deal? What does it do, if not? Also, out of curiosity, why use X as the damage modifier and Y as the hit modifier? Isn't it usually the other way around?
Title: Re: Multiple Formula Mods...Can Replace Any Formulas
Post by: MysticKnightFF5 on March 29, 2012, 11:54:33 pm
1) Yes. It does get affected negatively and positively for all damage formulas.
2) Accuracy is the Y value in every formula. The unit's evasion affects nothing.
3) There is no Atk Up or MAtk Up, so physical/magical is moot.
4) Yes.
5) Yes, and it's already made, I know.
6) If they feel like switching that, they can, but it just feels more appropriate to me.
Title: Re: Multiple Formula Mods...Can Replace Any Formulas
Post by: Rfh on March 30, 2012, 10:16:09 am
Well, my first hack is very simple. I removed Store MA and and store MA as X for all formulas that their accuaracy is Hit (MA+X)%. Therefore, the formula is Hit (1+X)%:
<Patch name=" All formulas that their accuaracy is Hit (MA+X)% become Hit (1+X)%"> <Description>Affect formulas 0B,0D,0E,12,29,2A,4D,4F,50,51 and 58</Description> <Location file="BATTLE_BIN" offset="11ED90"> 00 </Location> <Location file="BATTLE_BIN" offset="11EDA0"> 0000 </Location> </Patch>
Title: Re: Multiple Formula Mods...Can Replace Any Formulas
Post by: Glain on March 31, 2012, 07:29:44 pm
So, I started to get interested in the ASM for this, and then before I knew it, I was going through the whole thing... so after quite a bit of coding/testing/etc, this patch should pretty much do it! ASM: Once you pop, you can't stop? I don't know!
This should replace formulas [21] through [2e] in the order you listed.
I did all my testing in pSX, and got through the final testing with everything seemingly working and without the console window complaining at all, which I find usually means things are right. I didn't explicitly test in ePSXe but it should obviously work there.
addiu r29,r29,-0x18 sw r31,0x10(r29) jal 0x1884c0 # Status proc roll (19%) nop bne r2,r0,(RETURN) # If roll succeeds... nop jal 0x187eb4 # Apply status nop (RETURN): lw r31,0x10(r29) addiu r29,r29,0x18 jr r31 nop
B. Create Modifier + X subroutine - return value (Modifier=MA when r7=0, 0 otherwise)
[0x152070] > [0xeb070]
addiu r29,r29,-0x18 sw r31,0x10(r29) lui r8,0x8019 lw r9,0x2d94(r8) # Load Actor lbu r10,0x38f9(r8) # Load Ability X
bne r7,r0,(PAST_MA_LOAD) # Set Modifier = 0 ori r11,r0,0 lbu r11,0x0037(r9) # Modifier = Actor MA, if r7 is not 0 nop
(PAST_MA_LOAD): addu r2,r11,r10 sh r2,0x38ce(r8) # Save Modifier + X jal 0x185ffc # Elemental Strengthen (Ability) nop lui r2,0x8019 lhu r2,0x38ce(r2) # Load result and return it lw r31,0x10(r29) addiu r29,r29,0x18 jr r31 nop
C. Hit (Y%) subroutine - set and return hit status
[0x1520e0] > [0xeb0e0]
addiu r29,r29,-0x18 sw r31,0x10(r29) lui r8,0x8019 lbu r5,0x38fa(r8) # Load Ability Y lw r10,0x2d90(r8) nop sb r5,0x002a(r10) # Save [Hit %] = Y jal 0x5e0cc # Roll (0-99) with threshold = Y (Y% under) ori r4,r0,100 lui r8,0x8019 lw r9,0x2d90(r8) sltiu r2,r2,1 # result = 1 if roll was under threshold (success), otherwise 0 sb r2,0x0000(r9) # Save result
bne r2,r0,(RETURN) # If missed, set action's evade type to Miss nop addiu r4,r0,6 sb r4,0x0002(r9)
(RETURN): lw r31,0x10(r29) addiu r29,r29,0x18 jr r31 # Return result nop
D. Subroutine to Zero out r4,r5,r6,r7,r15,r24 with call
[0x18b964] > [0x124964]
jal 0x152150 nop
[0x152150] > [0xeb150]
lui r1,0x8019 addu r1,r1,r2 addu r4,r0,r0 addu r5,r0,r0 addu r6,r0,r0 addu r7,r0,r0 addu r15,r0,r0 jr r31 addu r24,r0,r0
E. Create meta-routine (template): r4 = Location to save; r5 = 100% Status? r6 = Do Drain; r7 = Don't use MA; r15 = Action Type; r24 = Drain Action Type
sh r11,0x0006(r10) # Drain Action HP Healing = Action HP Damage sh r12,0x0004(r10) # Drain Action HP Damage = Action HP Healing sh r13,0x000a(r10) # Drain Action MP Healing = Action MP Damage sh r14,0x0008(r10) # Drain Action MP Damage = Action MP Healing ori r11,r0,1 sb r11,0x0000(r10) # Set Drain Action to Hit sb r21,0x0025(r10) # Set Drain Action Type
(PAST_DRAIN): bne r17,r0,(GUARANTEE_STATUS) # If ([Saved r5] != 0) nop
Title: Re: Multiple Formula Mods...Can Replace Any Formulas
Post by: Pride on March 31, 2012, 08:04:44 pm
Doesn't really matter but you could have repointed the formulas then using a jump. Works just the same though.
http://ffhacktics.com/wiki/Formula_Table
Title: Re: Multiple Formula Mods...Can Replace Any Formulas
Post by: Pickle Girl Fanboy on March 31, 2012, 08:28:45 pm
Are the addresses listed RAM or something else?
Title: Re: Multiple Formula Mods...Can Replace Any Formulas
Post by: Glain on March 31, 2012, 08:57:08 pm
Heh, at first I was trying to make sense of the ASM in the formula table, then realized it was just data. I knew about the offset table (though I wasn't sure where it was at first), but I didn't see the need to reroute anything.
One thing that I forgot was that [38] doesn't even have a formula at all; it just wires itself directly to the apply status routine. If you try to change [38], you actually change that. Gah. (Mainly why I ended up doing [21] - [2e] instead of [31] - [3e]).
Yeah, those are RAM addresses. BATTLE.BIN is -0x67000.
Title: Re: Multiple Formula Mods...Can Replace Any Formulas
Post by: MysticKnightFF5 on April 01, 2012, 12:12:40 am
Quote from: Glain on March 31, 2012, 07:29:44 pm So, I started to get interested in the ASM for this, and then before I knew it, I was going through the whole thing... so after quite a bit of coding/testing/etc, this patch should pretty much do it! ASM: Once you pop, you can't stop? I don't know!
This should replace formulas [21] through [2e] in the order you listed.
I did all my testing in pSX, and got through the final testing with everything seemingly working and without the console window complaining at all, which I find usually means things are right. I didn't explicitly test in ePSXe but it should obviously work there.
addiu r29,r29,-0x18 sw r31,0x10(r29) jal 0x1884c0 # Status proc roll (19%) nop bne r2,r0,(RETURN) # If roll succeeds... nop jal 0x187eb4 # Apply status nop (RETURN): lw r31,0x10(r29) addiu r29,r29,0x18 jr r31 nop
B. Create Modifier + X subroutine - return value (Modifier=MA when r7=0, 0 otherwise)
[0x152070] > [0xeb070]
addiu r29,r29,-0x18 sw r31,0x10(r29) lui r8,0x8019 lw r9,0x2d94(r8) # Load Actor lbu r10,0x38f9(r8) # Load Ability X
bne r7,r0,(PAST_MA_LOAD) # Set Modifier = 0 ori r11,r0,0 lbu r11,0x0037(r9) # Modifier = Actor MA, if r7 is not 0 nop
(PAST_MA_LOAD): addu r2,r11,r10 sh r2,0x38ce(r8) # Save Modifier + X jal 0x185ffc # Elemental Strengthen (Ability) nop lui r2,0x8019 lhu r2,0x38ce(r2) # Load result and return it lw r31,0x10(r29) addiu r29,r29,0x18 jr r31 nop
C. Hit (Y%) subroutine - set and return hit status
[0x1520e0] > [0xeb0e0]
addiu r29,r29,-0x18 sw r31,0x10(r29) lui r8,0x8019 lbu r5,0x38fa(r8) # Load Ability Y lw r10,0x2d90(r8) nop sb r5,0x002a(r10) # Save [Hit %] = Y jal 0x5e0cc # Roll (0-99) with threshold = Y (Y% under) ori r4,r0,100 lui r8,0x8019 lw r9,0x2d90(r8) sltiu r2,r2,1 # result = 1 if roll was under threshold (success), otherwise 0 sb r2,0x0000(r9) # Save result
bne r2,r0,(RETURN) # If missed, set action's evade type to Miss nop addiu r4,r0,6 sb r4,0x0002(r9)
(RETURN): lw r31,0x10(r29) addiu r29,r29,0x18 jr r31 # Return result nop
D. Subroutine to Zero out r4,r5,r6,r7,r15,r24 with call
[0x18b964] > [0x124964]
jal 0x152150 nop
[0x152150] > [0xeb150]
lui r1,0x8019 addu r1,r1,r2 addu r4,r0,r0 addu r5,r0,r0 addu r6,r0,r0 addu r7,r0,r0 addu r15,r0,r0 jr r31 addu r24,r0,r0
E. Create meta-routine (template): r4 = Location to save; r5 = 100% Status? r6 = Do Drain; r7 = Don't use MA; r15 = Action Type; r24 = Drain Action Type
sh r11,0x0006(r10) # Drain Action HP Healing = Action HP Damage sh r12,0x0004(r10) # Drain Action HP Damage = Action HP Healing sh r13,0x000a(r10) # Drain Action MP Healing = Action MP Damage sh r14,0x0008(r10) # Drain Action MP Damage = Action MP Healing ori r11,r0,1 sb r11,0x0000(r10) # Set Drain Action to Hit sb r21,0x0025(r10) # Set Drain Action Type
(PAST_DRAIN): bne r17,r0,(GUARANTEE_STATUS) # If ([Saved r5] != 0) nop