Skip to content
Kinematics edited this page May 25, 2014 · 3 revisions

Certain very regular rules are used to automatically select which gear sets to equip for different event points when performing an action. Properly defining your sets allow the automatic system to properly select the sets, so as to minimize the number of rules you need to create yourself.

Gear sets are constructed hierarchically in lua tables, all descending from the root table, sets, that GearSwap itself defines. Each sub-table can be considered a categorization refinement that allows you to group sets based on their intended use.

Base set categories

Directly under the sets table are several tables that describe broad categories of use. Each 'event' will look within one of these broad categories. These are named in lowercase.

  • precast
  • midcast
  • resting
  • idle
  • engaged
  • defense

So sets.precast should be the parent table for all sets that are intended for use during the precast phase, etc. The defense category includes gear sets that are intended to override (almost) all other gear sets. They are the 'emergency defense' gear that takes priority over anything else.

Most of these have additional sub-categories defined for specific types of actions or needs. These sub-categories are capitalized.

  1. sets itself has a Kiting sub-category (sets.Kiting). Kiting is the only set that explicitly overrides any defense set in use.
  2. precast has several sub-categories.
  • sets.precast.FC is for Fast Cast gear, applied for any magic spells cast.
  • sets.precast.WS is for weaponskills.
  • sets.precast.JA is for any (non-weaponskill) job abilities.
  • sets.precast.RA is for ranged attacks.
  • sets.precast.Item is for item usage. This is rather limited at this time.
  • Any ability with its own 'type' (ie: spell.type == 'Waltz', 'Jig', 'CorsairShot', 'PetCommand', etc) may use its type as its own category. You may thus create a sets.precast.Waltz set for all Waltz JAs. If the specific spell.type category isn't found, it will also search under the JA table, so that you could, for example, use sets.precast.JA.Vallation rather than sets.precast.Ward.Vallation.
  1. midcast has a couple sub-categories.
  • sets.midcast.RA is for ranged attacks.
  • sets.midcast.Item is for item usage. This is rather limited at this time.
  1. idle has a few sub-categories.
  • sets.idle.Town is for when you're in town, so you can wear vanity town gear.
  • sets.idle.Field is for when you're idle anywhere except when you're in town.
  • sets.idle.Weak is for idle sets when you're weak, and takes priority over Field or Town.

If you don't define sets.idle.Weak it will use the sets.idle.Town or sets.idle.Field instead. If you don't define either of Town or Field, it will default to just equipping sets.idle.

Extended and Custom Categories

Once the base set has been determined, further searching is refined based on player state and option modes.

For precast and midcast, it attempts to find a sub-table that matches one of the following values, searched in order:

  1. classes.CustomClass - The custom class value is reset after the completion of every action, so if it's set it must be because the user specifically wanted it to be used. This takes priority over all other values.
  2. spell.english - If no custom class has been set, it then searches for the English name of the spell.
  3. spellMap - If the spell's name is not found, it then searches for a spell mapping. A spell map is a way of grouping multiple similar spells together. For example, Valor Minuet, Valor Minuet II, Valor Minuet III, etc, are all under the spell map value of 'Minuet'. There are a large number of mappings defined in Mote-Mappings, and each job file can also define its own custom mappings.
  4. spell.skill - If none of the above are found, it then searches for the spell.skill value (if it exists). For example, "Enhancing Magic" or "Blue Magic". If a spell.skill table is found, it will then repeat the search for the custom class, the spell name, and the spell map value.
  5. spell.type - If none of the above are found, it then searches for the spell.type value (if it exists). For example, "BardSong" or "WhiteMagic". This generally only applies to magic spells, since ability types were already accounted for in the base set selection. If a spell.type table is found, it will then repeat the search for the custom class, the spell name, and the spell map value.

