• 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 17
Joined
Jun 9, 2007
Messages
2,493
Isn't ESC quick enough?

Well, some people like me for example always have the tumb on for example the B button, and sometimes space.

So insted of moving your hand to reach the Esc button you could simply press the button that your already having your finger on.

It is all about keeping hotkeys close to each other in order to make it simplier and faster. In other words it just makes everything so much smoother to work with.

But still, it should not be to hard to add that into the system by yourself if you know how to work with Jass/vJass, right?
 
When I find time I will make this system completely MUI and maybe add a vendor system and of course give it a sell button.

(Before that, I am needing to fix stuff to shrink the inventory to 1% of the actual size and then I will release the first beta of the new inventory, then after the sellbutton and then after the vendor system the final 1.0)
 
Level 3
Joined
Jul 26, 2008
Messages
58
And me again :)
I've got one more trouble - items are shown up properly and could be equipped, but they do not grant you any bonuses, not even damage. And this is not because incorrect item input, because the same goes for the items already created (e.g. Clawns of Attack +15).
What can cause this?
 
Level 3
Joined
Jul 26, 2008
Messages
58
I had them, but again, just as before, they havent been set as they should be. For example all of 'Bonus Mod - Damage' were set to 1. Guess, there's something wrong I did with copy-pasting, or smth wrong with my WC3E.
Yet, when I set them to the proper amount, still nothing changes.
 
Level 3
Joined
Jul 26, 2008
Messages
58
That happens, obviously, because of unmatched abilities ID. I could change the prefix, but the last symbol doesnt come in order like 'a, b, c' and so on, so I think it won't help. Is there any way to change IDs?
 
Level 3
Joined
Jul 26, 2008
Messages
58
Textmacroses and data merging did the trick. Thanks. I guess there is some Readme I've missed?
And one more question: is it possible to make items in belt to be droppable? I mean, these 4 slots.
 
Well, why do you want them to be droppable? You can drop an item with the FSI UI, and I blocked any item slot changing/dropping because that could screw up my system since wc3 drop system has been awfully made. It will work, however, I would not recommend it. To make it work you have to look for a boolean that sets whether the item can drop or not. I don't remember where it is.
 
Level 3
Joined
Jul 26, 2008
Messages
58
About 'why' - for example, in my map, inside of one of low-lvl dungeons you have to get the gem from defined elite, insert it into obelisk, use its energy to crush the stones blocking the path, to.. blah-blah, you know. And manually dropping-inserting gem into the obelisk seems to be the best desicion.
But. If you think this may screw up the whole system, which I surely do not want to happen, can you tell me, if you remember, how can I drop the items or detect item carrying in CI via triggers? Some custom script or smth? I believe I've seen this being discussed somewhere, but can't find it now.
 
Level 9
Joined
Aug 27, 2009
Messages
473
Anachron, seems like I have some problem with this! D:
All images / icons has gone from the inventory.. The borders, background and hero is there, but all inventory slots / items are gone.. (The multiboard does show up on hover.. :S)

I've tried much to fix this, would be nice to hear a comment from the master.. :)
 

Attachments

  • Uten navn.png
    Uten navn.png
    199.5 KB · Views: 136
Level 13
Joined
May 11, 2008
Messages
1,198
yeah we need a sell button for sure. but it shouldn't work unless there's a shop around.

another thing: i didn't notice if it was the case or not, but doubt it...can you make your items which are being equipped and thus giving stats bonuses or whatever...be USABLE? in final fantasy the first game you could use all the items in the inventory, plus the equipped items. being able to use equipped items and non-equipped items would be nice...but i understand if the whole system needs to be written from scratch again to make it possible.

i was gonna say...about sale of items...is your system based on a specific ability of hero inventory? if so, can't we make a courier's hero inventory ability(or whatever) which can sell the items to the shops? sounds like something not all maps would want...but gotta sell items somehow...

