• Welcome to Final Fantasy Hacktics. Please login or sign up.
 
May 14, 2024, 04:32:14 am

News:

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


Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - stuminator

1
I have a couple formulas I'm working on where simply viewing the attack preview window causes the changes to actually occur, even if you back out before confirming that you want to execute the ability. 

Here is one I'm having an issue with:

00188f90: addiu r29,r29,0xffe8
00188f94: sw r31,0x0010(r29)
00188f98: jal 0x 00185e30 #  Loads SP and X
00188f9c: nop
00188fa0: jal 0x 001885f8 #  Zodiac Calculation
00188fa4: nop
00188fa8: jal 0x 0018659c #  Loads SP + X as X
00188fac: nop
00188fb0: jal 0x 00187510 #  Total Accuracy Check
00188fb4: nop
00188fb8: lui r3,0x8019
00188fbc: lw r2,0x2d90(r3)
00188fc0: nop
00188fc4: lbu r2,0x0000(r2)
00188fc8: nop
00188fcc: beq r2,r0,0x00189038 #  branch if attack fails
00188fd0: nop
00188fd4: jal 0x0002230c #  r3=random number
00188fd8: nop
00188fdc: lui r2,0x8019
00188fe0: ori r5,r0,0x0008 #  r5=8
00188fe4: divu r3,r5 #  divide random number by 8
00188fe8: lw r4,0x2d98(r2) #  load target's data pointer
00188fec: lw r1,0x2d90(r2)
00188ff0: ori r5,r0,0x0001 #  r5=1
00188ff4: mfhi r6 #  r6=remainder (random from 0...7)
00188ff8: lbu r7,0x006d(r4) #  load target's absorb element
00188ffc: lbu r8,0x006e(r4) #  load target's null element
00189000: lbu r9,0x006f(r4) #  load target's halve element
00189004: lbu r10,0x0070(r4) #  load target's weak element
00189008: sllv r6,r5,r6 #  shift 1 left by the remainder
0018900c: xori r11,r6,0xff #  r11=bit flip of r6
00189010: and r7,r7,r11 #  remove element from absorb elements
00189014: and r8,r8,r11 #  remove element from null elements
00189018: and r9,r9,r11 #  remove element from halve elements
0018901c: or r10,r10,r6 #  add element to weak elements
00189020: sb r7,0x006d(r4) #  store new absorb elements
00189024: sb r8,0x006e(r4) #  store new null elements
00189028: sb r9,0x006f(r4) #  store new halve elements
0018902c: sb r10,0x0070(r4) #  store new weak elements
00189030: sb r5,0x0000(r1) #  store as hit?
00189034: sb r5,0x0025(r1) # store as pseudo status?
00189038: lw r31,0x0010(r29)
0018903c: addiu r29,r29,0x0018
00189040: jr r31
00189044: nop

This is basically Edgar's debilitator tool from FFVI, which causes the target to be weak to a random element.  The code begins with a copy/paste of formula 3F (Mustadio's snipe), then most everything from 00188fd4 on down are the element roll and changes.  I'm clearly missing something I need since simply running the attack preview and backing out does make the target weak to a random element.  Also, if you follow through and confirm the attack, it doesn't yield any XP or JP like normal (but does add an additional weakness on top of the attack preview.) 

Anyone know what I'm missing on this?
2
PSX FFT Hacking / stuminator's ASM hacks
October 16, 2021, 04:27:58 pm
Here is a compilation of the hacks I've developed.

<Patch name="Set individual proc rates for weapons and abilities">
  <Description>
    For weapons, set the unknown value to the right of the range from 00-7F to make that the proc rate.  If set from 80-FF, the default proc rate will be used.
    For abilites, check the box between Hit Allies and Follow Target, and the X value will become the proc rate.  Uses default proc rate if unchecked.
    Also includes a support ability to nullify procs, defaulted to Gained XP up, and an ability to double proc rate, defaulted to Train.
  </Description>
    <Location file="BATTLE_BIN" offset="121888">
      1980023C
      FCF5428C
      E8FFBD27
      26004014
      1000BFAF
      64000434
      1980063C
      982DC88C
      942DC98C
      90000891
      91002991
      20000831
      80002931
      25280000
      10000015
      2A480900
      D638C794
      0139C890
      0600E014
      80000A31
      02004015
    </Location>
    <Variable name="Default weapon proc rate" file="BATTLE_BIN" offset="1218DC" default="13"/>
    <Location file="BATTLE_BIN" offset="1218DD">
      000534
      25280800
      41220608
      00000000
      F438C790
      F938C690
      2000E730
      0200E010
    </Location>
    <Variable name="Default ability proc rate" file="BATTLE_BIN" offset="1218FC" default="13"/>
    <Location file="BATTLE_BIN" offset="1218FD">
      000534
      25280600
      3378010C
      04282501
      08004014
      00000000
      1980033C
      902D638C
      00000000
      10006294
      00000000
      00024234
      100062A4
      1000BF8F
      1800BD27
      0800E003
      00000000
    </Location>
