• 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.

[vJass] (System) CustomInventory

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
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...
Antares
While great at the time, this system uses an outdated implementation and has not survived the test of time. Simple
Level 13
Joined
Jun 9, 2009
Messages
1,135
Anachron, I was downloaded new version of your inventory, but hero again issues orders, and whats happened with selection circles? - And why one-handed weapon when is moved to slot (Hand-left or right) is unable to change hand can only be backed on empty equiping slots. All other work fine.
 
but hero again issues orders, and whats happened with selection circles?
Your hero is paused until the inventory is fully loaded. So have patience because this might take a bit time on slow pcs.

And why one-handed weapon when is moved to slot (Hand-left or right) is unable to change hand can only be backed on empty equiping slots.
Whats the purpose of moving items to another equipment slots anyway?
The reason you can't do it is that I did NOT program it.
 
Yes, its already on the ToDo-List to remove that. Please read the other post (atleast the last 10) before you post. It has been discussed on the last page.

Anachron, allow me to redirect:
lol, thanks xD

# Update - 0.1.Y

Changelog
Rightclick orders are now prevented when inventory is watched.
Borders are now removed from the actual map and created at map initialisation.
Created a new oject to easily create borders.
 
Last edited:
Level 14
Joined
Mar 30, 2009
Messages
971
so i tested it again. it was freaky.

first time i ran it, i opened hero abilities, chose divine shield and when i opened inventory (not instantly, t>1) all icons where white again!!! o_O i wasnt able to reproduce it in the second game, doing same things.

seondly, some of the items disappeared completely!! one game it was shaman claws. just picked up and gone. other game i was checking around healing potions and then the pots disappeared.

thirdly, when i pick up potions i get an icon for each potion i pick, although all of them stack in one slot O.O!!


so yeah. freaky.
(good i didnt delete older versions)

EDIT: i tryed more. I EVEN MANAGED TO CRASH W3!! what i did was: pick up healing pot, open hero abilities, selest a level for divine shield and when i opened inventory then w3 crashed. also i made sure that, you cant move items on to the slot of healing potion icon (multiboard says NO_ITEM, all healing potions are stacked in another slot). so icon block + slot block bug
 
first time i ran it, i opened hero abilities, chose divine shield and when i opened inventory (not instantly, t>1) all icons where white again!!! o_O i wasnt able to reproduce it in the second game, doing same things.
Wehrm? THat is really weird.

seondly, some of the items disappeared completely!! one game it was shaman claws. just picked up and gone. other game i was checking around healing potions and then the pots disappeared.
Sure you picked it up? :S

thirdly, when i pick up potions i get an icon for each potion i pick, although all of them stack in one slot O.O!!
You have to wait 1 second for the inventory to refresh.
 
Level 5
Joined
Jun 29, 2009
Messages
142
Ok so I don't know jass and i was wondering... If I wanted to use the GUI command to "give item to hero" would that put the item in the normal inventory (6 slots) or would it be added to the inventory system you made? Tell me if my question isn't clear enough.
 
Please do NOT talk about installation here.
You need the latest JNGP and JassHelper version.
I already provided links.

the inventory slots are blank... I mean they are just shown as white boxes and even if I have an item in then slot is is still white... I downloaded last week..
Download the newest version.
 
Level 14
Joined
Mar 30, 2009
Messages
971
i launched the map, pressed any key to start game (LMB in my case), waited until game time became 6:00 (waited 120 seconds), then selected the paladin with F1. i clicked F1 again to center my camera to him and i clicked Esc to display inventory. all icons were white. when i restart game (without restarting w3), all icons work perfectly.
when i click esc really fast while white-iconness is present, the normal icons flicker for a second. so i have no idea why they are turned into white in 0.5 seconds O.O

I use no addons or 3rd party programs. i have JNGP, but i dont know how to use it. so i dont launch anything at all with my english w3 (not the last patch though, the one that blocks some hackers on battlenet). since i dont edit the map, just test it, then i dont need JNGP for it, right?

i have english windows XP Professional with SP2
Intel Celeron 2.4 GHz
512MB RAM
2GB free space on system HD
 
i launched the map, pressed any key to start game (LMB in my case), waited until game time became 6:00 (waited 120 seconds), then selected the paladin with F1. i clicked F1 again to center my camera to him and i clicked Esc to display inventory. all icons were white. when i restart game (without restarting w3), all icons work perfectly.
when i click esc really fast while white-iconness is present, the normal icons flicker for a second. so i have no idea why they are turned into white in 0.5 seconds O.O

I use no addons or 3rd party programs. i have JNGP, but i dont know how to use it. so i dont launch anything at all with my english w3 (not the last patch though, the one that blocks some hackers on battlenet). since i dont edit the map, just test it, then i dont need JNGP for it, right?

i have english windows XP Professional with SP2
Intel Celeron 2.4 GHz
512MB RAM
2GB free space on system HD

I have the same problem, icons are all white...
 
Level 5
Joined
Jun 29, 2009
Messages
142
You should change the background icon for the potion slot to a DISBTN image of a potion instead of the same icon background as the inventory slots.

Also maybe use the inventory icons that are in most other inventory systems (the same ones from WoW) I can put them in a pastebin if you want.
 
Level 5
Joined
Jun 29, 2009
Messages
142
http://www.hiveworkshop.com/forums/pastebin.php?id=zbwe7s

That links to the icons which include: (Let me know if you need any others)
-Amulet, Armor(Chest), Belt, Boots, Cancel, Drop, Gloves, Helm, Cell(empty slot), Pants, Potion, Ring, Shield(if you need it), Shoulder, Weapon

Hope those help. Just think it will help distinguish the certain equipment slots. (It is sometimes hard to tell between the chest and shoulder slots)

Lemme know if the link works, this is my first pastbin.
 
Level 20
Joined
Jan 6, 2008
Messages
2,627
dude, i picked up all the items really quick, and then i got like 50% of those items, when i opened the inventory the first slot became empty, i took potion in belt, weared a helm, tried to put an other potion, couldnt equip item msg, suddenly i got a healing potion, couldnt equip anything in weapon slot :S
 
Level 12
Joined
Feb 11, 2008
Messages
809
dude, i picked up all the items really quick, and then i got like 50% of those items, when i opened the inventory the first slot became empty, i took potion in belt, weared a helm, tried to put an other potion, couldnt equip item msg, suddenly i got a healing potion, couldnt equip anything in weapon slot :S

yea he will probably have to make a preload for this so it doesnt glitch like that...
 
Top