• Welcome to Final Fantasy Hacktics. Please login or sign up.
 
March 19, 2024, 06:23:15 am

News:

Please use .png instead of .bmp when uploading unfinished sprites to the forum!


Formula 2D gain elemental

Started by Rfh, January 14, 2012, 10:24:52 am

Rfh

An ASM that make formula 2D Dmg_(PA*(WP+Y)) 100% Status gain elemental?
Excuse me, I'm a bit tedious.
  • Modding version: PSX
  • Discord username: rfh

formerdeathcorps

That's what Zodiac's Weapon Strike Fix does.  If you flag the blank flag under Hit Alllies, it'll take the only the element of the ability.  Or alternatively, on my version of that hack, if you unflag Weapon Strike, it'll only take the element of the ability.
The destruction of the will is the rape of the mind.
The dogmas of every era are nothing but the fantasies of those in power; their dreams are our waking nightmares.

Rfh

Quote from: formerdeathcorps on January 14, 2012, 12:14:22 pm
That's what Zodiac's Weapon Strike Fix does.  If you flag the blank flag under Hit Alllies, it'll take the only the element of the ability.  Or alternatively, on my version of that hack, if you unflag Weapon Strike, it'll only take the element of the ability.

Thanks, but... the elemental damage of these abilities with formula 2D aren't strengthen by an item attribute, and the hack override concentration bonus. Is possible that can strengthen the elemental damage? For example, Excalibur (strengthen holy) should strengthen Stasis Sword (holy elemental)
  • Modding version: PSX
  • Discord username: rfh

Glain

January 14, 2012, 02:00:37 pm #3 Last Edit: January 15, 2012, 10:56:52 am by Glain
I just coincidentally did a hack that I've been testing that was essentially a rewrite of [2d], [2f], and [30], mainly to give the Dark/Night Sword abilities the same properties as Holy Sword (allow elemental, strengthen, status proc, etc), but one of the changes was also to allow elemental strengthening even if it's on the ability and not the weapon. It should work with the flag under Hit Allies that fdc mentioned.

If you have a patch changing these formulas already, it could overwrite something.

(Edited patch out due to newer version below)
  • Modding version: Other/Unknown

formerdeathcorps

January 14, 2012, 02:39:36 pm #4 Last Edit: January 14, 2012, 02:47:57 pm by formerdeathcorps
Ideally, Glain, you want to strengthen both weapon and ability element.


00189b20: 27bdffe8 addiu r29,r29,0xffe8
00189b24: afbf0010 sw r31,0x0010(r29)
00189b28: 0c062144 jal 0x00188510       Physical Evade Calculation
00189b2c: 00000000 nop
00189b30: 14400014 bne r2,r0,0x00189b84
00189b34: 00000000 nop
00189b38: 0c061797 jal 0x00185e5c       Load WP + Y as Y
00189b3c: 00000000 nop
00189b40: 0c0617e9 jal 0x00185fa4       Element Strengthen Calculation
00189b44: 00000000 nop
00189b48: 0c0621a9 jal 0x001886a4       Physical Damage Calculation
00189b4c: 00000000 nop
00189b50: 0c061bf4 jal 0x00186fd0       Weapon Elemental = Swordskill Routine (FIXED BY ZODIAC)
00189b54: 00000000 nop
00189b58: 3c028019 lui r2,0x8019
00189b5c: 8c422d90 lw r2,0x2d90(r2)
00189b60: 00000000 nop
00189b64: 90420000 lbu r2,0x0000(r2)
00189b68: 00000000 nop
00189b6c: 10400005 beq r2,r0,0x00189b84
00189b70: 00000000 nop
00189b74: 0c061c3f jal 0x001870fc       Elemental Absorption
00189b78: 00000000 nop
00189b7c: 0c061fad jal 0x00187eb4       Status Proc
00189b80: 00000000 nop
00189b84: 8fbf0010 lw r31,0x0010(r29)
00189b88: 27bd0018 addiu r29,r29,0x0018
00189b8c: 03e00008 jr r31
00189b90: 00000000 nop