<Location file="BATTLE_BIN" offset="1214C8">
      2222060C
    </Location>
    <Location file="BATTLE_BIN" offset="122174">
      A122060C
    </Location>
  </Patch>

To change the support abilities used to something else, change the bolded digits for the proc nullifying ability, and change the underlined digits for the proc doubling ability.

I also placed the code for this ability into the Golem success code, and instead reassigned Golem to use (MA+X)% success rate.  Since Golem is basically 100% anyway unless your faith is under 48 or so, I hope nobody finds this to be an inconvenience if you decide to use this.

There are a few abilities that you won't be able to set a rate for since they already use the X value like Truth/Untruth/Triple Flame/Demi.


<Patch name="Formula 0F = Absorb HP or MP_Y% Hit_F(MA+X)% accepts procs">
    <Description>
      Uses the space for both formulas 0F and 10.  Formula 0F now accepts procs.  HP absorb is the default.  To absorb MP, check any box in the element field.     
    </Description>
    <Location file="BATTLE_BIN" offset="122084">
      E8FFBD27
      1000BFAF
      00000000
      00000000
      6E21060C
      00000000
      1D004014
      00000000
      7322060C
      00000000
      19004014
      19800A3C
      F7384B91
      00000000
      07006015
      00000000
      8919060C
      00000000
      921C060C
      00000000
      3F240608
      00000000
      A319060C
      00000000
      19800A3C
      902D438D
      00000000
      08006494
      1B1D060C
      040062A4
      3021060C
      00000000
      03004014
      00000000
      AD1F060C
      00000000
      1000BF8F
      1800BD27
      0800E003
      00000000
    </Location>
  </Patch>

I slightly changed the Formula 0F code from the one I had in the ASM request thread to not conflict with my Individual proc rate hack.


<Patch name="Formula 3F = Hit (SP+X)%, can require target to have certain status">
  <Description>
    Overwrites the space of the existing 3F and 40 formula routines.  Also adds physical evasion if evadable is checked.
    Allows you to require an already present status on the target as follows:
    Fill in the Y value in FFTPatcher with 88, 89, 90, 91, or 92 depending on which group the status is in, and check the element field in FFTPatcher corresponding to the status's position in the group.
    If you want the ability to work on any target without requiring an existing status, leave Y=0.  Don't use values for Y other than the ones listed here!
    Remember that the existing Seal Evil ability will need to be updated to the new format to work (Formula 3F, Y=88, element=Wind), and don't assign formula 40 to anything.
    Group 88
      0x80
      0x40 Crystal
      0x20 Dead
      0x10 Undead
      0x08 Charging
      0x04 Jump
      0x02 Defending
      0x01 Performing
    Group 89
      0x80 Petrify
      0x40 Invite
      0x20 Darkness
      0x10 Confusion
      0x08 Silence
      0x04 Blood Suck
      0x02 Cursed
      0x01 Treasure
    Group 90
      0x80 Oil
      0x40 Float
      0x20 Reraise
      0x10 Transparent
      0x08 Berserk
      0x04 Chicken
      0x02 Frog
      0x01 Critical
    Group 91
      0x80 Poison
      0x40 Regen
      0x20 Protect
      0x10 Shell
      0x08 Haste
      0x04 Slow
      0x02 Stop
      0x01 Wall
    Group 92
      0x80 Faith
      0x40 Innocent
      0x20 Charm
      0x10 Sleep
      0x08 Don't Move
      0x04 Don't Act
      0x02 Reflect
      0x01 Death Sentence
    Elements:
      0x80 Fire
      0x40 Lightning
      0x20 Ice
      0x10 Wind
      0x08 Earth
      0x04 Water
      0x02 Holy
      0x01 Dark
    For example, to require that the target be in critical, Y=90 and check the Dark element.
  </Description>
    <Location file="BATTLE_BIN" offset="12302C">
      E8FFBD27
      1000BFAF
      4421060C
      00000000
      23004014
      00000000
      8C17060C
      00000000
      7E21060C
      00000000
      6719060C
      00000000
      441D060C
      00000000
      1980023C
      902D428C
      00000000
      00004290
      00000000
      14004010
      00000000
      19800A3C
      982D4B8D
      FA384991
      F7384D91
      0C002011
      00000000
      21086901
      00002590
      00000000
      2418AD00
      00000000
      05006014
      00000000
      C310060C
      00000000
      33280608
      00000000
      C91F060C
      00000000
      1000BF8F
      1800BD27
      0800E003
      00000000
    </Location>
  </Patch>

