ITM files

Description

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.

ITM file versions

ITM V1

Overall structure

ITM V1 Header

OffsetSize (datatype)Description
0x00004 (char array)Signature ('ITM ')
0x00044 (char array)Version ('V1 ')
0x00084 (strref)Item name (generic)
0x000c4 (strref)Item name (identified)
0x00108 (resref)"Used Up Item" -- (i.e. what does this become when it breaks or is used up?)
0x00184 (dword)Flags:
  • bit 0: indestructible
  • bit 1: two-handed
  • bit 2: droppable
  • bit 3: displayable
  • bit 4: cursed
  • bit 5: copyable (scroll) -- does this have a different meaning for different item types, or is it unused for other item types?
  • bit 6: magical
  • bit 7: (set iff item is a bow?)
  • bit 8: silver
  • bit 9: cold iron
  • bit 10: unknown
  • bit 11: unknown
  • bit 12: unknown
0x001c2 (word)Item category index, as specified in this table
0x001e4 (dword)Item usability bitmap:
  • bit 0: Unusable by Chaotic
  • bit 1: Unusable by Evil
  • bit 2: Unusable by Good
  • bit 3: Unusable by Good-Evil Neutral
  • bit 4: Unusable by Lawful
  • bit 5: Unusable by Lawful-Chaotic Neutral
  • bit 6: Unusable by Bard
  • bit 7: Unusable by Cleric
  • bit 8: Unusable by Cleric-Mage
  • bit 9: Unusable by Cleric-Thief
  • bit 10: Unusable by Cleric-Ranger
  • bit 11: Unusable by Fighter
  • bit 12: Unusable by Fighter-Druid
  • bit 13: Unusable by Fighter-Mage
  • bit 14: Unusable by Fighter-Cleric
  • bit 15: Unusable by Fighter-Mage-Cleric
  • bit 16: Unusable by Fighter-Mage-Thief
  • bit 17: Unusable by Fighter-Thief
  • bit 18: Unusable by Mage
  • bit 19: Unusable by Thief-Mage
  • bit 20: Unusable by Paladin
  • bit 21: Unusable by Ranger
  • bit 22: Unusable by Thief
  • bit 23: Unusable by Elf
  • bit 24: Unusable by Dwarf
  • bit 25: Unusable by Half-elf
  • bit 26: Unusable by Halfling
  • bit 27: Unusable by Human
  • bit 28: Unusable by Gnome
  • bit 29: ?
  • bit 30: Unusable by Druid
  • bit 31: ?
0x00222 (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.
0x00242 (word)Minimum level requirement
0x00262 (word)Minimum strength requirement
0x00282 (word)Minimum strength bonus requirement
0x002a2 (word)Minimum intelligence requirement
0x002c2 (word)Minimum dexterity requirement
0x002e2 (word)Minimum wisdom requirement
0x00302 (word)Minimum constitution requirement
0x00322 (word)Minimum charisma requirement
0x00344 (dword)Base value (i.e. before modification, this is the market value of a single unit of this item)
0x00382 (word)Max stackable
0x003a8 (resref)Item Icon
0x00422 (word)Lore (i.e. Lore skill required to identify this item)
0x00448 (resref)Ground Icon
0x004c4 (dword)Base weight (i.e. weight for a single unit of this item)
0x00504 (strref)Item description (generic)
0x00544 (strref)Item description (identified)
0x00588 (resref)Carried Icon (i.e. graphic as it appears in your hand when you are walking).
0x00604 (dword)"Enchantment"
0x00644 (dword)Ability structs offset
0x00682 (word)Ability structs count
0x006a4 (dword)Effect structs offset
0x006e2 (word)Unknown. Could be index of first "global" (i.e. not attached to a specific ability) effect structs
0x00702 (word)Count of "global" (i.e. not attached to a specific ability) effect structs

ITM V1 Abilities

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.).

