1. Are you planning to upload your awesome spell or system to Hive? Please review the rules here.
    Dismiss Notice
  2. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  3. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  4. The Lich King demands your service! We've reached the 19th edition of the Icon Contest. Come along and make some chilling servants for the one true king.
    Dismiss Notice
  5. The 4th SFX Contest has started. Be sure to participate and have a fun factor in it.
    Dismiss Notice
  6. The poll for the 21st Terraining Contest is LIVE. Be sure to check out the entries and vote for one.
    Dismiss Notice
  7. The results are out! Check them out.
    Dismiss Notice
  8. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  9. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  10. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[vJass] (System) CustomInventory

Submitted by Anachron
This bundle is marked as approved. It works and satisfies the submission rules.
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:
Basic readme for developers

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


0.2.2.6

-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
Moderator
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...
  1. CHA_Owner

    CHA_Owner

    Joined:
    Feb 11, 2008
    Messages:
    801
    Resources:
    2
    Spells:
    2
    Resources:
    2
    All i can say is +rep not 1 bug for me :grin:
     
  2. Vengeancekael

    Vengeancekael

    Joined:
    Aug 11, 2009
    Messages:
    5,746
    Resources:
    16
    Tools:
    1
    Maps:
    13
    Spells:
    1
    StarCraft II Resources:
    1
    Resources:
    16
    Alright now implement this in d3w and release 1.20 already :p
     
  3. Catch_ya

    Catch_ya

    Joined:
    May 21, 2009
    Messages:
    982
    Resources:
    1
    Spells:
    1
    Resources:
    1
    What about turning on the ESC trigger 1 second after the game start?
     
  4. Anachron

    Anachron

    Joined:
    Sep 9, 2007
    Messages:
    6,176
    Resources:
    66
    Icons:
    49
    Packs:
    2
    Tools:
    1
    Maps:
    3
    Spells:
    9
    Tutorials:
    1
    JASS:
    1
    Resources:
    66
    The bugs only appear when you INSTANTLY pickup all the items, so I guess its just overloading the wc3 to cause random bugs.

    Good idea, I will implement it in the next version.
     
  5. CHA_Owner

    CHA_Owner

    Joined:
    Feb 11, 2008
    Messages:
    801
    Resources:
    2
    Spells:
    2
    Resources:
    2
    Actually i have a bug to report whenever i try to save the map using JNGP with EGUI it gives me this error (image attached)

    EDIT*

    my bad thats hard to read it says:
    Line 923: unable to find textmacro: "optional"
     

    Attached Files:

  6. Anachron

    Anachron

    Joined:
    Sep 9, 2007
    Messages:
    6,176
    Resources:
    66
    Icons:
    49
    Packs:
    2
    Tools:
    1
    Maps:
    3
    Spells:
    9
    Tutorials:
    1
    JASS:
    1
    Resources:
    66
    This was asked before.
    Also answered.
     
  7. mattstheman

    mattstheman

    Joined:
    Jun 29, 2009
    Messages:
    141
    Resources:
    0
    Resources:
    0
    Same here... when you equip a two handed weapon it would make sense to remove the other weapon slot.
     
  8. Anachron

    Anachron

    Joined:
    Sep 9, 2007
    Messages:
    6,176
    Resources:
    66
    Icons:
    49
    Packs:
    2
    Tools:
    1
    Maps:
    3
    Spells:
    9
    Tutorials:
    1
    JASS:
    1
    Resources:
    66
    Yes, but its kinda hard to program.
     
  9. CHA_Owner

    CHA_Owner

    Joined:
    Feb 11, 2008
    Messages:
    801
    Resources:
    2
    Spells:
    2
    Resources:
    2
    Alright i did what you said and it worked at first but when i saved a second time i got this error:

    External not found in config file: "ObjectMerger"

    sorry to bother you anachron
     
  10. Catch_ya

    Catch_ya

    Joined:
    May 21, 2009
    Messages:
    982
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Sorry if I missed something but where do you declare that the item slots and such is trackables? I need to change it to units. Will this be a big problem?
     
  11. Anachron

    Anachron

    Joined:
    Sep 9, 2007
    Messages:
    6,176
    Resources:
    66
    Icons:
    49
    Packs:
    2
    Tools:
    1
    Maps:
    3
    Spells:
    9
    Tutorials:
    1
    JASS:
    1
    Resources:
    66
    Install a new JNGP version.

    Its a bigger thing. I will make it easier in the future.
     
  12. Catch_ya

    Catch_ya

    Joined:
    May 21, 2009
    Messages:
    982
    Resources:
    1
    Spells:
    1
    Resources:
    1
    well I guess I have to wait more :D. By the way im glad you finished this congratulations.
     
  13. CloudMax

    CloudMax

    Joined:
    Jun 9, 2007
    Messages:
    2,438
    Resources:
    1
    Tutorials:
    1
    Resources:
    1
    Directors cut. This system soooo deserves it! Awesome that it is finally here! now i can try it myself insted of seeing you using it live :p
     
  14. CHA_Owner

    CHA_Owner

    Joined:
    Feb 11, 2008
    Messages:
    801
    Resources:
    2
    Spells:
    2
    Resources:
    2
    Yep system works fine now i just needed to update my jass helper thanks again anachron there not enough rep in the world :thumbs_up:
     
  15. Anachron

    Anachron

    Joined:
    Sep 9, 2007
    Messages:
    6,176
    Resources:
    66
    Icons:
    49
    Packs:
    2
    Tools:
    1
    Maps:
    3
    Spells:
    9
    Tutorials:
    1
    JASS:
    1
    Resources:
    66
    No problem. Glad it helped.
     
  16. 88WaRCraFT3

    88WaRCraFT3

    Joined:
    Jun 9, 2009
    Messages:
    1,139
    Resources:
    1
    Spells:
    1
    Resources:
    1
    I nice idea that can be add : something like double click on an item and that item will replace or move instantly to slot where it must be.
     
  17. Anachron

    Anachron

    Joined:
    Sep 9, 2007
    Messages:
    6,176
    Resources:
    66
    Icons:
    49
    Packs:
    2
    Tools:
    1
    Maps:
    3
    Spells:
    9
    Tutorials:
    1
    JASS:
    1
    Resources:
    66
    Yeah, already suggested! :) Thanks anyway :)
     
  18. CHA_Owner

    CHA_Owner

    Joined:
    Feb 11, 2008
    Messages:
    801
    Resources:
    2
    Spells:
    2
    Resources:
    2
    Alright after playing around with your system some i found that if you clear the players selection when he presses the Esc. key (opens the inventory) that there will be no false right clicks which is what currently happens.

    This is just a quick fix of course but you might want to try to get Ammorths right click detection script and disable right clicks while the inventory is opened which would be much more efficient then what i did.

    Just thought this might help good luck on making this awesome system.
     
  19. Anachron

    Anachron

    Joined:
    Sep 9, 2007
    Messages:
    6,176
    Resources:
    66
    Icons:
    49
    Packs:
    2
    Tools:
    1
    Maps:
    3
    Spells:
    9
    Tutorials:
    1
    JASS:
    1
    Resources:
    66
    Well I will just disable target object orders. So no problem.
     
  20. Roolipelaaja

    Roolipelaaja

    Joined:
    Feb 15, 2010
    Messages:
    7
    Resources:
    0
    Resources:
    0
    Niceeeeeeeeeeeeeee!