• 🏆 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!

A modern Inventory and Equipment system prototype

Level 17
Joined
Apr 13, 2008
Messages
1,597
Hey folks,

I've been working on this for a few weeks now in my scarce insomniac free time.

Currently the code is a mess (had to rewrite everything a couple of times as I learned about new bugs and shortcomings of Warcraft).
There are probably leaks.
There are probably possibilities for desync.
So don't look at the code yet or you'll turn into a pillar of salt.
The Inventory and Equipment system should work well without bugs in Single Player.

Please test if you are interested either this test map, or your own map that has items. I'm looking for any bugreports, input, criticism. No dckpix!!

I'll keep updating the map here, then once all the kinks are hammered out I'll release it for everyone on Hive and try to blackmail Bribe to approve it. Then I have a lot of planned features, and will keep adding more and more until the suite is complete, in accordance with the google doc below.

Attached is the map.
Last updated: 2023 Dec 2

I started documenting stuff regarding configuration and planned features:
 

Attachments

  • DestroyerInventoryAndEquipmentSystem Prototype 2023 Dec 2.w3x
    1.7 MB · Views: 7
Last edited:
Level 17
Joined
Apr 13, 2008
Messages
1,597
Version History:

Prototype 2023 Dec 02
-Named items
-Item rarity
-Inventory icon outline sprites
-Itemlevel
-Item gold value database and functions. Trigger to watch items sold to a shop
-A slightly better automatic tooltip generator
-Various new features, bug fixes

Prototype 2023 Nov 06
-Expanded stats to 33 different stats. More information in the google doc.

Prototype 2023 Oct 31
-New feature: Added a character sheet (text type frame) under hero portrait. Currently only tracks HPS and MPS gained from Equipment when those values are not 0, but you may configure it as you want. Just adjust the code in function UpdateDEqCSheet from SharedDInvLib.
-New feature: Dual Wield. Added an ability and the relevant code so units with the ability "Dual Wield" ( abil id: 'DQDW' ) can equip all main hand slot items in the offhand slot.
-New feature: Titan's Grip. Added an ability and the relevant code so units with the ability "Titan's Grip" ( abil id: 'DQTG' ) can equip all 2 handed weapons as if they were 1 handed weapons.
-In case the unit has both DW and TG, they can dual wield 2H weapons.
 
Last edited:
Level 17
Joined
Apr 13, 2008
Messages
1,597
Ya cannot blackmail a bribe. There is only Bribe.
Notice how I utilize your new multiple dimension tables! ;)

For example:

Table3DT
DInvUnitHandleDB[UnitHandleID][0].unit[0]
Unit is stored
DInvUnitHandleDB[UnitHandleID][0].integer[1]
PID is stored
DInvUnitHandleDB[UnitHandleID][0].integer[2]
HID is stored
DInvUnitHandleDB[UnitHandleID][0].integer[3]
EQID is stored
DInvUnitHandleDB[UnitHandleID][1].real[x]
Equipment granted Stats are stored. (x is the statId)
DInvUnitHandleDB[UnitHandleID][2].integer[x]
Equipment granted AbilityIds are stored.
DInvUnitHandleDB[UnitHandleID][3].integer[x]
Equipment granted Ability levels are stored.
DInvUnitHandleDB[UnitHandleID][4].item[x]
Equipped items. X is slotID
DInvUnitHandleDB[UnitHandleID][5].real[x]
Provided stats by all items. X is statID
DInvUnitHandleDB[UnitHandleID][6].integer[0]
How many abilities items give this unit
DInvUnitHandleDB[UnitHandleID][6].integer[x]
Provided ability IDs by all items. X is just a loopi.
DInvUnitHandleDB[UnitHandleID][7].integer[x]
Provided ability levels by all items. X is just a loopi.
 
Level 8
Joined
May 19, 2016
Messages
146
If you double click some items they swap into the BasicWc3 inventory and give stats to the Hero.
I think thats a bug right ? because you made an Equipment System for giving the Item boni
 
