• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Get your art tools and paintbrushes ready and enter Hive's 34th Texturing Contest: Void! Click here to enter!

Inventory FAQ

Level 19
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:
  • war3mapImported\UIBaseButton.MDX
  • war3mapImported\selector.MDX
  • war3mapImported\ScrollUp.tga
  • war3mapImported\ScrollDown.tga
  • All border files. ( BorderLeftNE, BorderTopNE, .... )
  • All Trebuchet MS files.
5.) You may then run the external object merger script to generate a bunch of destructables objects.


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.

  1. Abilities - Abilities(iabi): We can't access the ability list for items, therefore the list should be empty for custom items.
    ---
  2. 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.
    ---
  3. 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.
    ---
  4. 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.
    ---
  5. Stats - Gold Cost(igol): Is accessed to get the gold costs for a custom item.
    ---
  6. Stats - Lumber Cost(ilum): Is accessed to get the lumber costs for a custom item.
    ---
  7. Stats - Number Of Charges(iuse): Is accessed to get the number of charges for a custom item.
    ---
  8. Stats - Level(ilev): Doesn't have a meaning yet and neither has the unclassified level field.
    ---
  9. 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.
The item names are generated in library CustomItemName by rolling a prefix and a suffix.
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:
Top