OffsetSize (datatype)Description
0x00001 (byte)Ability "type":
  • 0: default type? (mostly potions and miscellaneous items)
  • 1: melee attack (non-ranged attacks)
  • 2: ranged attack (both for ammunition and for throw weapon types)
  • 3: magical effect?
  • 4: launcher -- enables use of some "ranged attack" items which require a launcher
0x00011 (byte)1 if item must be identified before this ability can be used, 0 otherwise
0x00022 (word)Unknown!
0x00048 (resref)icon to represent this ability wherever it needs to be displayed in the GUI
0x000c2 (word)Selectable target type for this ability:
  • 1: living actor
  • 2: inventory
  • 3: dead actor
  • 4: any point within range
  • 5: caster
  • other values?
0x000e2 (word)Range for this ability
0x00102 (word)Launcher type required for this ability:
  • 0: None
  • 1: bow
  • 2: crossbow
  • 3: sling
0x00122 (word)Speed factor for this ability
0x00142 (word)To-hit bonus when using this ability
0x00162 (word)Number of sides on damage dice to be rolled for this ability
0x00182 (word)Number of damage dice to be rolled for this ability
0x001a2 (word)"Enchanted" (i.e. bonus to damage -- constant bonus added to hit dice)
0x001c2 (word)Damage type:
  • 0: none?
  • 1: piercing (also appears to be set for some magical attacks, though it is likely ignored in these cases -- i.e. damage specified as 0d6+0)
  • 2: crushing
  • 3: slashing
  • 4: missile
0x001e2 (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.
0x00202 (word)Index of first attached Effect structs for this ability.
0x00222 (word)Number of times this ability can be used before it is exhausted
0x00242 (word)Unknown. Appears that it might be related to the previous field...
0x00262 (word)Unknown.
0x00282 (word)Unknown.
0x002a2 (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.)
0x002c2*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.
0x00322 (word)1 if this is an "arrow" type projectile, 0 else
0x00342 (word)1 if this is an "bolt" type projectile, 0 else
0x00362 (word)1 if this is a miscellaneous missile weapon (thrown, or launched from a sling). 0 else

ITM V1.1

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

ITM V1.1 Header

OffsetSize (datatype)Description
0x00004 (char array)Signature ('ITM ')
0x00044 (char array)Version ('V1.1')
0x00084 (strref)Item name (generic)
0x000c4 (strref)Item name (identified)
0x00108 (resref)"Used Up Item" -- (i.e. what does this become when it breaks or is used up?)
0x00184 (dword)Flags:
  • bit 0: indestructible
  • bit 1: two-handed
  • bit 2: droppable
  • bit 3: displayable
  • bit 4: cursed
  • bit 5: copyable (scroll)
  • bit 6: magical
  • bit 7: (set iff item is a bow?)
  • bit 8: silver
  • bit 9: cold iron
0x001c2 (word)Item category index, as specified in this table
0x001e4 (dword)Item usability bitmap:
  • bit 0: Unusable by Chaotic
  • bit 1: Unusable by Evil
  • bit 2: Unusable by Good
  • bit 3: Unusable by Good-Evil Neutral
  • bit 4: Unusable by Lawful
  • bit 5: Unusable by Lawful-Chaotic Neutral
  • bit 6: Unusable by Sensates
  • bit 7: Unusable by Priest
  • bit 8: Unusable by Godsmen
  • bit 9: ???
  • bit 10: Unusable by Chaosmen
  • bit 11: Unusable by Fighter
  • bit 12: ???
  • bit 13: Unusable by ???
  • bit 14: Unusable by Dustmen
  • bit 15: ???
  • bit 16: Unusable by Indeps
  • bit 17: ???
  • bit 18: Unusable by Mage
  • bit 19: Unusable by ???
  • bit 20: Unusable by Dak'kon
  • bit 21: Unusable by Fall-From-Grace
  • bit 22: Unusable by Thief
  • bit 23: Unusable by Vhailor
  • bit 24: Unusable by Ignus
  • bit 25: Unusable by Morte
  • bit 26: Unusable by Nordom
  • bit 27: ???
  • bit 28: Unusable by Annah
  • bit 29: ???
  • bit 30: Unusable by Nameless One
  • bit 31: ???
0x00222 (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.
0x00242 (word)Minimum level requirement
0x00262 (word)Minimum strength requirement
0x00282 (word)Minimum strength bonus requirement
0x002a2 (word)Minimum intelligence requirement
0x002c2 (word)Minimum dexterity requirement
0x002e2 (word)Minimum wisdom requirement
0x00302 (word)Minimum constitution requirement
0x00322 (word)Minimum charisma requirement
0x00344 (dword)Base value (i.e. before modification, this is the market value of a single unit of this item)
0x00382 (word)Max stackable
0x003a8 (resref)Item Icon
0x00422 (word)Lore (i.e. Lore skill required to identify this item)
0x00448 (resref)Ground Icon
0x004c4 (dword)Base weight (i.e. weight for a single unit of this item)
0x00504 (strref)Item description (generic)
0x00544 (strref)Item description (identified)
0x00588 (resref)Carried Icon (i.e. graphic as it appears in your hand when you are walking).
0x00604 (dword)"Enchantment"
0x00644 (dword)Ability structs offset
0x00682 (word)Ability structs count
0x006a4 (dword)Effect structs offset
0x006e2 (word)Unknown. Could be index of first "global" (i.e. not attached to a specific ability) effect structs
0x00702 (word)Count of "global" (i.e. not attached to a specific ability) effect structs
0x00724 (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.
0x00764*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.

ITM V1.1 Abilities

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.).

OffsetSize (datatype)Description
0x00001 (byte)Ability "type":
  • 0: default type? (mostly potions and miscellaneous items)
  • 1: melee attack (non-ranged attacks)
  • 2: ranged attack (both for ammunition and for throw weapon types)
  • 3: magical effect?
  • 4: launcher -- enables use of some "ranged attack" items which require a launcher
0x00011 (byte)1 if item must be identified before this ability can be used, 0 otherwise
0x00022 (word)Unknown!
0x00048 (resref)icon to represent this ability wherever it needs to be displayed in the GUI
0x000c2 (word)Selectable target type for this ability:
  • 1: living actor
  • 2: inventory
  • 3: dead actor
  • 4: any point within range
  • 5: caster
  • other values?
0x000e2 (word)Range for this ability
0x00102 (word)Launcher type required for this ability:
  • 0: None
  • 1: bow
  • 2: crossbow
  • 3: sling
0x00122 (word)Speed factor for this ability
0x00142 (word)To-hit bonus when using this ability
0x00162 (word)Number of sides on damage dice to be rolled for this ability
0x00182 (word)Number of damage dice to be rolled for this ability
0x001a2 (word)"Enchanted" (i.e. bonus to damage -- constant bonus added to hit dice)
0x001c2 (word)Damage type:
  • 0: none?
  • 1: piercing (also appears to be set for some magical attacks, though it is likely ignored in these cases -- i.e. damage specified as 0d6+0)
  • 2: crushing
  • 3: slashing
  • 4: missile
0x001e2 (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.
0x00202 (word)Index of first attached Effect structs for this ability.
0x00222 (word)Number of times this ability can be used before it is exhausted
0x00242 (word)Unknown. Appears that it might be related to the previous field...
0x00262 (word)Unknown.
0x00282 (word)Unknown.
0x002a2 (word)Unknown.
0x002c2*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.
0x00322 (word)1 if this is an "arrow" type projectile, 0 else
0x00342 (word)1 if this is an "bolt" type projectile, 0 else
0x00362 (word)1 if this is a miscellaneous missile weapon (thrown, or launched from a sling). 0 else

[ back to index ]