Level 17
Joined
Apr 13, 2008
Messages
1,597
If you double click some items they swap into the BasicWc3 inventory and give stats to the Hero.
I think thats a bug right ? because you made an Equipment System for giving the Item boni
That is not a bug. I just did not remove those stats from the default Warcraft III items.
Maybe I should do that in the test map as a clarification.

My system does not touch how vanilla items work in the vanilla inventory.
The user is expected to create items that do not give any stats in the vanilla inventory. Or do whatever he wants.
 
Level 17
Joined
Apr 13, 2008
Messages
1,597
No, you make a good point. I have to think how should I communicate this best.

It is important for me that the default items are not changed in the test map, because this way the object data is safer to export. I think I'll just make a note about this once I release the 1.0 system.

Edit:
Ok, I put a FAQ point about this in the documentation:

Why do items still give a stat bonus in the vanilla inventory?
My system does not affect how items behave in the vanilla inventory. It is up to you to decide if you want them to give stats in the vanilla inventory. I suggest that makes no sense, and you should remove all abilities from your items in the Object Editor, and let the system handle your custom defined items instead.
 
Last edited:
Level 20
Joined
Jul 12, 2010
Messages
1,717
wow man this system it actually pretty good! are you still working on it? because I have some suggestions.

1) Hero Equipment slots don't have any text when empty, making it difficult to know which items goes where
2) You are not using right click in your system, you could:
-right click items to equip them to the appropriate slot
-right click items to un-equip them instead of double left click(personal preference)

I personally think this system is great and could definitely evolve into something awesome!
 
Level 17
Joined
Apr 13, 2008
Messages
1,597
Thanks for the kind words!

Yes, I am still working on it. I planned to release a 1.0 weeks ago, but alas, some of my contracts at work became very hectic, and I could not open the World Editor for a week or two now.
That being said, a ton of stuff is already finished since I last uploaded a version here. I'll try to release a new prototype version in the coming days.

1.) That is a good idea. I'll implement that.
2.) Yes, right click equip is planned. The problem is that in Warcraft 3 the right click frame events are bugged and do not work. So if you want right click, you have to do it via a convoluted workaround. Which I planned for later
 
Level 17
Joined
Apr 13, 2008
Messages
1,597
Hello guys,
I attached a new prototype of the system.
Due to a lot of stupid stuff at work I am progressing slower than I hoped. But steadily.

More information on various features is in the documentation (link in the main post), and examples can be found in the test map (updated the file in the main post).

Brief summary of changes & new features:
-Equipment Item Rarities - You can now define equipment to have various rarities (you also define the rarities yourself), for example, Standard, Rare, Epic, Legendary. You can define their model colour on the ground, their text colour in the tooltip, their stat multiplier and gold value multiplier. You can give their icons cool "gif" outlines. This happens on a per item basis, not an item type basis.
-Non-equipment Item Rarities - You can define the rarity of non equipment items. This happens on an item type basis, and is purely cosmetic (tooltip colour, inventory slot outline). Think rare crafting materials or consumables, or quest items, for example.
-You can now define the gold value of items - Funnily enough, Blizzard does not allow us to get the cost of an item, there is no GetItemGoldCost function. So mappers need to keep the value of their items in a database somewhere, which they have to build manually. With the system a trigger is also included to intercept shop sales (items dropped by the player on the shop) and give the selling player the appropriate amount of gold.
-Named items (think Diablo's Unique items) - You can now define named items and their stats, custom icons and names, of course. This happens on an item basis, not an item type basis.
-Itemlevels - You can now assign an item level to an item. You can define stat and gold value multiplier to itemlevels. So a lvl1 helm may provide 100 HP, and you may define itemlevels to grant a 10% stat bonus per itemlevel, so that ilvl11 helm will grant 200 hp.
-These subsystems may overlap. So you can have an Epic Rarity item, which is also a Named item, which also has an Itemlevel.
-System generated tooltips became a bit nicer (more improvements in the future, some cosmetic bugfixes too). They now follow the X coordinates of the item you are viewing. They now show gold value. They are now sized automatically on the Y axis. (I will probably hide empty tooltips)
-Various bug fixes
-Various optimization in the code
 
Last edited:
Top