- Joined
- Mar 18, 2012
- Messages
- 1,716
A Guide to Inventory
Inventory installation
1a.) Copy the UIPackage folder from the demo into your map.
1b.) Import the war3mapImported\32x32.mdx, war3mapImported\64x64.mdx and war3mapImported\128x128.mdx
models from the demo's Import Editor into your map. Leave the imported filenames untouched.
However if you want to change the filename, you'll also have to adjust the settings for trackable models in the UIBasic library.
2.) Copy the Inventory Requirement folder from the demo into your map.
3.) Copy the Inventory folder from the demo into your map.
4.) Import the all files from the demo map's Import Editor to you map. Those include:
Item object editor fields
Since Warcraft III world editor allows us to change a bunch of fields for item objects, Inventory will try to access as
many as possible while neither messing with the native API nor abusing these fields for a different purpose as they are ment for.
Object editor fields help you to write information directly into your map file without initializing them via custom code.
Let's see which fields are available for Inventory and which are not.
Random item names
Inventory enables random name generation for registered custom items if:
Inside the library you can set the prefixes and suffixes to your needs or even change the algorithm how names are generated.
The current algorithm considers the following factors:
Merchant interface
By now the shop interface is poorly supported by Inventory, but that can change in the near future.
A global condition for a shop is the presence of the Shop Purchase Item ('Apit') ability and that the shop is an ally or your unit.
To open the shop interface the unit must be in
Always the closests shop will interact with your unit.
Until now you can only pawn items to shop. Buying items is by now not supported.
Inventory installation
1a.) Copy the UIPackage folder from the demo into your map.
1b.) Import the war3mapImported\32x32.mdx, war3mapImported\64x64.mdx and war3mapImported\128x128.mdx
models from the demo's Import Editor into your map. Leave the imported filenames untouched.
However if you want to change the filename, you'll also have to adjust the settings for trackable models in the UIBasic library.
2.) Copy the Inventory Requirement folder from the demo into your map.
3.) Copy the Inventory folder from the demo into your map.
4.) Import the all files from the demo map's Import Editor to you map. Those include:
- war3mapImported\UIBaseButton.MDX
- war3mapImported\selector.MDX
- war3mapImported\ScrollUp.tga
- war3mapImported\ScrollDown.tga
- All border files. ( BorderLeftNE, BorderTopNE, .... )
- All Trebuchet MS files.
Item object editor fields
Since Warcraft III world editor allows us to change a bunch of fields for item objects, Inventory will try to access as
many as possible while neither messing with the native API nor abusing these fields for a different purpose as they are ment for.
Object editor fields help you to write information directly into your map file without initializing them via custom code.
Let's see which fields are available for Inventory and which are not.
- Abilities - Abilities(iabi): We can't access the ability list for items, therefore the list should be empty for custom items.
--- - Stats - Can Be Sold To Merchants(ipaw): Similar to normal Warcraft III merchants, items having this field set to false can't be pawned in the interface as well.
--- - Stats - Can Be Sold By Merchants(isel): Similar to normal Warcraft III merchants, items having this field set to false can't be sold in the interface as well.
--- - Stats - Classification(icla):
- Items of type
ITEM_TYPE_POWERUP
can't be registered as custom items. - Items of type
ITEM_TYPE_PURCHASABLE
can be registered, but will not appear in the custom UI. Instead they go to the native inventory. - Items of type
ITEM_TYPE_PERMANENT
will generate a random item name. - Any other type can be registered as custom item and will keep the item name set in the object editor.
- Items of type
- Stats - Gold Cost(igol): Is accessed to get the gold costs for a custom item.
--- - Stats - Lumber Cost(ilum): Is accessed to get the lumber costs for a custom item.
--- - Stats - Number Of Charges(iuse): Is accessed to get the number of charges for a custom item.
--- - Stats - Level(ilev): Doesn't have a meaning yet and neither has the unclassified level field.
--- - Text - Name(unam): Is accessed to get the name of a custom item.
Random item names
Inventory enables random name generation for registered custom items if:
- The item is of type
ITEM_TYPE_PERMANENT
- The item is dynamic, therefore rolls random affixes.
Inside the library you can set the prefixes and suffixes to your needs or even change the algorithm how names are generated.
The current algorithm considers the following factors:
- Quality of the item in range of 0% - 100%
- Highest rolled bonus.
- If the highest bonus is an ability the name is generated to "item name" + " of " + "ability name".
Merchant interface
By now the shop interface is poorly supported by Inventory, but that can change in the near future.
A global condition for a shop is the presence of the Shop Purchase Item ('Apit') ability and that the shop is an ally or your unit.
To open the shop interface the unit must be in
INVENTORY_MAXIMUM_SHOP_RANGE
, which can be set in the user configuration.Always the closests shop will interact with your unit.
Until now you can only pawn items to shop. Buying items is by now not supported.
Last edited: