• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Inventory & Equipment UI System v1.4.3

This is an extended Inventory and Equipment system. It allows any unit to have an unlimited (or limited) amount of items in their inventory.

An inventory window will pop up where you can manage or equip your items. The window is overlay onto the current camera, so it doesn't take you away from gameplay.

There are many things to configure in the Inventory trigger.

Full documentation coming soon™

Changelog


v1.4.3
  • Updated texttag positions to fit on patches 1.29.1+.
  • The selector glow is no longer shown when the inventory is closed.
  • The selector glow now longer shows in the middle of the screen on items with no equipment slot.
v1.4.2
  • Unofficial quick fix version for broken Blizzard patch.
v1.4.1
  • The selection glow no longer shows for the equipment window if it's not open.
  • Fixed a bug where a line of the tooltip might get overwritten.
  • Updated some items to have colored names.
  • Improved tooltip formatting.
v1.4.0
  • Updated the UserInterface library to 1.0.6. This fixes a desync (should be desync-free now).
  • Redesigned the interface layout to be more practical and compact.
  • You may now Right-Click to equip an item.
  • When selecting an item it will highlight and so will the corresponding equipment slot.
  • When socketing an item you can confirm it through a dialog (to prevent accidental socketing).
  • Added a Drop button which allows you to drop items from your inventory.
v1.3.4
  • Added different terrain heights and water levels to the demo.
  • Set dummy units movement type to float.
v1.3.3
  • Updated the UserInterface library to 1.0.5. This allows the the UI to be displayed over water.
  • Improved the default tooltip design.
  • Updated PlayerUtils to 1.2.8.
v1.3.2
  • Fixed a potential TimerUtils leak.
  • Reduced the default tooltip line length to support lower resolutions.
  • Adjusted default player name position on the hero window.
  • Updated PlayerUtils to v1.2.7.
v1.3.1
  • Tooltip position is now dynamic. It will popup over the item you clicked (see screenshot).
  • Equipment window is now bigger by default.
  • Many more configuration options added to the equipment window.
  • Removed timer timeout increment in favor of a static value (UI_REFRESH_RATE).
  • Renamed and organized custom imports.
  • The character model dummy is now destroyed when the equipment window is destroyed.
  • Updated UserInterface to v1.0.4.
  • Updated PlayerUtils to v1.2.6.
v1.3.0
  • Rewrote DGUI library and renamed it to "UserInterface". Many improvements were made here which will be announced in a separate thread.
  • Bonus abilities now preload properly, removing the initial lag when equipping an item.
v1.2.1
  • Number of sockets is now displayed in the tooltip.
  • Started rewrite of DGUI library.
  • Fixed a bug that could cause the removed gem bonus amount to be wrong when unequipping.
  • Fixed a bug where the timer timeout could end up below the minimum.
v1.2.0
  • Implemented socketing system.
  • New item type "gem" which can be socketed into gear items for bonus stats.
  • Unit no longer has to have vision of the inventory dummy units to be able to see it (dummies have sight now).
  • Fixed a potential desync in multiplayer.
v1.1.0
  • Added the option for items to have randomized stat values.
  • Implemented a parsing system which allows you to initialize items through a string.
  • Fixed a bug where items that added abilities when acquired (not equipped), wouldn't be removed.
  • Fixed a new bug (from v1.0.5) that wouldn't hide icons when switching pages.
v1.0.5
  • Added function "HERO_WINDOW_NAME" where you can configure what name is displayed in the equipment window.
  • onEquip/onUnequip are initialized to null to prevent a thread crash when they aren't used.
  • Moved equip/unequip event execution to their respective methods (opposed to on click functions).
  • Moved UnitDex check from DGUI library to the inventory & equipment structs.
v1.0.4
  • Fixed an issue where items could disappear and the camera wouldn't follow the unit when switching bag pages.
v1.0.3
  • Dummy units are created per-player instead of per-instance (drastically reduce dummy count).
  • X/Y variables are no longer constant (dynamically move window location).
  • Can now specify scale for models in the preview window.
  • Organized code and modules. Tooltip is now a separate module.
Previews
Contents

Inventory & Equipment System v1.4.1 (Map)

Inventory & Equipment System v1.4.3 (Map)

Reviews
KILLCIDE
Extremely powerful system, and a great example of what your User Interface library can do. As I mentioned in that thread, the logic behind it is beyond me, but I do see the amazing potential and usefulness of having this system in the database. With...
Level 7
Joined
Aug 9, 2009
Messages
274
Holy crap. I've been waiting for something like this to come along for the past many years, and ever since I've started studying software development, I've wanted to create something like this.
Well done mate, it's really bloody cool!
 