<Patch name="Monster type check routine">
    <Description>
      This creates a monster type check routine that uses the element fields and Y value to allow any formula calling it to only work on whatever monster types you want.
      Monster types are divided into an element group and Y group as follows:
      Element Group:
        Fire=Eyeball
        Lightning=Ghoul
        Ice=Skeleton
        Wind=Squid
        Earth=Panther
        Water=Bomb
        Holy=Goblin
        Dark=Chocobo
      For this group, simply check the element box if you want the ability to be able to target this monster type.
      Y Group:
        128=Hydra
        64=Dragon
        32=Behemoth
        16=Morbol
        8=Minotaur
        4=Woodman
        2=Pig
        1=Bird
      For this group, add up all the values you want the ability to target, and put the sum into the ability Y value.  These values are in decimal.
    </Description>
    <Location file="BATTLE_BIN" offset="FA180">
      19800A3C
      982D428D
      E8FFBD27
      1000BFAF
      5E014390
      01000434
      13006010
      00000000
      22186400
      0800652C
      0800A010
      00000000
      F7384591
      04186400
      24186500
      0A006010
      00000000
      7C840508
      00000000
      FA384591
      08000634
      22186600
      04186400
      24186500
      03006014
      00000000
      C310060C
      00000000
      1000BF8F
      1800BD27
      0800E003
      00000000
    </Location>
  </Patch>

<Patch name="Dragon formulas use monster type check routine">
    <Description>
      This replaces the Dragon check in abilities 5A,5B,5C,5D with a monster type check allowing you specify the types of monsters these abilities work on.
      Note on formulas 5C and 3B:  In order to work with the monster check routine, this makes the status effect field the SP/PA/MA+ value instead of the Y field.
      Both Scream and Dragon Power Up use the same routine, so remember this adjustment if you plan on using either formula.
    </Description>
    <Location file="BATTLE_BIN" offset="123988">
      6084050C
    </Location>
    <Location file="BATTLE_BIN" offset="1239CC">
      6084050C
    </Location>
    <Location file="BATTLE_BIN" offset="123A18">
      6084050C
    </Location>
    <Location file="BATTLE_BIN" offset="123A5C">
      6084050C
    </Location>
    <Location file="BATTLE_BIN" offset="11FD74">
      FB
    </Location>
  </Patch>


  <Patch name="Dragon formulas affect all monsters, easy version">
  <Description>
    Use in place of the previous two hacks if you just want to make the dragon formulas affect all monsters regardless of monster type.
  </Description>
    <Location file="BATTLE_BIN" offset="1205D4">
      00000000
      00000000
    </Location>
  </Patch>

<Patch name="Immortal units can be knocked back">
    <Location file="BATTLE_BIN" offset="11D428">
      00000000
    </Location>
  </Patch>

<Patch name="Move on Lava = Sidestep">
  <Description>
    Allows units to move through panels occupied by enemy units.
  </Description>
  <Location file="BATTLE_BIN" offset="10D53C">
  20004930
  </Location>
  <Location file="BATTLE_BIN" offset="10D9C8">
  05002015
  </Location>
</Patch>

<Patch name="Any Weather = Sonic Step">
  <Description>You can move and still get the 20 bonus CT for not moving</Description>
  <Location file="BATTLE_BIN" offset="10D774">
02004010
  </Location>
  <Location file="BATTLE_BIN" offset="11CC78">
1980013C
CC082324
21384300
21082200
CD082390
FF000234
1D006210
01000234
8601E290
9400E890
19004010
01000234
3900E690
5C00E390
8701E590
8801E490
02000831
2B280501
08006230
2528A200
04006330
5800E290
25186400
01004230
0200A014
25186200
1400C624
03006014
FFFFC230
1400C624
FFFFC230
3D00422C
02004014
01000234
3C000634
3900E6A0
0800E003
8601E0A0
  </Location>
</Patch>
3
Help! / Changing ASM formula hack to different formula
September 18, 2021, 12:41:58 pm
Hello all,

Been a lurker here for a while and have some questions about hacking.  Is there an (easy) way to take an existing formula hack, and perhaps alter the offset so that it affects a different formula?  For instance, there is this hack made by Emmy below:

<Patch name="Formula 2A - Power Split">
    <Description>Will average PA and MA stats with target.  In the case of odd numbers, difference favors the attacker.  New version - better for general use, and works with Contrary/new Finger Guard code.</Description>
    <Location file="BATTLE_BIN" offset="1229a4">
E8FFBD27
1000BFAF
19800A3C
982D4B8D
942D4C8D
902D4D8D
00000934
36000834
14000734
8C2D4E8D
38000F34
22000F11
00000000
21086801
00002290
21088801
00002390
01000934
0000A9A1
0000C9A1
2500A9A1
2500C9A1
21484300
42480900
23484900
0A002019
00000000
2108A701
000029A0
80002935
2108C701
000029A0
01000825
0100E724
E8FF0010
00000000
23480900
2108C701
000029A0
80002935
2108A701
000029A0
01000825
0100E724
DEFF0010
00000000
1000BF8F
1800BD27
0800E003
00000000
    </Location>
  </Patch>

I'd like to use this in the game, but don't want to overwrite the existing 2A formula, but have it replace, say, formula 27.  How would I go about this?