Skip to content
Kinematics edited this page Sep 24, 2014 · 7 revisions

To use the Mote-Include library, certain supplemental files are required, and other optional ones may be created.

Required Files

Mote-Include.lua -- The primary include. This file does two things:

  • Sets up all preparatory variables, and loads the other files.
  • Contains all code for automatically selecting which sets to equip.

This file is almost entirely generic code rules, and should never need to be modified by the user. It essentially defines the 'rules' that you have to follow (primarily in how you name sets) to make use of this include system.

Mote-Globals.lua -- Any additional values or functions that the user wants access to globally, but that the user may want to customize. If the user creates a file called user-globals.lua, that file will be used instead, allowing the user to replace the default entries for each of the functions Mote-Globals defines.

Mote-SelfCommands.lua -- This file handles commands that the user can send directly to GearSwap that that will change variable values and user state (eg: offense mode, casting mode, kiting, etc). The user should never need to modify this file, nor should they ever need to reference any functions in it from user files.

Mote-Utility.lua -- This file includes functions that the user may want to call on from user files. These are general utility functions that may be of use to multiple job files, as well as some utility functions that Mote-Include and Mote-SelfCommands may refer to. None of these functions should do anything directly related to equipping gear, though.

Mote-Mappings.lua -- This file is used for storing information tables, such as lists of elements, or spell mappings, that jobs may want access to. There are no functions in this file, only data.

The separation into individual files is both for code sanity (all the self-command code is difficult to wade through while you're trying to examine the main gear changing code), and so that updates won't overwrite user customizations. It should always be safe to simply drop in new versions of the various Mote-* files.

All of these files should be in the same directory as your regular job lua files. They may be added to a global GearSwap library so that they can be updated along with the regular GearSwap code, without the user needing to adjust them.

Optional Files

To facilitate keeping local user gear sets intact while still being able to update the main file, the scripts will look for 'sidecar' files, and use functions found in those files rather than the equivalent functions found in the main file.

Since these files are entirely local, they can be used so that any modifications you make are retained when you update the main files due to updates and bug fixes, etc.

Of the main includes, the primary optional file is User-Globals.lua. You may also use <charactername>-Globals.lua, if you want a separate custom setup for each character you load.

The job files use a modified name to indicate sidecar versions.

Example:

  • Main file - whm.lua
  • User file - whm_gear.lua (or <charactername>_whm_gear.lua)

Sidecar files may also be saved in a gear/ subdirectory. For example, addons/GearSwap/data/Motenten/gear/. If they're in the gear/ subdirectory, they don't need the _gear portion added to the filename.

Every function written in the sidecar file will overwrite the version of that function from the main job (or Mote-Globals) file. Of particular interest for most users are the following functions:

  • user_setup
  • user_unload
  • init_gear_sets

Note: Any function in the main file (except get_sets()) can be replaced with a version in the sidecar file. However the majority of the time, the only changes you really want to make are in the above functions, to allow you to define your own personal variables and gear sets.

user_setup() should be used to define user-specific variables, such as lists of combat modes, or how many bonus songs you can sing as a brd, etc. Copy the default function, and adjust to taste.

user_unload() is most commonly used if you created any custom keybinds that you put in user_setup(), to allow you to undefine them when the lua file is unloaded (ie: you changed to another job).

init_gear_sets() is solely used to define the gear sets you intend to use for this job. Sets should be defined to follow the set selection rules.

Clone this wiki locally