Level 12
Joined
Feb 11, 2008
Messages
809
Tested this and i am impressed myself when character screen is open it actually follows with you which is a game changer only real downsides were;

1. bad lag when switching items from inventory to character and when first opening pages
2. you can select 1 item multiple times really quickly and lags down game until you receive a fatal error

Other than those points the system seems to be functioning correctly and the layout its pretty neat.
 
1. bad lag when switching items from inventory to character and when first opening pages
2. you can select 1 item multiple times really quickly and lags down game until you receive a fatal error

I don't experience that at all, and neither has anyone I tested with.

Try changing these values and let me know.

JASS:
// if true a timer will be ran to check selections
// rather than the selection event. this is faster but
// more cpu intensive. it also requires a hardcoded
// delay otherwise buttons will be spammed.
static constant boolean USE_LEFT_CLICK_TIMER = true
static constant real LEFT_CLICK_TIMER_RATE   = 0.01
 
Last edited:
Level 8
Joined
Jan 23, 2015
Messages
121
It is said, it's awesome.
However I noticed a plenty of bugs here: when I'm switching pages in my inventory, camera unlocks from the character and then inv can dissapear from screen with cam movement; switching pages works only half of the times, and rolling up through the 10 pages made my inventory completely empty. Buttons lag sometimes, missing my click on something close to what I was going to click on.
Also any object on the ground behind the inventory interrupts interaction with the inventory, which is kinda annoying because I get my hero deselected.
Needs perfection strongly, until that it's cool to see but not to use.
 
It is said, it's awesome.
However I noticed a plenty of bugs here: when I'm switching pages in my inventory, camera unlocks from the character and then inv can dissapear from screen with cam movement; switching pages works only half of the times, and rolling up through the 10 pages made my inventory completely empty. Buttons lag sometimes, missing my click on something close to what I was going to click on.
Also any object on the ground behind the inventory interrupts interaction with the inventory, which is kinda annoying because I get my hero deselected.
Needs perfection strongly, until that it's cool to see but not to use.

The camera / bag disappearing may be a new issue with 1.0.3 (lots was changed).

The rest can be fixed by changing the configuration. Disable the timer if you want no delay on switching bag pages.

I know there's no documentation yet, but read the configuration people.
 
Last edited:
Updated, v1.0.5.
  • Added function "HERO_WINDOW_NAME" where you can configure what name is displayed in the equipment window.
  • onEquip/onUnequip are initialized to null to prevent a thread crash when they aren't used.
  • Moved equip/unequip event execution to their respective methods (opposed to on click functions).
  • Moved UnitDex check from DGUI library to the inventory & equipment structs.
Is it matches with your save & load system?

Anything that can be represented as an integer, which is anything, can be used with a save/load system.

You can retrieve the items that are equipped like:

JASS:
local Equipment gear = Equipment[GetTriggerUnit()] // any unit

call savecode.save(gear.item[0].id) // or something similar, and for the rest of the gear items
 
Updated, v1.1.0.
  • Added the option for items to have randomized stat values.
  • Implemented a parsing system which allows you to initialize items through a string.
  • Fixed a bug where items that added abilities when acquired (not equipped), wouldn't be removed.
  • Fixed a new bug (from v1.0.5) that wouldn't hide icons when switching pages.
Example of the string parsing system:

JASS:
// Claws of Attack +15
call InitEquipItem.execute('ratf', "Increases the attack damage of the Hero by 15 when worn.^type=weapon; class=1h; icon='D009'; cost=28; ^dmg=15;0;0;")
    
// Robe of the Last Guardian
call InitEquipItem.execute('I007', "Powerful magic robe.^type=armor; lvl=10; icon=B00Z; utype='Ulic'; cost=600; ^def=0;10;20; int=20;0;5; life=300;0;0;")

It's potentially much shorter compared to the default way. It takes a bit more processing power so you should use .execute like above.

The format is "Description ^parameter=value; ^bonus=base;min;max;"

The available keywords are:

Paramaters: type, lvl, cost, abil, utype, icon, class
Bonuses: dmg, def, str, agi, int, ias, hp, mana, manareg, sight, ms, lifereg
Types: weapon, whield, armor, boots, bracers, gloves, belt, helm, pauldron, amulet, pants, ring, shield
Class: 1h
 
