1. Are you planning to upload your awesome spell or system to Hive? Please review the rules here.
    Dismiss Notice
  2. And she's bought a stairway to heaven. The 6th Special Effect Contest Results are here.
    Dismiss Notice
  3. Seek unity between the elements in the 22nd Terraining Contest Poll.
    Dismiss Notice
  4. Seize the moment! The 18th Mini Mapping Contest has commenced.
    Dismiss Notice
  5. The heavens smile on the old faithful. The 16th Techtree Contest has begun.
    Dismiss Notice
  6. 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. CBX Entertainment

    CBX Entertainment

    Joined:
    May 30, 2009
    Messages:
    271
    Resources:
    1
    Maps:
    1
    Resources:
    1
    possible solution: create the trackables like 16(x)/-16(y) units away from the current position?
     
  2. Anachron

    Anachron

    Joined:
    Sep 9, 2007
    Messages:
    6,220
    Resources:
    66
    Icons:
    49
    Packs:
    2
    Tools:
    1
    Maps:
    3
    Spells:
    9
    Tutorials:
    1
    JASS:
    1
    Resources:
    66
    They are, maybe you should redownload and check the example.
     
  3. Anachron

    Anachron

    Joined:
    Sep 9, 2007
    Messages:
    6,220
    Resources:
    66
    Icons:
    49
    Packs:
    2
    Tools:
    1
    Maps:
    3
    Spells:
    9
    Tutorials:
    1
    JASS:
    1
    Resources:
    66
    Okay guys, thanks all for downloading.
    Now 250 downloads without a single comment.
    Are you afraid to post a comment what you like/dislike about this inventory?

    Please rate it.
     
  4. lelyanra

    lelyanra

    Joined:
    Sep 4, 2007
    Messages:
    380
    Resources:
    25
    Icons:
    25
    Resources:
    25
    and make the system do not require it's modules?! cuz it's completelly dependant from some modules.
     
  5. Anachron

    Anachron

    Joined:
    Sep 9, 2007
    Messages:
    6,220
    Resources:
    66
    Icons:
    49
    Packs:
    2
    Tools:
    1
    Maps:
    3
    Spells:
    9
    Tutorials:
    1
    JASS:
    1
    Resources:
    66
    Yes, ... That was also basically an idea. But it'll be hard.
     
  6. mattstheman

    mattstheman

    Joined:
    Jun 29, 2009
    Messages:
    141
    Resources:
    0
    Resources:
    0
    How goes the attachment system? I thought that is what you said you were working on last time i checked in. How's that going for you?
     
  7. Anachron

    Anachron

    Joined:
    Sep 9, 2007
    Messages:
    6,220
    Resources:
    66
    Icons:
    49
    Packs:
    2
    Tools:
    1
    Maps:
    3
    Spells:
    9
    Tutorials:
    1
    JASS:
    1
    Resources:
    66
    Ah yes,... I don't know how I should handle it.
    Should you be able to attach one attachment per item or endless?
    If endless [1:n] it'll be unmakeable that you can access to the effects,
    if you have one you will be able to change it during equipping but it won't be great for everyone, f.e. an item that is a shield and weapon would not work.
     
  8. karland90

    karland90

    Joined:
    Mar 30, 2009
    Messages:
    960
    Resources:
    3
    Models:
    3
    Resources:
    3
    imo attaching multiple effects with one item would be a useful feature (like shoulderpads item or armor that has different model parts), but some 10 would be more than enough. no need to have it work with infinite number of attachments, i think.
     
  9. lelyanra

    lelyanra

    Joined:
    Sep 4, 2007
    Messages:
    380
    Resources:
    25
    Icons:
    25
    Resources:
    25
    I don't think you neer vaaarious attachments per item. make a maximum number like 3 or 4, and tell the users to attach them artificially if they need more.
     
  10. Mr.Teapot

    Mr.Teapot

    Joined:
    Feb 25, 2009
    Messages:
    20
    Resources:
    0
    Resources:
    0
    For this to be useful for RPG-makers you should attach a save/load to it.
    It's hard to configure a save/load system to work with such an equipment system.

    Good Job!

    Regards
     
  11. lelyanra

    lelyanra

    Joined:
    Sep 4, 2007
    Messages:
    380
    Resources:
    25
    Icons:
    25
    Resources:
    25
    the teapot guys is right, make a save/load assistant (just pick a well made save/load system and adapt your system to it. it would be just a module, but sounds good.)
     
  12. mattstheman

    mattstheman

    Joined:
    Jun 29, 2009
    Messages:
    141
    Resources:
    0
    Resources:
    0
    On the matter of the attachment add-on, I would be perfectly fine if you can only configure it for 1 attachment because one is always better than none. An infinite number of attachments would be a little ridiculous. I think that a fair amount would be 1-3.
     
  13. Anachron

    Anachron

    Joined:
    Sep 9, 2007
    Messages:
    6,220
    Resources:
    66
    Icons:
    49
    Packs:
    2
    Tools:
    1
    Maps:
    3
    Spells:
    9
    Tutorials:
    1
    JASS:
    1
    Resources:
    66
    About the attachment system:
    It can either be infinitive or one, a limited one sucks.
    I think I'll go for the one attachment stuff.

    About the save/load:
    I don't think it's hard actually. If you know vJass and check CustomInventory library you see a useful function to get any item of an hero.
    (inv.getItem(i))

    CustomItem can get an item handle of an CustomItem, by
    (item.getHandle())

    Sorry, but as already told, you need vJass skills in order to use it. I may implement a save/load module but it's not top priority.
     
  14. makai

    makai

    Joined:
    Apr 30, 2010
    Messages:
    320
    Resources:
    2
    Models:
    2
    Resources:
    2
    jass is hard >.< ... how to use potion?? put at which slot???
     
  15. acomc

    acomc

    Joined:
    Dec 20, 2009
    Messages:
    5
    Resources:
    0
    Resources:
    0
    Hello author,

    I just take a brief look at your inventory system, of course it's amazing.

    however I wonderhow can I make my Load/Save code corresponding to your system, it seems like there aren't enough explanations or descriptive things in your demonstration.
     
  16. Anachron

    Anachron

    Joined:
    Sep 9, 2007
    Messages:
    6,220
    Resources:
    66
    Icons:
    49
    Packs:
    2
    Tools:
    1
    Maps:
    3
    Spells:
    9
    Tutorials:
    1
    JASS:
    1
    Resources:
    66
    Hey,
    well if you understand vJass you will easily be able to get the itemobjects of the inventory of a unit.

    Code (vJASS):

    private function loadItems takes unit theUnit returns nothing
        // Load the inventory
        local CustomInventory inv = CustomInventory.load(GetHandleId(theUnit))
        // Load the item object
        local CustomItem it1 = inv.getItem(0)
        // Get the itemhandle
        local item i1 = it1.getHandle()

        // Print the itemname for testing purposes.
        call BJDebugMsg(GetItemName(i1))
    endfunction
     
     
  17. Sorceress

    Sorceress

    Joined:
    Jul 28, 2009
    Messages:
    1,024
    Resources:
    1
    Template:
    1
    Resources:
    1
    Amazing.!
     
  18. Anachron

    Anachron

    Joined:
    Sep 9, 2007
    Messages:
    6,220
    Resources:
    66
    Icons:
    49
    Packs:
    2
    Tools:
    1
    Maps:
    3
    Spells:
    9
    Tutorials:
    1
    JASS:
    1
    Resources:
    66
    Thanks, glad you like it.
     
  19. SlayerII

    SlayerII

    Joined:
    Aug 21, 2008
    Messages:
    526
    Resources:
    2
    Maps:
    1
    Tutorials:
    1
    Resources:
    2
    Hive force me to explain my rating:

    Omg wtf imba..........

    The most epic inventory system i ever saw.GJ

    5/5
     
  20. mattstheman

    mattstheman

    Joined:
    Jun 29, 2009
    Messages:
    141
    Resources:
    0
    Resources:
    0
    How goes it? Any work on the attachement system?