edit: i was just thinking while on the toilet that you could make your own type of shop for custominventory, doesn't have to be like war3 shop...and you could make the currency be like silver coins and make it be an item...then each hero has it's own cash to spend instead of it being a player's resource. i think it sounds like good idea.

i mean yeah we need to buy items too, not just sell them. and i don't think people would mind typing in the sale cost of items...it's faster in jass to do it than playing around with the object editor.
 
another thing: i didn't notice if it was the case or not, but doubt it...can you make your items which are being equipped and thus giving stats bonuses or whatever...be USABLE? in final fantasy the first game you could use all the items in the inventory, plus the equipped items. being able to use equipped items and non-equipped items would be nice...but i understand if the whole system needs to be written from scratch again to make it possible.
No, it would just cause bugs, which wc3 has, not my system.

i was gonna say...about sale of items...is your system based on a specific ability of hero inventory? if so, can't we make a courier's hero inventory ability(or whatever) which can sell the items to the shops? sounds like something not all maps would want...but gotta sell items somehow...
It's the normal inventory ability.

edit: i was just thinking while on the toilet that you could make your own type of shop for custominventory, doesn't have to be like war3 shop...and you could make the currency be like silver coins and make it be an item...then each hero has it's own cash to spend instead of it being a player's resource. i think it sounds like good idea.
Yeah, but takes time, which I don't have.
 
That us the WE Syntax Checker.. I'm pretty sure it does not check if it's vJass or not.. :p

Did a clean install of JNGP + JassHelper.. Nothing..

first use edit button, don't double post...

maybe the jass helper you installed is not the latest one?
 
does jasshelper run? or is it the normal WE syntax checker... coz that's really weird, since you have latest jass helper and you said that your war3 is patch to the latest version...

if it really doesnt work, then maybe you have a problem with the internal files... you can try reinstalling wc3 if it really wont work...
 
JassHelper = Enabled and running.. :)
WC3 runs when I start the map as testing, so the errors shouldn't be that critical as it seems.. I've tried this system before and it worked then..

that's really wierd... normally maps that has errors cannot be played because they are not fully compiled...

or

maybe you did not disable the WE syntax checker?
 
Level 9
Joined
Aug 27, 2009
Messages
473
I got JNGP installed 100% after the book :p

By the way:
Version: 0.1
Author: Anachron
Date: 11th Dec 2009

Release information:
Do not use this library without
copyright information.

Copyright 2009

Shouldn't that be more like:
Version: 0.2.2.5
Author: Anachron
Date: -- New Date --

Release information:
Do not use this library without
copyright information.

Copyright 2009-2010

I'm starting to believe it's something with either models / icons..
 
Level 17
Joined
Jun 9, 2007
Messages
2,493
Probably not.. :p (It's so damn easy, I'm just embarrassed..)
Well, anyway.. You probably knew this from before: The field where the inventories destructables should be have to be in a SET height.. I had it to high.. ;P

Atleast you did set the inventory to appear in a non-existing area... like outside the entire map <_<'

That is much worse, and i know someone who tried to do that..
 
Level 9
Joined
Aug 27, 2009
Messages
473
Hello Anachron, now I just simply want help configuring this system.. :)
I've made so items can use eithe HAND1 or HAND2 (Left / Right hand) instead of just HAND.. (This works very well)

Now I need a new bonus attribute; Range..
How do I add that? I could probably do it if I understood what the rawcode for Range actually is.. (And if this is possible, please help me..)

As I understand, only the CIBonus trigger needs to be tweaked to make this new attribute work.. :) If you actually could give me the trigger coded done, with a the new attribute working with a short alias as: "rang", it would be awesome! :)

Thanks
 
I've made so items can use eithe HAND1 or HAND2 (Left / Right hand) instead of just HAND.. (This works very well)
Sounds nice.

Now I need a new bonus attribute; Range..
How do I add that? I could probably do it if I understood what the rawcode for Range actually is.. (And if this is possible, please help me..)
If it would be possible there would be an system for it ;)
 
Top