Updated, v1.2.1
  • Number of sockets is now displayed in the tooltip.
  • Started rewrite of DGUI library.
  • Fixed a bug that could cause the removed gem bonus amount to be wrong when unequipping.
  • Fixed a bug where the timer timeout could end up below the minimum.
PC84Krf.png


If someone is looking to review the system ignore code optimizations for now because I'm aware of many of them. I will get to it.

with you Codeless Save and Load (Multiplayer) - v1.3.4 i can save my items from this system,

How could I use your save system in your equipment system?

I just answered that question two posts above yours.

EDIT: in gui

  • Set EquipSlot to 5
  • Custom script: set udg_SomeInteger = integer(Equipment[udg_SomeUnit])
  • Custom script: set udg_ItemID = Equipment(udg_SomeInteger).item[udg_EquipSlot-1].id
  • Game - Display to (All Players) the text (Item in slot + EquipSlot + ItemID)
 
Last edited:
Level 1
Joined
Jun 16, 2016
Messages
8
Updated, v1.3.0
  • Rewrote DGUI library and renamed it to "UserInterface". Many improvements were made here which will be announced in a separate thread.
  • Bonus abilities now preload properly, removing the initial lag when equipping an item.
can you help me how to import it?pls
 
Last edited:
Level 5
Joined
Jul 17, 2010
Messages
140
Heey Trigger!
Do you have any plans on implementing your codeless saving system with this inventory and equipment system?

So it saves all items in inventory and equipment?
 
Imo, "Inventory & Equipment UI System" doesn't sound like a fitting name since this is a fully working full screen inventory system, not just the user interface. "Dynamic/Floating Fullscreen Inventory & Equipment System" might do it.

Except that it's not "fullscreen"?

I don't know the name makes sense to me.

"Inventory & Equipment UI"
 
Last edited:
Very impressive system. I really like it. However, I've encounter some annoying bug. After some time, the game freezes when I open the inventory system. It's very annoying and I don't really know what does it.

I have that fixed for the next version already. I also created a dynamic tooltip window, but I'm not sure if people would want it over the current setup.

bK6jD19.png
 
Level 7
Joined
Aug 9, 2009
Messages
274
I have that fixed for the next version already. I also created a dynamic tooltip window, but I'm not sure if people would want it over the current setup.

bK6jD19.png

In all fairness it's a pretty damn neat tooltip.
I wouldn't mind having the option to switch between the dynamic one and the static one, if that's a possibility :)
 
Updated, v1.3.1
  • Tooltip position is now dynamic. It will popup over the item you clicked (see screenshot).
  • Equipment window is now bigger by default.
  • Many more configuration options added to the equipment window.
  • Removed timer timeout increment in favor of a static value (UI_REFRESH_RATE).
  • Renamed and organized custom imports.
  • The character model dummy is now destroyed when the equipment window is destroyed.
  • Updated UserInterface to v1.0.4.
  • Updated PlayerUtils to v1.2.6.
I'm aware there's much more to do and some things are still hardcoded. There will be a guide on importing along with documentation of API when the code is close to complete.

Untitled.png


I wouldn't mind having the option to switch between the dynamic one and the static one, if that's a possibility :)

I'll add a few tooltip options at some point. I was thinking a multiboard one could be useful and Minimage also created a model that can mimick the default tooltip.
 
Level 6
Joined
Sep 19, 2007
Messages
213
thanks alot it worked, i know you said you will include in future versions instructions how to do certain things i was just wonder if you could give me a quick example oh how i would give the equipment and inventory that one unit has to a newly created one ( Example: tier one levels up and can tier in to something new) ive tried for few days im not the greatest at vjass slowly still learning my self but your help would be really appreciated
 
Is there a way to make it so that double clicking an item in your inventory equips it?

Also, the name is a bit off center in the character screen, though it looks fine in your screenshot. Might be due to shorter name?

7QAbvNb.jpg


Anyways it's a pretty cool system, definitely using this.
 
Last edited:
Level 16
Joined
May 1, 2008
Messages
1,605
..and next we have an in-game mail system? with the possibility of sending items as attachments? I like this system here, tho there are some things. When I use a different hero of the 4 pre-sets, their model is not displayed in the character menu. How can I change that?
YwQolml.jpg


Also when using Metamorphosis on Demon Hunter and/or Robo-Goblin on Tinker the buttons "Inventory" and "Character" disappear upon transforming. When transforming back to normal tho, those icons remain gone
(Storm, Earth and Fire works fine tho o_O)
 
Top