This is the ASM for formula 2D.  However, what Rfh says still doesn't make sense.  Zodiac's routine fixes only the elemental routine.  This routine is after the evasion routine.  There is no reason why the support skill Concentrate would fail unless the flag under Hit Allies is what's responsible (which I see no reference to in any of the evasion routines).  Are you sure it's not from one of your other patches?
The destruction of the will is the rape of the mind.
The dogmas of every era are nothing but the fantasies of those in power; their dreams are our waking nightmares.

Glain

Yes, it should be strengthening both with the patch.

In the old hack, the strengthen routine is called (on the current elements, which consists of just the weapon element), then the new element (based on the ability itself) is figured out; I switched the order, so that the new elements are figured out first, then it calls the strengthen routine using those elements.

And yes, I have no idea how that could possibly affect Concentrate. I didn't even notice that the first time I read the post.
  • Modding version: Other/Unknown

RavenOfRazgriz

Quote from: Glain on January 14, 2012, 04:11:22 pm
Yes, it should be strengthening both with the patch.

In the old hack, the strengthen routine is called (on the current elements, which consists of just the weapon element), then the new element (based on the ability itself) is figured out; I switched the order, so that the new elements are figured out first, then it calls the strengthen routine using those elements.

And yes, I have no idea how that could possibly affect Concentrate. I didn't even notice that the first time I read the post.


Tl;dr it all works as intended?  I have no clue what the flag under Hits Allies discussion is about, I never knew about that before, but I assume that means flagging it causes it to ignore Weapon Element even if Weapon Strike is flagged?

This is actually 90% of a hack I asked FDC to do for me... want to save him work and do the other 10%?  Haha.

formerdeathcorps

Quote from: RavenOfRazgriz on January 14, 2012, 05:30:56 pm
I have no clue what the flag under Hits Allies discussion is about, I never knew about that before, but I assume that means flagging it causes it to ignore Weapon Element even if Weapon Strike is flagged?


You assume right, but part of this confusion can be attributed to Zodiac when he wrote the hack.
He assumed that his hack would affect the elemental of every formula.  However, the routine he jumped from only affected HOLY SWORD.  Recall that the popular demand was to take the element of the ability.  After the hack was released, it satisfied this demand because weapon element + ability element for most patches at the time (vanilla remakes) would be ability element (since most weapons don't have elements).  Since it also didn't affect any other formulas, no one bothered to bug-check this or fully read Zodiac's description which said that if you flagged the "unused flag" under Hit Allies, you will take only ability element.

Alas, things don't work entirely as expected.  When I was going over flag consolidation for the formula hack, I found that the "unused flag" is actually used in determining where a unit can target.  Thus, it would probably be best to move it away from there and simply do weapon strike = ability + weapon elemental and no weapon strike = ability elemental.  From there, you can easily cover all three cases:
1) Ability element = Unflag Weapon Strike
2) Ability + Weapon element = Flag Weapon Strike
3) Weapon element = Flag Weapon Strike on a non-elemental ability

The only significant loss is to the weapon swinging animation in Case 1), but let's make sure that "unused flag" doesn't actually affect anything.
The destruction of the will is the rape of the mind.
The dogmas of every era are nothing but the fantasies of those in power; their dreams are our waking nightmares.

RavenOfRazgriz

Losing the weapon swing is a significant loss though.  It makes your patch look like shit if you need that function.  I can actually see use for the first situation where a Weapon Strike is required.  Are there any other empty flags that the Ability Element override thing could be moved to?

I know once you finish the Formula Hack, none of this should be an issue, but for now, having all three functions working properly would be nice since the code for an "override" flag already exists, and we just need to find a flag that isn't being used for it to work correctly.

Rfh

Mmm, I've tested in clean ISO with your patch and elements doesn't strengthen. Am I doing something wrong?
  • Modding version: PSX
  • Discord username: rfh

Glain

