🌱
The Insurgent's Forge
  • Home
  • Getting Started
    • Setup
    • Resources
  • Overview
    • Configuration
      • Formulas
      • Functions
      • Classes
      • Helpers
      • Assemblies
      • Middlewares
      • Dependencies
      • Options
      • Errors
    • Improvements & Additions
    • Structures & Parameters
    • Formula Workflow
      • Combo
      • Counter
      • Area of Effect
      • Reserve Party Member
      • Reflect
      • Mist
      • Trap
      • Chain Benefit
      • Summon
      • Spawn
      • Gambit
    • Limitations
      • Animations
      • Status Effects & Augments
    • Notes
      • Flags
      • Loops
      • Function in a Function
    • Helpers
      • Add Augment
      • Add Status Effect
      • Apply Knockback
      • Get Active Party Member
      • Get Action Status Effects
      • Get Augment Duration
      • Get Battle Unit Keep
      • Get Battle Unit Keep By Focus
      • Get Battle Unit Work
      • Get Character Max Hp
      • Get Character Max Mp
      • Get Character Type
      • Get Elemental Affinities Match
      • Get Equipment Status Effects
      • Get Forced Poach Rarity
      • Get Forced Steal Rarity
      • Get Formula Proc Keep
      • Get Knockback Range
      • Get Location Mist Strength
      • Get Model Evade Types
      • Get One Hit Kill State
      • Get Random Number
      • Get Reflect Target
      • Get Remedy Status Effects
      • Get Status Effect Duration
      • Get Status Effect Tick Duration
      • Get Status Effects Match
      • Get Terrain Type
      • Get Weather
      • Is Interactable
      • Modify Content
      • Modify Gil
      • Modify Hp
      • Modify Mist Charges
      • Modify Mp
      • Modify Sky Pirates Den Stats
      • Refresh Stats
      • Remove Augment
      • Remove Status Effect
      • Set Level
      • Shift Elements
      • Show Combat Log
      • Show Number Text
      • Teleport Location
  • Support & Updates
    • Changelogs
      • Version 1.0.3
      • Version 1.0.2
      • Version 1.0.1
      • Version 1.0.0
    • Known Issues
    • FAQ
Powered by GitBook
On this page
  • Description
  • Example
  • Concerns
  1. Overview
  2. Formula Workflow

Gambit

Description

HP / MP gambits use formula functions to determine whether a party member's currently active gambit should be interrupted by one with higher priority based on if the related action is intended to be beneficial to the target. If it is, a party member won't bother to interrupt their action to restore the target's HP or MP if another character already plans to do it. Priority is based on a party member's identifier (lower first).

This only applies to actions that have the Is Positive and Can Restore HP or Can Restore MP flags enabled in Battlepack Section 14.

Example

You can examine these checks by disabling the mod and doing the following:

  1. Set Battle Mode to Wait.

  2. Set the active party to Vaan and Ashe.

  3. Delete all of their gambits.

  4. Give Ashe the gambit Ally: HP < 100% -> Cure.

  5. Turn Vaan's and Ashe's gambits off.

  6. Attack Vaan until he has less than 100% HP.

  7. Cast Cure with Vaan, targeting himself.

  8. Enable Ashe's gambits before Vaan finishes casting.

Now the Cure formula's OnHit middleware functions will be executed to check if Vaan will be able to fully heal himself. If he will not be, Ashe will also cast Cure on him. Otherwise, she won't.

Concerns

These checks are executed on every frame (e.g. 60 times per second). Normally, this wouldn't be an issue, but since formulas are now executed with Lua, which is significantly slower than assembly, they can impact performance. Frame spikes become more likely when many party members have HP / MP gambits, and the game runs faster, either due to higher FPS or the speed mode multiplier. Since this will eventually lead to performance issues, formula executions with gambits have been disabled. As a result, it will be possible to overheal with gambits. To workaround this issue, you can limit the amount of healing gambits to one party member in the active party.

PreviousSpawnNextLimitations

Last updated 3 months ago