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

[vJass] (System) CustomInventory

By far the biggest inventory system for Warcraft 3.
It's designed to have optional features, like FullScreenInventory-UI.

With a little bit of modification you can use this Inventory System in the normal Warcraft 3 Inventory too.

It is written in vJASS and has the following features:
- 12 Slot Equipment
- MPI
- Very flexible
- Easy to add bonuses to items
- Item Stacking
- Item Forging
- Item Sets (With bonuses)
- Inventory fixes warcraft 3 bugs (Double pickup bug)
- Fast
- Gives the ability to add your own areas with a little bit of code

A small note on the classes:

##############################################################################
# USER INTERFACE - CUSTOM WINDOW
##############################################################################
---------------
CWDestructable
---------------
It's an object that has an destructable for a local player.
(Such as icons, borders and more)

---------------
CWTrackable
---------------
This is basically an object that triggers player events for hovering the icons (CWDestructable).
Whenever an event occurs, it fires an action to the CustomWindow

---------------
CustomWindow
---------------
A collection of CWTrackable and CWDestructable. Every destructable will have an trackable object.
So whenever you hover over or click a trackable, this will be fired.
You will use this object to create hooks to the inventory system.

##############################################################################
# CUSTOM WINDOW - HOOK AND EXTENDING
##############################################################################

---------------
CIAll
---------------
This is a container object of items. It has conditions for pickup and drop and is the base
class for any container, like Slots, Potions, Equipment or even spell slots that you could create!
It has a variety of methods like adding, removing and checks and throws errors.

---------------
CIActions
---------------
This is a library which only use is to find out what the user wants to do. It supports up to 5
different steps which can be done in a row so if you need to build up something complicated here you go.
This action decides when to move, drop, pick and destroy items. It's bound to CIWindow and uses its
events to trigger / delegate events to the CISlots/CIEquips/CIPotions objects.

---------------
CIContent
---------------
This is a little help class for the CIActions object which puts a wrapper around the Equipment,
Potions and Slots. It will also update the camera.

---------------
CIWindow
---------------
This is the hook between CustomWindow, CIActions and the CustomInventory. It also provides
fake units to provide the Interface Functionality and delegates events to CIActions.

---------------
CISlots / CIEquips / CIPotions
---------------
The containers you see (Top left, top right and bottom left) are basically these objects.
They have special / unique conditions for pickup / drop and handle when to add or remove bonuses from the hero.

##############################################################################
# CUSTOM INVENTORY - CORE
##############################################################################

---------------
CIForging
---------------
This module forges items. You can combine any items and merge them to a bigger item. This will
always happen when your inventory updates.

---------------
CIStacking
---------------
You like items that can stack in your Inventory? Well this module is for you!
Create stackable items and make a maximum conditions. Item stacking is automatic, whenever
inventory updates.

---------------
CISet
---------------
Don't we all love this thing from World of Warcraft? Collecting items of a special set and
then get some bonus stuff once we have all of them. If you are cool, use this feature. It
even supports SET STACKING!

---------------
CIAttachment
---------------
Not done yet.

---------------
CIBonus
---------------
This is the hook between items and the unit state modifier library. You can use this module
to add and remove bonuses to the hero on the fly whenever needed.

---------------
CIError
---------------
Throw errors to the user whenever something bad happens.

---------------
CIEventHandler
---------------
Like every other Inventory system, we need some kind of hook for pickup/drop actions to
connect them with our CustomInventory. This will trigger the CustomInventory events.

---------------
CIEvents
---------------
Name may not be completely self-speaking, but this actually triggers the events on the item.
But only when the unit really has the item. (Safety layer)

---------------
CIItemDrop
---------------
This will allow pickup/drop actions of the items WITHOUT triggering the inventory events.
It will be required for many things so this module is a life safer!

---------------
CIItemInfo
---------------
Wouldn't it be cool if items could display what they are in a multiboard. Yes it would.
This module is exactly for that.

---------------
CIItemBoard
---------------
Yes, this is the multiboard which displays all the item statistics. It uses hooks to get
the attached events from the CUstomWindow.

---------------
CIItemProtection
---------------
Every item has states, like locked, owend, equiped and such. This module gives the ability
to change the states and make them available.

---------------
CIItemDest
---------------
Simple module for setting the destructable (icon) for the CustomWindow.

---------------
CIItemSeek
---------------
Module which is build to search and collect information about the inventory.
Find out how many items of which type you have that are not stacked, find out how many duplicated
items you have and even if you have errors in your inventory indexing.