Hmm... it seems I had the order of a few things wrong. Try this one:


 <Patch name="Swordskill element strengthen and Dark/Night Sword elemental">
   <Description>
     Swordskill element fix - like previous fixes, but with Dark/Night sword elemental, using (WP+Y) and can status proc like Holy Sword can; Also, elements should strengthen even if they're not on the weapon.
   </Description>
   <Location file="BATTLE_BIN" offset="F5C00">
     E8FFBD27
     1000BFAF
     0C00B0AF
     21808000
     4421060C
     00000000
     2E004014
     00000000
     9717060C
     00000000
     1980083C
     F7380481
     04390581
     F4380681
     2000C630
     0200C01C
     00000000
     25208500
     043904A1
     E917060C
     00000000
     A921060C
     00000000
     1980043C
     0439848C
     00000000
     A613060C
     00000000
     1980023C
     902D428C
     00000000
     00004290
     00000000
     03004010
     00000000
     3F1C060C
     00000000
     0D000012
     00000000
     02000824
     08000812
     00000000
     921C060C
     00000000
     81000834
     07004814
     00000000
     33730508
     00000000
     1B1D060C
     00000000
     AD1F060C
     00000000
     1000BF8F
     0C00B08F
     1800BD27
     0800E003
     00000000
   </Location>
   <Location file="BATTLE_BIN" offset="12026C">   
     00000000
   </Location>
   <Location file="BATTLE_BIN" offset="1202E0">
     00000000
   </Location>
   <Location file="BATTLE_BIN" offset="12048C">
     00000000
   </Location>
   <Location file="BATTLE_BIN" offset="122B20">
     00730508
     00000424
   </Location>
   <Location file="BATTLE_BIN" offset="122C90">
     00730508
     01000424
   </Location>
   <Location file="BATTLE_BIN" offset="122C50">
     00730508
     02000424
   </Location>
   <Location file="BATTLE_BIN" offset="120338">
     81000234
   </Location>
 </Patch>
  • Modding version: Other/Unknown

Rfh

Quote from: Glain on January 15, 2012, 10:56:18 am
Hmm... it seems I had the order of a few things wrong. Try this one:


 <Patch name="Swordskill element strengthen and Dark/Night Sword elemental">
   <Description>
     Swordskill element fix - like previous fixes, but with Dark/Night sword elemental, using (WP+Y) and can status proc like Holy Sword can; Also, elements should strengthen even if they're not on the weapon.
   </Description>
   <Location file="BATTLE_BIN" offset="F5C00">
     E8FFBD27
     1000BFAF
     0C00B0AF
     21808000
     4421060C
     00000000
     2E004014
     00000000
     9717060C
     00000000
     1980083C
     F7380481
     04390581
     F4380681
     2000C630
     0200C01C
     00000000
     25208500
     043904A1
     E917060C
     00000000
     A921060C
     00000000
     1980043C
     0439848C
     00000000
     A613060C
     00000000
     1980023C
     902D428C
     00000000
     00004290
     00000000
     03004010
     00000000
     3F1C060C
     00000000
     0D000012
     00000000
     02000824
     08000812
     00000000
     921C060C
     00000000
     81000834
     07004814
     00000000
     33730508
     00000000
     1B1D060C
     00000000
     AD1F060C
     00000000
     1000BF8F
     0C00B08F
     1800BD27
     0800E003
     00000000
   </Location>
   <Location file="BATTLE_BIN" offset="12026C">   
     00000000
   </Location>
   <Location file="BATTLE_BIN" offset="1202E0">
     00000000
   </Location>
   <Location file="BATTLE_BIN" offset="12048C">
     00000000
   </Location>
   <Location file="BATTLE_BIN" offset="122B20">
     00730508
     00000424
   </Location>
   <Location file="BATTLE_BIN" offset="122C90">
     00730508
     01000424
   </Location>
   <Location file="BATTLE_BIN" offset="122C50">
     00730508
     02000424
   </Location>
   <Location file="BATTLE_BIN" offset="120338">
     81000234
   </Location>
 </Patch>



Great job, the patch works good. Thanks
  • Modding version: PSX
  • Discord username: rfh