FormID

Revision as of 12:32, 28 August 2009 by imported>Cloakedboltz (section scripting)


An object's FormID is a hexadecimal number used to refer to the object from within Oblivion. An object may be referred to by its EditorID within the CS (in scripts and etc.), but you must use the FormID for console commands.

FormID Format

The first two digits in the FormID are the ModIndex, while the remaining six digits are the ObjectIndex. The ObjectIndex numbers are unique within each mod -- i.e., no two data objects belonging to a mod will have the same ObjectIndex (otherwise, you get bashing error messages).

The ModIndex reflects the load order of the mod in the current context.

When shown in the CS, the ModIndex reflects only the currently loaded files, typically your mod and its masters. For a typical mod which has only Oblivion.esm as its master, Oblivion.esm will be loaded first at ModIndex 00, while your mod will be loaded second at ModIndex 01. In another example, if a mod had three different masters, those would load as ModIndexes 00, 01 and 02, while your mod would be loaded at ModIndex 03.

In-game, the ModIndex reflects the position of your mod in the active load order. The game always loads Oblivion.esm first, so it will always occupy ModIndex 00. A mod which is the 10th file in the load order (including Oblivion.esm) will have ModIndex 09. One which is 37th in the load order will have ModIndex 24, and so on. Before a FormID can be used with a function in the console, its ModIndex must be updated to match the mod's positioning in the load order (see Determining In-Game ModIndex).

Finding the FormID

File:FormIdColumn.gif
Finding the FormID column
 
Locating the FormID

The FormID column is located to the right of the EditorID column in the Object Window of the CS, however it is hidden by default.

The double column line in the first image indicates that a column is collapsed. Click and drag on the column heading to expand the column. The expanded column is shown in the second image.

In this case, the FormID for GiantSwordOfPwn is 02000CE8.

Console Usage

Supposing that our mod was located 15th in the load order, we would update the ModIndex of GiantSwordOfPwn to be 0E000CE8. It can now be used with console commands such as:

player.addItem 0E000CE8 1

Determining In-Game ModIndex

  1. In the CS, place in item from your mod in an easy to locate area. Then simply find that item in-game, open the console and click on it to see its ModIndex.
  2. Use Wrye Bash
    • Go to the Mods tab, find and activate your mod, and then check the Load Order column for its ModIndex.
    • Alternatively, go to the Saves tab and find a save in which your mod is active and with a purple checkbox (indicating that the save's load order is 100% in-sync with the current load order). Select the save, find your mod under the save's list of masters, and check the MI column.
  3. Use Oblivion Mod Manager
    • Find and activate your mod in the Mod List, then hover the mouse over its name. The ModIndex is listed as "FormID" in the info window which will appear.

Scripting

In scripting, the best way to refer to an object is to use the EditorID. FormIDs aren't good for compatibility because if more than one mod is present, it's ModIndex will change according to the load order. This will cause scripts to no longer work, or work incorrectly. This is a common script rookie mistake.

See Also