> For the complete documentation index, see [llms.txt](https://xeavin.gitbook.io/the-insurgents-learnable-foecraft/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://xeavin.gitbook.io/the-insurgents-learnable-foecraft/overview/configuration.md).

# Configuration

### General

All configurable parameters are defined in the `{game}/x64/scripts/config/TheInsurgentsLearnableFoecraftConfig.lua` file.

This configuration file can be modified via any text editor.

### Layout

```lua
local function config(statusEffects, augments, foes, actions, contents)
  local statusEffectIds = {
    statusEffectId0,
    statusEffectId1,
    ...
  }

  local dialogId = dialogId
  local augmentId = augmentId
  local soundEffectId = soundEffectId
  local learnables = {
    {
      foeId,
      {actionId0, contentId0, chance0},
      {actionId1, contentId1, chance1},
      ...
    },
    ...
  }

  return statusEffectIds, dialogId, augmentId, soundEffectId, learnables
end

return config
```

### Parameters

The following lists all configurable parameters and their purposes:

#### `config`

A function that returns all configurable parameters.

It is called with the following arguments:

<table><thead><tr><th width="149.99993896484375">Name</th><th width="351.00006103515625">Description</th><th>Example</th></tr></thead><tbody><tr><td><code>statusEffects</code></td><td>A metatable that maps status effect names to numeric identifiers and vice versa.</td><td><code>statusEffects.ko</code></td></tr><tr><td><code>augments</code></td><td>A metatable that maps augment names to numeric identifiers and vice versa.</td><td><code>augments.essentials</code></td></tr><tr><td><code>foes</code></td><td>A metatable that maps foe names to numeric identifiers and vice versa.</td><td><code>foes.happyBunny</code></td></tr><tr><td><code>actions</code></td><td>A metatable that maps action names to numeric identifiers and vice versa.</td><td><code>actions.protect</code></td></tr><tr><td><code>contents</code></td><td>A nested metatable where each category is itself a lookup metatable that maps inventory content names to numeric identifiers and vice versa.</td><td><code>contents.magicks.protect</code></td></tr></tbody></table>

For more information on how these arguments can be used, you can refer to the [Name vs Identifier](/the-insurgents-learnable-foecraft/overview/configuration/name-vs-identifier.md) page.

#### `statusEffectIds`

A table of status effects that should prevent a party member from learning an action.

For example, the following would prevent a party member from learning an action if they have the status effects Sleep (4), Blind (7), or Berserk (27).

```lua
local statusEffectIds = {4, 7, 27}
```

#### `dialogId`

The dialog of the combat log that will be shown when an action is learned.

For more information on how to create the dialog, you can refer to the [Combat Log Message](/the-insurgents-learnable-foecraft/getting-started/combat-log-message.md) page.

#### `augmentId`

Only party members with a specific augment have a chance to learn an action.

This augment can either be acquired by unlocking a license node, using an equipment that grants it, or by default for a party member.

#### `soundEffectId`

The sound effect that will be played when an action has successfully been learned.

A value of `-1` equals no sound effect.

#### `learnables`

A table of learnable actions of all foes. Each foe can have multiple learnable actions.

#### `foeId`

The unique (bestiary) identifier of the foe that the action can be learned from.

#### `actionId`

The identifier of the action that can be learned from this foe.

#### `contentId`

The identifier of the required content for the action.

Every action in the game has a required content which is usually acquired through shops, treasures, and so on. A party member is only able to cast an action if the player has its required content in their inventory (licenses aside). The required content of every action is defined in Battlepack -> Section 14 and can be modified with either [The Insurgent's Toolkit](https://www.nexusmods.com/finalfantasy12/mods/160) or [The Insurgent's Workshop](https://github.com/Xeavin/The-Insurgents-Workshop).

Each action can only be learned from a foe if its required content was not acquired otherwise (e.g. shop, treasure, etc.).

Learning an action adds its required content to the player's inventory, therefore unlocking its usage.

#### `chance`

The probability that a party member will learn the action when it is used by a foe.

Every party member has their own chance of learning an action, but once its learned, every party member with the required license node can use it. The more party member's have the required augment, the higher the chance of course to learn the action.

A party member can only have a chance to learn an action from a foe if it is in their visible range. So if a party member is on the other side of the map, while another is in battle with a foe that uses a learnable action, only the one that actually sees the foe will have a chance to learn it.

### Notes

{% hint style="warning" %}
Parameters are processed from top-left to bottom-right, which defines their priority. For example:

* If a foe is listed more than once, only the last one will actually have an effect.
* If an action is listed more than once for a foe, only the first one will actually have an effect.
  {% endhint %}

{% hint style="info" %}
For a list of status effect and augment identifiers, you can view the battlepack spreadsheet in [Resources](/the-insurgents-learnable-foecraft/getting-started/resources.md).
{% endhint %}

{% hint style="info" %}
For a list of foe (bestiary) identifiers, you can view the bestiary spreadsheet in [Resources](/the-insurgents-learnable-foecraft/getting-started/resources.md).

Only the identifiers 0 -> 511 are supported.
{% endhint %}

{% hint style="info" %}
For a list of content identifiers, you can view the inventory content spreadsheet in [Resources](/the-insurgents-learnable-foecraft/getting-started/resources.md).

Only the following content types are supported: Magicks, Technicks, Mist.
{% endhint %}

{% hint style="info" %}
For a list of sound effect identifiers, you can do the following:

1. Extract the `ps2data/sound/se/sead_data_win/se000/se000.win.sab` file via the [VBF Browser](https://www.nexusmods.com/finalfantasy12/mods/3).
2. Download and open [foobar2000](https://www.foobar2000.org/download).
3. Open the extracted `se000.win.sab` file with it.
4. Select and play any track you want.

Once you like one, you can use the track identifier as the sound identifier (e.g. `se000.win#65` -> `65`).
{% endhint %}