---------------
CIItemSlot
---------------
Small module that adds classes to the items. You can only equip items with the right class
on the right positions.

---------------
CIItemEffect
---------------
This module allows to attach effects to an item wearer. Do whatever you want, but keep in mind
that one item has a maximum of 3 effects.

---------------
CIPowerup
---------------
Not done yet.

---------------
CISetup
---------------
Changes the area around the inventory to be black and create the UI for all players.


---------------
CustomItem
---------------
The item object itself. Will trigger and get triggered from all kind of sources.
Modules are completing the collection of members and methods.

---------------
CustomInventory
---------------
The main object. It forges, stacks, creates sets, triggers events, gets triggered and uses
optional modules to provide the full repository of features to the user.



-Fixed a bug found by Dr. Boom:
Dead units were able to change the inventory and caused bugs.
-Also added a little bit of documentation.


Keywords:
CustomInventory, Inventory, Custom, Anachron, FullScreen, Module, vJass, Stack, Forge, Combine, Set, Powerup, Drop, Equip, Equipment, Equip, System
Contents

CustomInventory - 0.2.2.6 (Map)

Reviews
18:27, 18th Feb 2010 The_Reborn_Devil: Ohsh- That describes pretty much what I'm thinking. My eyes were sore even before I was done reviewing half of the code. The code looks really good and I couldn't find just one little thing that would be...
Level 5
Joined
Jun 29, 2009
Messages
142
Here are a few things I've noticed and I'm sure many of them have been said, but I just want to put them all in the same place:

1)The potion slots should have potion icons to separate them from the normal slots
2)When you mouse over the exit button, drop button or any of the armor slots, the board should say what it is
3)You used the name "hand" for the weapon slot (I think "weapon" would be better because people can confuse hand and gloves i guess
4)I think it would be less confusing to use the inventory icons i linked to so that people can distinguish the slots
 
Level 5
Joined
Jun 29, 2009
Messages
142
I'd say that the system is really progressing, can't say I find any bugs (just the items getting picked up fast). The only thing I really care about now is just adding features that make it for universal and useful (such as the sell to vendor thing)

Very nice job so far and congratulations on making directors cut, you really deserve it!
 
Level 12
Joined
Feb 11, 2008
Messages
809
I just downloaded and tried the newest version and i dont know what is wrong but i still can only see white boxes when i open up the inventory and its not my resolution settings causing it since i changed them then tried it again do you have any idea how this is happening?
 
Level 12
Joined
Feb 11, 2008
Messages
809
Restart the map, it should be fine then. (F10, Restart Mission)

Alright i just tried it and still nothing just white boxes i even tried restarting 3 different times all are still white then i tried pressing the "Esc" key really fast and it shows the slots until it comes all the way up then they turn white i dont know what that means but maybe it will help you fix it.....
 
Level 5
Joined
Jun 29, 2009
Messages
142
Yea the white icon bug must be something to do with peoples computers because I have never experienced it on my computer when testing the map.

Does it still cause bugs? Please try that, It shouldn't.

No, I just tested that and I no longer bugs when picking items up fast. Very nice fix. :)

One more thing... When I use the blue icon to deselect an icon, it does but then it selects the blue icon. I think it would be better if it just deselects the item and nothing else.
 
Level 14
Joined
Mar 30, 2009
Messages
971
Restart the map, it should be fine then. (F10, Restart Mission)

worked for me. though i tried if i could bug the icons to be white again, after already running the map once (it always showed white on the first time), and i succeeded.

but i think it is bad, when you have to restart an rpg, so that the inventory would work for all players :p

also when picking up potions really fast (didnt succeed with items, maybe because they arent so close to each other), the items bugged. i did this several times. after this i couldnt pick up items, some dissappeared from inventory, then reappeared again. confusion. :S
 
Level 7
Joined
Apr 2, 2009
Messages
249
worked for me. though i tried if i could bug the icons to be white again, after already running the map once (it always showed white on the first time), and i succeeded.

but i think it is bad, when you have to restart an rpg, so that the inventory would work for all players :p

also when picking up potions really fast (didnt succeed with items, maybe because they arent so close to each other), the items bugged. i did this several times. after this i couldnt pick up items, some dissappeared from inventory, then reappeared again. confusion. :S

Yeah, i agree !
Also, i'm a bit confused when trying to equip some items. I just don't know which type it is and which slot to equip it !
 
Level 12
Joined
Feb 11, 2008
Messages
809
I just thought of another feature you can add to this inventory system.

