• Welcome to Final Fantasy Hacktics. Please login or sign up.
 
April 19, 2024, 02:05:33 am

News:

Use of ePSXe before 2.0 is highly discouraged. Mednafen, RetroArch, and Duckstation are recommended for playing/testing, pSX is recommended for debugging.


Reactions Rewritten: Modder Friendly Tool

Started by Talcall, March 05, 2023, 05:33:45 am

Talcall

March 05, 2023, 05:33:45 am Last Edit: December 29, 2023, 10:33:37 pm by Talcall Reason: erroneous file
Good news guys! I got a second post this month! :mrgreen:
I am publicly announcing that I am releasing my new tool for any modder to use!
Because Frankly reactions suck to modify. It was legitimately less effort to just make a tool than to tweak every instance of everything.
And now for you it will be easier to just use the tool I already made!
Handy!
*It bears noting that this may not work with duckstation, but I also can't debug duckstation so I'm not fixing it.

This tool ships out with settings about as generic as I could swing them; everything should behave exactly and only how it behaves in vanilla, minus some edge cases.
(I think I accidentally include some QOL, take note of any units not dying at 0hp unless damage is dealt, or golem damage overflowing into unit damage)
Except the following, intentional changes:
      1. Any reaction using the distribute formula may trigger if the unit heals themselves
      2. Any geomancy skill flagged with the AI flag "Target allies" will target the unit reacting, if they are attacked
      3. Auto Item receives an upgrade that should save you a few X-potions, and also can handle status recovery & MP recovery
            ^- for information regarding *how* to set up auto potion properly, read below, and if you still don't understand, please ask me :)
      4. MP switch overflows into HP damage
      5. Blade grasp will now only trigger for attacks that use a knife, sword, knight sword, katana, ninjato, or axe; chance to trigger remains br%
      6. I make it even harder to manipulate reflect, this is for your own good


I heavily encourage exploration, and everything is explained in the xml description and excel sheet in appropriate cells, however I will also provide an in depth description of everything here, plus visual examples because text be damned, it's easier to know what you're looking for when you know what it looks like.

Should be enabled for reactions that are intended to trigger even if an attack misses. Problems may arise if the reaction depends on HP/MP damage being finalised for its calculation (for example, via golem), or if the reaction depends on stats/statuses being finalised (for example, critical for being in low HP, or if stats are increased past their maximum/minimum and the reaction shouldn't trigger.)

Should be enabled for reactions that are intended to trigger only IF an attack lands; also important for reactions that depend on HP/MP changes being finalised. may cause issues for statuses that require critical/stat changes to be finalised.

Should be enabled for reactions handled after everything about an attack has been completely finalised. Important for reactions that require critical, or increase stats.
These should be considered mutually exclusive.

Determines whether a reaction rolls Brave% (N) or Faith% (Y). No vanilla reaction rolls faith%.

Determines whether a reaction has a higher chance of triggering the Lower your selected stat. No vanilla reaction rolls Low%

Denotes special case reactions; unless you plan on changing the code here, these abilities should be left untouched.

etermines the target of the reaction, the unit with the reaction (N), or the instigator of the attack (Y).

etermines if a reaction uses another ability for its execution, like counter tackle.
NOTE: Meatbone slash, counter flood, counter magic, and auto potion, despite triggering other abilities, should not have this flag checked. This is because their formulas handle selecting the ability in this case.

correlates with the counterflood flag used for abilities in the FFTPatcher; this determines for what abilities this reaction can trigger for after all other conditions are met.

correlates with the Counter magic flag used for abilities in the FFTPatcher; Ditto.

Determines whether the skillset of the reacting attack targets Without selecting an ability (for example, geomancy does not have an ability menu, therefore counter flood is a skillset-targetting reaction)
NOTE: Counter tackle needs this value set to (Y) so it correctly calculates whether it can/cannot hit targets adjacent to itself.

correlates with the countergrasp flag used for abilities in the FFTPatcher; same notes as Counterflood and countermagic.

Only takes effect if the reaction is also flagged Pre-attack: if Y, cancels the original attack from executing.

Determines if the critical status is required for a reaction to trigger.

Determines if the reaction requires the original ability have an MP cost (Important for Absorb used MP)

Determines if the reaction triggers before an attack, like Hamedo.


So You Want Auto Potion to Work?
Well, uh, obviously.

For Auto Potion to trigger, items must be manually set up as well:

To cure HP, go to the top right hand corner of fftpatcher:

tick the marked box, and then set the marked number to 80.
NOTE: auto potion will attempt to use any potion that cures the unit's HP Closest to their maximum HP. for example, a unit that takes 80 damage, will prefer to use an available hi-potion over any available X-potions, because curing 70 HP gets closer to their maximum HP (10 underheal) than healing 150 (70 overheal). 10 < 70.

To cure MP, go again to the top right hand corner:

tick the marked box, and then set the marked number to 20.
NOTE: auto potion will attempt to use any ether that cures the unit's MP Closest to their maximum MP. for example, a unit that takes 60 MP damage, will prefer to use an available ether over any available turbo ethers, because curing 50 HP gets closer to their maximum MP (10 underheal) than healing 100 (40 overheal). 10 < 40. Additionally, the same comparison is done alongside HP curing, but only if a unit takes both HP and MP damage, Otherwise they remain separate: This prevents a unit taking HP damage from recovering MP, but will use the most effective item if it takes damage to both pools.

To cure statuses, top right hand corner:

and then just set the marked number to 08. This will attempt to cure any inflicted statuses using the item's inflict status.
NOTE: auto potion will use the first marked status item that successfully cures any status inflicted by the Last Attack. If you have any items that add statuses, or cure positive statuses, leave them unmarked, and order your items properly if there are any double-ups. A unit will also not attempt to cure any statuses it had before the attack occurred.

Additional notes:
Flagging auto potion with pre-attack will automatically cause it to use the item in slot F7. I personally can't see a use in an item that attempts to cure damage/statuses before they happen, unless preempting with an item that grants protective buffs. Use this information accordingly.

Congratulations, Auto Item should now successfully and intelligently trigger! if you don't want any HP, MP, or status curing, simply leave the appropriate values unchanged.
  • Modding version: PSX & WotL
""The only thing more hardcoded than FFT, is more FFT."
    - A wise man"
       - Talcall
  • Discord username: Talcall

Talcall

To anyone using excel 2007,
I've made an update to the excel sheet attached to this reply, and updated the one in the original forum post that should work for that version of excel.
Happy modding!
  • Modding version: PSX & WotL
""The only thing more hardcoded than FFT, is more FFT."
    - A wise man"
       - Talcall
  • Discord username: Talcall

Talcall

Another quick update, turns out the xml file was bugged (had leftover code from its source that I couldn't identify... while the source was in the same folder.)
this has been addressed and fixed. thank you and apologies
  • Modding version: PSX & WotL
""The only thing more hardcoded than FFT, is more FFT."
    - A wise man"
       - Talcall
  • Discord username: Talcall