🌱
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
  • Assignment
  • Layout
  • Notes
  1. Overview
  2. Configuration

Formulas

Description

The formulas.lua file specifies which formulas contain which functions and in what order they are executed. Generally, every formula consists of 1 or more functions.

Formula functions are split into 2 groups: OnCast and OnHit.

OnCast functions are executed when the action is cast, so once the charge bar is full. They usually calculate the chance for the action to miss, being reflected, the target countering it, being immune to it, etc.

OnHit functions are executed once the action (visually) hits the target. They usually calculate the damage the target should receive, what status effect they should get, etc.

Assignment

Functions are assigned to a group based on their goal.

For example, if an action heals the target, its formula should first check if the target can even be hit before actually modifying their hp. The former check is usually done via an OnCast function while the latter is done via an OnHit function.

So OnCast functions are usually used for smaller tasks and help with the processing of OnHit functions.

Layout

local onCastFormulas = {
  --more functions
  [30] = {16, 6}
}

local onHitFormulas = {
  --more functions
  [30] = {65, 103}
}

return onCastFormulas, onHitFormulas

Every table entry uses a formula identifier (e.g. 30) as the key and a table of formula functions (e.g. {16, 6}) as the value.

Notes

There can only be a maximum of 256 (0 -> 255) formulas.

Formula 0 is used to indicate that an action or equipment has no formula. Therefore it should not be assigned any function identifiers, as they are ignored anyway.

If an action (e.g. Attack) uses formula 0, the formula of the equipment (e.g. Broadsword) will be used instead. If that is also 0, the formula processing will be skipped.

Generally, if the formula of an action has no functions, it does absolutely nothing. However, they are a few actions in the game whose task is hardcoded into the executable (e.g. Shades of Black). The reason for that is because the actual task of Shades of Black is to transform into another action whose formula is then processed. So there is no point in assigning functions to the formula of Shades of Black as they will never be executed anyway.

PreviousConfigurationNextFunctions

Last updated 11 months ago