An ITM file describes any item that can appear in the inventory of any creature. Some ITM files do not describe objects the user would typically have in their inventory -- for instance, many monsters have attacks which are special items that don't appear elsewhere in the game. In Torment, there is the additional complication that objects can have associated dialog resources; hence, it is possible to create items with which the character can carry on conversations.
Overall structure
| Offset | Size (datatype) | Description |
|---|---|---|
| 0x0000 | 4 (char array) | Signature ('ITM ') |
| 0x0004 | 4 (char array) | Version ('V1 ') |
| 0x0008 | 4 (strref) | Item name (generic) |
| 0x000c | 4 (strref) | Item name (identified) |
| 0x0010 | 8 (resref) | "Used Up Item" -- (i.e. what does this become when it breaks or is used up?) |
| 0x0018 | 4 (dword) | Flags:
|
| 0x001c | 2 (word) | Item category index, as specified in this table |
| 0x001e | 4 (dword) | Item usability bitmap:
|
| 0x0022 | 2 (chars) | Chars for inventory portrait BAM resource index. The BAM resource used on the inventory screen is determined as follows: If these characters are spaces, no resource is used. Otherwise, depending on whether the character is Small, Medium, or Large, WPS, WPM, or WPL is prepended to the characters. This is then used as a BAM resource name for graphics which are superposed on top of the character portrait. To accomodate hands and the like, empty spaces are left in these graphics. Similar procedures are used to choose animation resources for other graphics and animations which need to be specific to particular equipment types and/or character types. |
| 0x0024 | 2 (word) | Minimum level requirement |
| 0x0026 | 2 (word) | Minimum strength requirement |
| 0x0028 | 2 (word) | Minimum strength bonus requirement |
| 0x002a | 2 (word) | Minimum intelligence requirement |
| 0x002c | 2 (word) | Minimum dexterity requirement |
| 0x002e | 2 (word) | Minimum wisdom requirement |
| 0x0030 | 2 (word) | Minimum constitution requirement |
| 0x0032 | 2 (word) | Minimum charisma requirement |
| 0x0034 | 4 (dword) | Base value (i.e. before modification, this is the market value of a single unit of this item) |
| 0x0038 | 2 (word) | Max stackable |
| 0x003a | 8 (resref) | Item Icon |
| 0x0042 | 2 (word) | Lore (i.e. Lore skill required to identify this item) |
| 0x0044 | 8 (resref) | Ground Icon |
| 0x004c | 4 (dword) | Base weight (i.e. weight for a single unit of this item) |
| 0x0050 | 4 (strref) | Item description (generic) |
| 0x0054 | 4 (strref) | Item description (identified) |
| 0x0058 | 8 (resref) | Carried Icon (i.e. graphic as it appears in your hand when you are walking). |
| 0x0060 | 4 (dword) | "Enchantment" |
| 0x0064 | 4 (dword) | Ability structs offset |
| 0x0068 | 2 (word) | Ability structs count |
| 0x006a | 4 (dword) | Effect structs offset |
| 0x006e | 2 (word) | Unknown. Could be index of first "global" (i.e. not attached to a specific ability) effect structs |
| 0x0070 | 2 (word) | Count of "global" (i.e. not attached to a specific ability) effect structs |
Roughly speaking, each "ability" (I believe this to be the terminology used in the Bioware tools) corresponds to a different way to use the item. For instance, in BG, there is an item which can be either a melee (hand-to-hand) axe, or a throwing axe. Or the "wand of fire" which fires either fireballs or "aganazzar's scorcher". To choose which, you click on the item while it is selected, and you are given a menu to choose the ammunition type -- the same procedure used for selecting different missile types for a missile weapon. (Note, also, that it is possible to get an info screen for a bow, for instance, in which all of the "abilities" of the bow are listed -- namely the different types of ammunition it fires. I suspect that it is no coincidence that the same interfaces are used to select "abilities" of an item, and differing ammunition types of a launcher; likely the game internally handles different ammunition types via the same interface it uses for abilities.).
| Offset | Size (datatype) | Description |
|---|---|---|
| 0x0000 | 1 (byte) | Ability "type":
|
| 0x0001 | 1 (byte) | 1 if item must be identified before this ability can be used, 0 otherwise |
| 0x0002 | 2 (word) | Unknown! |
| 0x0004 | 8 (resref) | icon to represent this ability wherever it needs to be displayed in the GUI |
| 0x000c | 2 (word) | Selectable target type for this ability:
|
| 0x000e | 2 (word) | Range for this ability |
| 0x0010 | 2 (word) | Launcher type required for this ability:
|
| 0x0012 | 2 (word) | Speed factor for this ability |
| 0x0014 | 2 (word) | To-hit bonus when using this ability |
| 0x0016 | 2 (word) | Number of sides on damage dice to be rolled for this ability |
| 0x0018 | 2 (word) | Number of damage dice to be rolled for this ability |
| 0x001a | 2 (word) | "Enchanted" (i.e. bonus to damage -- constant bonus added to hit dice) |
| 0x001c | 2 (word) | Damage type:
|
| 0x001e | 2 (word) | Number of attached Effect structs for this ability. Note that not all abilities are designed in terms of effects. For instance, standard weapon damage doesn't require any effects, since it is just a to-hit bonus, a die specification, a damage bonus, and a damage type. |
| 0x0020 | 2 (word) | Index of first attached Effect structs for this ability. |
| 0x0022 | 2 (word) | Number of times this ability can be used before it is exhausted |
| 0x0024 | 2 (word) | Unknown. Appears that it might be related to the previous field... |
| 0x0026 | 2 (word) | Unknown. |
| 0x0028 | 2 (word) | Unknown. |
| 0x002a | 2 (word) | Projectile type. (Pre-BG2, these were all hardcoded; according to Dmitry Jemerov, there were 296 hard-coded types as of IWD. In BG2, some types are still hardcoded, but they are first looked up in the VEFPROJ.IDS and PROJECTL.IDS files. The PROJECTL.IDS file maps the id to .PRO file, which describes projectiles. The VEFPROJ.IDS file presumably maps the id to a .VEF file, which describes a 'visual effect', presumably using the new 3D OpenGL stuff. The precise function of this file is unknown though, since it is empty in BG2.) |
| 0x002c | 2*3 (word array) | Unknown. This appears to be three percentages, though. For missile weapons they are all 0, and for all other types of items, they add up to exactly 100, each being in the range 0-100. It is unknown what these code for. |
| 0x0032 | 2 (word) | 1 if this is an "arrow" type projectile, 0 else |
| 0x0034 | 2 (word) | 1 if this is an "bolt" type projectile, 0 else |
| 0x0036 | 2 (word) | 1 if this is a miscellaneous missile weapon (thrown, or launched from a sling). 0 else |
Note: This structure is mostly the same as the V1.0 structure. As such, I've cut'n'pasted this part and made appropriate changes. There may still be a few more changes which need to be made.
Overall structure
| Offset | Size (datatype) | Description |
|---|---|---|
| 0x0000 | 4 (char array) | Signature ('ITM ') |
| 0x0004 | 4 (char array) | Version ('V1.1') |
| 0x0008 | 4 (strref) | Item name (generic) |
| 0x000c | 4 (strref) | Item name (identified) |
| 0x0010 | 8 (resref) | "Used Up Item" -- (i.e. what does this become when it breaks or is used up?) |
| 0x0018 | 4 (dword) | Flags:
|
| 0x001c | 2 (word) | Item category index, as specified in this table |
| 0x001e | 4 (dword) | Item usability bitmap:
|
| 0x0022 | 2 (chars) | Chars for inventory portrait BAM resource index. The BAM resource used on the inventory screen is determined as follows: If these characters are spaces, no resource is used. Otherwise, depending on whether the character is Small, Medium, or Large, WPS, WPM, or WPL is prepended to the characters. This is then used as a BAM resource name for graphics which are superposed on top of the character portrait. To accomodate hands and the like, empty spaces are left in these graphics. Similar procedures are used to choose animation resources for other graphics and animations which need to be specific to particular equipment types and/or character types. |
| 0x0024 | 2 (word) | Minimum level requirement |
| 0x0026 | 2 (word) | Minimum strength requirement |
| 0x0028 | 2 (word) | Minimum strength bonus requirement |
| 0x002a | 2 (word) | Minimum intelligence requirement |
| 0x002c | 2 (word) | Minimum dexterity requirement |
| 0x002e | 2 (word) | Minimum wisdom requirement |
| 0x0030 | 2 (word) | Minimum constitution requirement |
| 0x0032 | 2 (word) | Minimum charisma requirement |
| 0x0034 | 4 (dword) | Base value (i.e. before modification, this is the market value of a single unit of this item) |
| 0x0038 | 2 (word) | Max stackable |
| 0x003a | 8 (resref) | Item Icon |
| 0x0042 | 2 (word) | Lore (i.e. Lore skill required to identify this item) |
| 0x0044 | 8 (resref) | Ground Icon |
| 0x004c | 4 (dword) | Base weight (i.e. weight for a single unit of this item) |
| 0x0050 | 4 (strref) | Item description (generic) |
| 0x0054 | 4 (strref) | Item description (identified) |
| 0x0058 | 8 (resref) | Carried Icon (i.e. graphic as it appears in your hand when you are walking). |
| 0x0060 | 4 (dword) | "Enchantment" |
| 0x0064 | 4 (dword) | Ability structs offset |
| 0x0068 | 2 (word) | Ability structs count |
| 0x006a | 4 (dword) | Effect structs offset |
| 0x006e | 2 (word) | Unknown. Could be index of first "global" (i.e. not attached to a specific ability) effect structs |
| 0x0070 | 2 (word) | Count of "global" (i.e. not attached to a specific ability) effect structs |
| 0x0072 | 4 (dword) | These appear to be more flags, similar to the flags appearing earlier in the header. It is unclear what their function may be; they appear to be highly correlated with the earlier flags. Notably, many "important" items, like "Celestial Fire" have different flags here. |
| 0x0076 | 4*6 (dword array) | These are still completely mysterious. (There are only a few data points which have these set to a non-zero value, which means that it is very difficult to establish any real meaning behind these fields; I'm looking into the purpose of these fields. |
Roughly speaking, each "ability" (I believe this to be the terminology used in the Bioware tools) corresponds to a different way to use the item. For instance, in BG, there is an item which can be either a melee (hand-to-hand) axe, or a throwing axe. Or the "wand of fire" which fires either fireballs or "aganazzar's scorcher". To choose which, you click on the item while it is selected, and you are given a menu to choose the ammunition type -- the same procedure used for selecting different missile types for a missile weapon. (Note, also, that it is possible to get an info screen for a bow, for instance, in which all of the "abilities" of the bow are listed -- namely the different types of ammunition it fires. I suspect that it is no coincidence that the same interfaces are used to select "abilities" of an item, and differing ammunition types of a launcher; likely the game internally handles different ammunition types via the same interface it uses for abilities.).
| Offset | Size (datatype) | Description |
|---|---|---|
| 0x0000 | 1 (byte) | Ability "type":
|
| 0x0001 | 1 (byte) | 1 if item must be identified before this ability can be used, 0 otherwise |
| 0x0002 | 2 (word) | Unknown! |
| 0x0004 | 8 (resref) | icon to represent this ability wherever it needs to be displayed in the GUI |
| 0x000c | 2 (word) | Selectable target type for this ability:
|
| 0x000e | 2 (word) | Range for this ability |
| 0x0010 | 2 (word) | Launcher type required for this ability:
|
| 0x0012 | 2 (word) | Speed factor for this ability |
| 0x0014 | 2 (word) | To-hit bonus when using this ability |
| 0x0016 | 2 (word) | Number of sides on damage dice to be rolled for this ability |
| 0x0018 | 2 (word) | Number of damage dice to be rolled for this ability |
| 0x001a | 2 (word) | "Enchanted" (i.e. bonus to damage -- constant bonus added to hit dice) |
| 0x001c | 2 (word) | Damage type:
|
| 0x001e | 2 (word) | Number of attached Effect structs for this ability. Note that not all abilities are designed in terms of effects. For instance, standard weapon damage doesn't require any effects, since it is just a to-hit bonus, a die specification, a damage bonus, and a damage type. |
| 0x0020 | 2 (word) | Index of first attached Effect structs for this ability. |
| 0x0022 | 2 (word) | Number of times this ability can be used before it is exhausted |
| 0x0024 | 2 (word) | Unknown. Appears that it might be related to the previous field... |
| 0x0026 | 2 (word) | Unknown. |
| 0x0028 | 2 (word) | Unknown. |
| 0x002a | 2 (word) | Unknown. |
| 0x002c | 2*3 (word array) | Unknown. This appears to be three percentages, though. For missile weapons they are all 0, and for all other types of items, they add up to exactly 100, each being in the range 0-100. It is unknown what these code for. |
| 0x0032 | 2 (word) | 1 if this is an "arrow" type projectile, 0 else |
| 0x0034 | 2 (word) | 1 if this is an "bolt" type projectile, 0 else |
| 0x0036 | 2 (word) | 1 if this is a miscellaneous missile weapon (thrown, or launched from a sling). 0 else |
[ back to index ]