• 🏆 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 9
Joined
Aug 27, 2009
Messages
473
Awww.. I really need to add range attached to a weapon.. :(
For example: Sword = Meele - 100 range || Fire Wand = Range - 600 range

About the left / right hand, it actually work 100%: You can only attach main-hand in the main-hand slot, which allows you only one main-hand weapon attached at the same time.. This is the same for the off-hand slot. So you can't use two shields for example.. :p (This is also good for the right hand | left hand attach points)
I'm 100% sure you can do this.. :p

Well, what bonuses can actually be added? :)
 
for the range you can do something... set the range of the unit to a high value but set acquisition range to a low value... example: attack range = 9999 but acquisition range - 600... the unit will not attack units farther than 600 units... then just modify the acquisition range via triggers when you equip a certain item...
 
Level 2
Joined
Sep 13, 2010
Messages
6
I've implemented this on 4 brand new maps (without changing any code), and 3 of those times, only the borders and the fake hero are visible. No items or slots can be seen, however the tooltip does pop up for items when I mouse over where they should be and I can still equip said items. The other 1 time works perfectly.

Any idea of what's causing this?

(Sorry if I didn't see this in the last 77 pages)
 
Last edited:
Level 2
Joined
Sep 13, 2010
Messages
6
I placed the doodads into the map where the hero spawns and all the models are appearing fine. I've just kept making new maps with the system until it's worked for me. Must be a problem with my WE since it's pure randomness!
 
Level 3
Joined
Jan 17, 2010
Messages
53
I wont to resize the map and to start it but it says 181273 compiled errors cuz i destroyed cameras by resizing the map how can i resize the map but not destroying a camera pls help :)
 
Level 1
Joined
Dec 21, 2007
Messages
2
ty

I am new with this system, tryed yesterday... Thanks alot for your hard work!! We do really appreciate it, i would even donate>.> 5/5
 
Level 1
Joined
Dec 1, 2010
Messages
2
i have read how to install JNGP but when i open your map and save my jassnewgen show me error like 88WaRCraFT3 . So you can give me your jassnewgen . i really really like your idea
 
Level 13
Joined
May 11, 2008
Messages
1,198
got some requests:

combine all the little "chapters" into less triggers, maybe even one trigger.

a big deal:
make a function list. and explain each function. a lot of good libraries have the function list, yours should too so users do not have to search on and on for proper functions, especially since your functions are given misleading names.

other issues:
can't really think of what they are at the moment, but there are other issues.
a big deal is, many things are not obvious, there aren't enough comments around in the library. the only comments i see mostly are ones about copyright information.

comments that include function lists and explanations of the functions would be very good to have, and would be a good place to start.
 
Level 3
Joined
Nov 12, 2010
Messages
43
hay man, I love your system it looks awesome with a first person camera and some attachments of weapons (http://www.youtube.com/watch?v=vUyoPugCueo), but is there a tool for item creation ? ... I got some kind of bug when change the movement speed, it changes the original unit's movement speed value to 200 ... can you help me with that?

edit: I didn't read this before http://www.hiveworkshop.com/forums/world-editor-help-zone-98/anachrons-map-system-giveaway-170110/ , anyway it's the best iventory system ....
 
Last edited:
Level 13
Joined
May 11, 2008
Messages
1,198
hay man, I love your system it looks awesome with a first person camera and some attachments of weapons (http://www.youtube.com/watch?v=vUyoPugCueo), but is there a tool for item creation ? ... I got some kind of bug when change the movement speed, it changes the original unit's movement speed value to 200 ... can you help me with that?

i seem to figure out how to make various stats changes...i'm not sure if i ran into any movement speed bugs...but the biggest problems i have don't have anything to do with stat changes. icon display failures, inability to check for items in the inventory...other problems...
 
got some requests:

combine all the little "chapters" into less triggers, maybe even one trigger.

a big deal:
make a function list. and explain each function. a lot of good libraries have the function list, yours should too so users do not have to search on and on for proper functions, especially since your functions are given misleading names.

other issues:
can't really think of what they are at the moment, but there are other issues.
a big deal is, many things are not obvious, there aren't enough comments around in the library. the only comments i see mostly are ones about copyright information.

comments that include function lists and explanations of the functions would be very good to have, and would be a good place to start.
Hey dude, sorry I left mapping and wc3 a long time ago.

Btw, for those who wonder: I will generate a function list this weekend.
 
Level 13
Joined
May 11, 2008
Messages
1,198
there is a coder working on something similar to this who will hopefully make a much imrpoved version of this(what he working on has nothing to do with items, though...)...i tried looking at the system and gave up since it is immense and really difficult...maybe it needs redone from scratch, but the basics of the ui are fascinating realm of war3 editing i have never seen before...

but i wouldn't hope too much on it...my suspicion is that the inventory needs a far simpler approach and should try to focus on ONLY increasing item slots and some minor attributes added like equipment types. it's kindof a cool undertaking what happened but imo he bit off more than he could chew when coding it... :/

i should get back to making my map before same thing happens to me ^^
 
Level 17
Joined
Jun 9, 2007
Messages
2,493
This system does not have to be redone at all. It is fine as it is.
Some people just like to do stuff in different ways, thats the issue with open-source stuff like this system.


but imo he bit off more than he could chew when coding it... :/
That's not true at all.
This system was once rated 6/5 by the moderators due to the system being well made.
 
Level 3
Joined
Mar 22, 2010
Messages
40
LOOOL I cant even test the freking map?!... -.- I cant even play it normaly... and when i tryd to save your map to test... i got "Syntax error" allover! On your librarys...
 
Level 16
Joined
May 1, 2008
Messages
1,605
Moin moin =)

Your system is a good way, to see how complex vJass can be and I think I understand more and more of the way you code there!

Very very good job with the system, but there's a little thing:

When the hero dies, you can still open the inventory. But when you pick a potion and try to place it into the hero inventory (at the inventar the 4 []), then the item is dropped on the system and lost.

Possible you can fix this a little - else awesome job =D

Greetings and Peace
Dr. Boom
 
Level 2
Joined
Jul 17, 2011
Messages
16
AAaaaa sorry but my friend and me got some error whit your script.
Here info bout it:
 

Attachments

  • JassCodeError.PNG
    JassCodeError.PNG
    54.1 KB · Views: 93
  • JassCodeError2.PNG
    JassCodeError2.PNG
    74.4 KB · Views: 113
Top