Once any of the above have been determined, it then searches for custom-defined modes that match the type of action being taken.

  • Magic spells (for precast and midcast) will then search for a sub-table matching the current Casting Mode value (state.CastingMode). The default macro binding allows cycling through the available casting modes using the Ctrl-F11 key.
  • Weaponskills (for precast) will search for a sub-table matching the current (or custom-defined) Weaponskill Mode (state.WeaponskillMode, or the result of a call to get_custom_wsmode()). The default macro binding allows cycling through the available weaponskill modes using the Alt-F9 key.
  • Job abilities (for precast) will search for a sub-table matching the current JA Mode (state.JAMode). Note that state.JAMode is reset after every action, similar to classes.CustomClass.
  • Ranged attacks (for precast and midcast) will search for a sub-table matching the current Ranged Mode (state.RangedMode). This has no default binding, however the cor lua file has a custom bind that places it on Ctrl-F9 in place of the melee defense mode.
  • Idle sets will search for a sub-table matching the current Idle Mode (state.IdleMode). The default macro binding allows cycling through the available idle modes using the Ctrl-F12 key.
  • Resting sets will search for a sub-table matching the current Resting Mode (state.RestingMode).
  • Defense sets will search for a sub-table matching either the current Physical Defense Mode (state.Defense.PhysicalMode) or Magical Defense Mode (state.Defense.MagicalMode), depending on what the current Defense Type (state.Defense.Type) is set to. The default macro binding allows cycling through the available physical defense modes using the Ctrl-F10 key.
  • Melee sets have a more elaborate search structure, detailed below.

Melee sets, based on sets.engaged, have a more elaborate search mechanism, as there are a number of factors to consider. In order to find the correct set to equip, a search is made for tables matching the following modes, in order. If any given mode isn't found, it's skipped and the search continues with the next one.

  1. Combat Form - state.CombatForm is intended for use in defining broad, long-term effects. It is likely to be used for active player buffs like Footwork or Dual Wield, or for general combat areas such as Adoulin (to account for Save TP) or Abyssea. Only a single Combat Form can be specified at any given time.
  2. Combat Weapon - state.CombatWeapon allows you to specify the type of weapon being used. You can use this to distinguish between sword and dagger, or between Great Sword and Great Axe, or more specific individual weapons such as Amano and Koga great katanas, etc. Only a single Combat Weapon can be specified at a given time.
  3. Offense Mode - state.OffenseMode may take any value among the list of values in options.OffenseModes. The default macro binding allows you to cycle through the possible offense modes using the F9 key. Melee offense and defense modes allow you to create specific forms of 'hybrid' gear sets.
  4. Defense Mode - state.DefenseMode may take any value among the list of values in options.DefenseModes. The default macro binding allows you to cycle through the possible defense modes using the Ctrl-F9 key. Melee offense and defense modes allow you to create specific forms of 'hybrid' gear sets. Note that this is not the same as the 'full' defense mode which overrides other gear sets.
  5. Custom Melee Groups - classes.CustomMeleeGroups is an ordered list of additional sub-tables to look for that the user may fill with any value they wish. Examples might be adding 'HundredFists', or 'Impetus', or both.

A fully-defined set might be something like sets.engaged.Abyssea.H2H.Acc.PDT.HundredFists.Impetus.

However, since all of those values are optional, anything that doesn't vary from the default may be left out. The base sets.engaged could be used for anything where nothing more specific is needed.

While the value of 'Normal' is used in most mode lists, it's generally never used in the set definitions. It's assumed that if you're using the default 'Normal' value, you can also just use the default (unmodified) base set that you're attempting to make a search from.

Custom Groups

Several types of sets also allow for fully custom set searching via Custom Groups. The types are:

  • classes.CustomMeleeGroups
  • classes.CustomRangedGroups
  • classes.CustomIdleGroups
  • classes.CustomDefenseGroups

Any time any of the above sets is determined, the list of values contained within the above variables will also be checked, in order to select a more specific gear set to be equipped.

Pet categories

As an addendum to the above, sets to use for pet actions and states may also be specified. This is done by using certain specific Pet sub-tables.

  • sets.midcast.Pet - Use this as the base table for actions that occur at the pet_midcast() event.
  • sets.idle.<IdleMode>.Pet - Use this set for idling with a pet out.
  • sets.idle.<IdleMode>.Pet.Engaged - Use this set for idling with a pet out when the pet is engaged to a mob.

Customizations to melee sets when accounting for a pet should be done with the CustomMeleeGroups.


Construct your sets with the above rules in mind, and the Include will be able to handle 95% of set selection and equipping without you needing to write any particular specifics.

Clone this wiki locally