Make it so that people can limit the number of certain items in an inventory at 1 time.

I know most people probably wouldn't use that feature but i shure would since it would make it a ton better for ORPG's.
 
Level 17
Joined
Jun 9, 2007
Messages
2,493
I just thought of another feature you can add to this inventory system.

Make it so that people can limit the number of certain items in an inventory at 1 time.

I know most people probably wouldn't use that feature but i shure would since it would make it a ton better for ORPG's.

Yeah, i suggested that in the development thread.
But it seems like he never added it?
But there we called it unique (like in wow..) and we also talked about soulbound features, idk if he actually added that tbh xD
 
Level 14
Joined
Mar 30, 2009
Messages
971
he said something like all these features can be added, but are not included. though i personally too hope for a little more features. at least vendor trading.

when you select an item and click on another item, they should swap positions. that should work for equipped items too (when the swapped item can be equipped ofc)
when you select an item and click the same item again, it should unselect the item (empty selection).
all buttons should have hovering tooltips (e.g. exit). i think this was suggested already <.<
Make it so that people can limit the number of certain items in an inventory at 1 time.

imo i would just let the map have only one of that item at all (unique in game). i know its not the same thing, but thats what i would do.
 
Yeah, i suggested that in the development thread.
But it seems like he never added it?
But there we called it unique (like in wow..) and we also talked about soulbound features, idk if he actually added that tbh xD
Well, you can have 4 potions and the equipment only, and limiting items would be possible, but its not having a priority atm. sorry.

when you select an item and click on another item, they should swap positions. that should work for equipped items too (when the swapped item can be equipped ofc)
when you select an item and click the same item again, it should unselect the item (empty selection).
all buttons should have hovering tooltips (e.g. exit). i think this was suggested already <.<
Selection: okay.
tooltips: yes, already have that in mind.

at least vendor trading.
that isn't something you make in one minute. Also this has not really high priority because I will mostly have to fix all the bugs before I can do that system.

I think he once said to me that this system won't have merchants interface :p
He could certainly insert a separate system which relies on this though :3
I will mostly add it as an addon, but first, the stupid white bug has to be fixed.

well if you could put items of any kind into the potion belt (normal w3 inventory), then there wouldnt be a desperate need for such system. i really did think that it was a feature (until the bug was pointed out and fixed) XD
Actually that was a feature at first, but people seemed not to like it, so i removed it, because most of them got confused about that.
 
I think that before any features like that are added, his main goal should be to make it bug free.
Yes.

After that a sell to vendor system would probably be the most important feature to make next.
No, and please stop saying that. :p
I don't know what I will do then.

When we suggest things, he add it on his to-do list, and work on the important things first. :)
exactly.

A duration system, after the time is done, the item dissapears.
Have a problem with dropping items while expiring can cause massive bugs.
 
Level 12
Joined
Feb 11, 2008
Messages
809
Are you going to later implement a ReadMe that has all the custom scripts that are used in the system showing how to call them and telling what each one does and would be used for?

I know that would take a very long time for this system since its so big but it would make people want it a lot more.

Hope this helps

~CHA
 
Level 12
Joined
Feb 11, 2008
Messages
809
Yea that bug is really annoying and is a really big problem since the inventory is useless if you cant see what the slots are.

Also i dont see why anyone would have problems using it in its current state just look at the trigger you made called "test" then you can see how to call 80-90% of all the triggers you need. ;)
 
Level 17
Joined
Jun 9, 2007
Messages
2,493
The white bug.. Agh.. I still have it aswell (it is like 50/50 if it will work or not).
The white bricks appear above the icons insted of below then, you can see that by using mouse scroll, the white buttons will start to flash and you will see the buttons that is under...
 
Level 12
Joined
Feb 11, 2008
Messages
809
The white bug.. Agh.. I still have it aswell (it is like 50/50 if it will work or not).
The white bricks appear above the icons insted of below then, you can see that by using mouse scroll, the white buttons will start to flash and you will see the buttons that is under...

Yea he has already stated thats the problem and that it has something to do with the trackables above the slots not the slots themselves.
 
Level 14
Joined
Mar 30, 2009
Messages
971
yes, it does for me

EDIT:
o - whatever i do it always white-bugs on the first run of the map (during one w3 runtime).
o - when i pick items up really fast (consecutively, not right after game starts), then i can recreate the white bug even when i already played the map on this specific w3 runtime. also i cant pick up items anymore.
o - i can (still) equip potions and the helmet as a weapon. the helmet even gives all it's buffs/bonuses.
 
Top