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!
This system is outdated and unmaintained as I'm no longer making WC3 maps. Thank you to everyone who's used and supported this system over the years. I enjoyed it so much that I became a full-time developer and have no free time anymore
If anyone would like to take over development and maintenance, please feel free to PM me.
FEATURES: - Automatically stacks obtained items to an optional stack limit. - Allows stacking items within a unit's inventory. - Allows splitting item stacks within a unit's inventory. -Allows units to seamlessly pick up items regardless of a full inventory. - Copy-paste implementation.
STACKING ITEMS: - Obtained items are automatically stacked with same-type items in a unit's inventory. - Placing same-type items on top of each other will stack them together.
SPLITTING ITEMS: - Double right-clicking or dropping an item stack on itself will split 1 off the pile. (optional) - Consecutively split items will stack together. (optional) - If a unit's inventory slots are full when splitting an item stack, the split item will be dropped on the ground in front of the unit. (optional)
ITEM STACKS: - The maximum stack size is set by the item's level in the Object Editor (Shift+Double-click allows entering levels greater than 8). - Setting an item's level to 0 will give it an unlimited stack size. - Items must have charges in order to be stacked; non-charged items will function as Blizzard intended.
RELEASE NOTES: - This system can be implemented into just about any map. - This system is completely leak-free. - This system is completely lag-free. - This system is fully MUI and MPI. - This system works with all inventory sizes. - This system does NOT use hashtables or gamecache, i.e. it is much faster. - This system is available in vJASS and GUI.
IMPLEMENTATION (vJASS): 1) Copy the trigger "EasyItemStacknSplit" to your Trigger Editor. You must have JNGP + The Latest JassHelper to implement this version!
IMPLEMENTATION (GUI): 1) In map view, go to File > Preferences... and tick "Automatically create unknown variables while pasting trigger data" under the General tab. 2) Copy the trigger "EasyItemStacknSplitGUI" to your Trigger Editor.
UPDATING? Make sure to first delete old EasyItemStacknSplit triggers and, if you use the GUI version, all the variables with the "EasyItem" prefix.
1) Create a blank text document on your desktop and name it "blank.wav". 2) Import it with Import Manager and give it the custom path "Sound\Interface\Warning\Human\KnightInventoryFull1.wav".
Repeat this step for the following:
- "Sound\Interface\Warning\Orc\GruntInventoryFull1.wav"
- "Sound\Interface\Warning\Naga\NagaInventoryFull1.wav"
- "Sound\Interface\Warning\Undead\NecromancerInventoryFull1.wav"
- "Sound\Interface\Warning\NightElf\SentinelInventoryFull1.wav" 3) In map view, go to Advanced > Game interface... look for "Text - Message - 'Inventory is full.'" and put in a single space as its value. 4) Give yourself a firm yet gentle pat on the back.
v2.7.4: --> Fixed a bug causing powerups to double up. Thank you to pks9067 for picking this up. v2.7.3: --> Added functionality for item stacks larger than their set stack size. v2.7.2: --> Fixed a split-stacking bug in GUI version. Thank you to xorkatoss for picking this up. v2.7.1: --> Fixed a stacking overflow bug in GUI version. Thank you to ABM for picking this up. v2.7: --> Consecutively split items now stack together! --> Added parameters for split-stacking. --> Majorly optimized GUI version. v2.6.1: --> Minor item cooldown incongruity fixed. --> Minor code optimization. v2.6: --> Added parameter to enable/disable using item levels to determine stack limit. --> Removed the full inventory error message. It's just not worth the ClearTextMessages. --> Got rid of custom scripts in the GUI version where possible. --> Reworked sounds a bit. v2.5: --> Modernized vJASS version a bit. --> Condensed GUI version into a single trigger. --> Fixed 1 or 2 potential bugs. v2.4.2: --> Another desync issue fixed (both versions). Looks like we're finally out of the woods. v2.4.1: --> System parameter added for enabling/disabling item split-dropping. --> Desync issue fixed in GUI version. Thank you to gadina_prokleta for picking this up. v2.4: --> System parameter added for enabling/disabling item splitting. --> System parameters added to GUI version. --> Some much needed security added. v2.3.2: --> Timer cycle performance enhanced. v2.3.1: --> Minor lag issue fixed. --> Some minor bugs fixed. v2.3: --> Optimized timer recycling. --> Minor sound bugs fixed. --> Some other important bugs fixed. v2.2: --> Major bug fix regarding desyncs in multiplayer maps. --> Fixed a stacking issue in GUI version. --> Minor code optimization. v2.1: --> Added the ability to have unlimited stack sizes by setting item level to 0. v2.0.1: --> Fixed minor sound bug in vJASS version. --> Optimized code a bit more in vJASS version. v2.0: --> Completely revamped code to allow full inventory usage! --> Removed the JASS version and added a vJASS version. Anyone coding in JASS should be doing it in vJASS anyway. v1.7: --> Optimized code slightly more. --> Added GUI version for the GUIers. v1.6: --> Converted to JASS for better optimization and easier implementation. --> Optimized code for slightly faster execution. --> Added more comments. v1.5: --> Changed loops to use a set variable to avoid any conflict with other loops in a map. Thank you to Caedrus for picking this up. v1.4: --> Fixed a bug (which somehow created itself after months of working fine) causing items not to split properly. Thank you to 88WaRCraFT3 for picking this up. v1.3: --> Added several comments to the script to make it easier to understand. v1.2: --> Fixed a bug causing split-off-stack-and-auto-dropped items to be placed at position of unit instead of in front of it. v1.1: --> Fixed point leaks caused by creating items at points with polar offsets. This system is now 100% leak-free!
11:23, 22nd Dec 2009
TriggerHappy:
Review for Spell
I suppose it can be useful for other GUI users. The other GUI ones
IIRC aren't as advanced as this, therefor I will approve this.
Status
Feel free to message me here if you...
Hey thanks man, for the rep + rating too, much appreciated . Let me know if you ever need any help with it, I'm always free to lend a hand.
light bolt30 is right - that's pretty much how you do it. You can also do it by hitting the little rep icon on the far top-right of the first page of any resource.
also did you know that now your system is added to a very popular map? http://sites.google.com/site/jungletrolls/
that map was awesome and now with your system it's even better !! ;D
keep up the good work man
Nice to see you're still one of my top supporters and reppers
The main developer of Jungle Trolls Reborn is actually a beloved bug finder for this system, so we've helped each other's projects a bit. It is definitely an awesome map.
I finally remembered that guy's name
Thanks again for the support xorkatoss. You kick ass!
I just saw that you recommended my system to them. I think i should hire you to spread the word of Easy Item Stack 'n Split thanks again man, you've definitely got some +rep coming your way!
I just saw that you recommended my system to them. I think i should hire you to spread the word of Easy Item Stack 'n Split thanks again man, you've definitely got some +rep coming your way!
well i noticed that the stacking system in the Jungle Trolls Reborn map was not that good...
and also that it could't split items and etc.
so i suggested your system since it would make the map way better
You're not doing anything wrong - the problem you're having is because, for some reason, the latest JNGP doesn't come with the latest JassHelper, and the old version can't parse static ifs. You can get the latest version HERE. There's also a link in the description.
Okay at first I have no idea of Jass! So now I downloaded ur system and tried to integrate it into my map. Until now all was nice, than I wanted to test it and the Editor said that over 100 errors are in ur system o.0!!!!!! What did I wrong?
You're not doing anything wrong - the problem you're having is because, for some reason, the latest JNGP doesn't come with the latest JassHelper, and the old version can't parse static ifs. You can get the latest version HERE. There's also a link in the description.
Okay at first I have no idea of Jass! So now I downloaded ur system and tried to integrate it into my map. Until now all was nice, than I wanted to test it and the Editor said that over 100 errors are in ur system o.0!!!!!! What did I wrong?
It's easier than you think. Just open up my system in World Editor, go to the Trigger Editor, then in the folder called "For the GUIers" literally just click on the trigger "EasyItemStacknSplitGUI" and hit CTRL+C. Then you can open your own map in World Editor, go to Trigger Editor and hit CTRL+V to paste it in. Before you paste it though make sure to go to File > Preferences... and tick "Automatically create unknown variables while pasting trigger data" under the General tab.
lol. i guess this system has been going for over a year... i'm actually working on a playable map right now (and have been for half a year), but i've come to realize there's a big difference between working on a map, and FINISHING it. so until then, this system is all she wrote..... if i think of a good idea for a system i'll probably make it, but these days everything's been done like 20 times over.
man i got an idea for your system!!
i came up with this idea when i was playing Jungle Trolls Reborn!!
i had 132 gold coins and i wanted to split them in order to have an item with 100 charges and another item with 32 charges...
(it was a pain in the ass to do it -.-)
so i came up with this awesome (i hope) idea!!
how about make your system when splitting items able to set a custom amount?
for example. -split amount 30 and when you try to split it splits 30 charges instead of 1
(and if not enough charges it does nothing)
also another idea is to make the splitting set to default(1) after using it!!
example. i split an item with the split amount set to 27, for the next splitting the split amount in reseted to 1 again...
so what you think about my idea?
EDIT:
also don't forget to set the custom split amount value private for each player!!
Epic idea xorkatoss, dangerb0y, i'll suggest you to make that splitting more eyecandy if you want i can do that with dialog buttons, if you don't know. For example you have an spell, that would work like change split, and than, when you activate it, you get dialog buttons, 1. Enter new splitting number. 2. Back splitting number to ONE. 3. Close. What ya think?
LOL... Have you tested dota :O it's so damn cool, and it has damn stack system, and split is unneeded for it, anyway WHY DOES EVERYBODY WANTS TO TALK ABOUT DOTA!!!! Talk about something way better, like unbelieveble project Dark Wind, or projects that are on hive!
Fudging awesome idea, xorkatoss I was wondering when you'd come up with something.. In the interest of simplicity, i've just made it so that consecutively split items will stack together - try it out.
88WaRCraFT3, dialogs would definitely get the job done, but they're a bit intrusive IMO.
I Hope you did get my last message about the bug from the new version in GUI...
Good luck on fixing it...
i hope my explanation helped you to find where exactly it is located...
full inventory, item type A max stack except in one slot
and pick up item that make the slot Max stack too and redrop the excedent item
but fail recovering the correct charge, and give all charge of all items of type A
instead of doing (all charge of type A - charge of all item type A in inventory) = excedent charges
you must be pretty busy Dangerb0y...
but listen when you fix the bug here is something you could do as well...
a) splitting when you double click an item, it split 1 charge and put it in an empty slot
the second time you double click it add the charge to the first(splitted) item...
(you already done this in 2.7)
when you click an item and move it to empty slot you split item in half (charge rounded up in the taken item) //instead of splitting 1 charge like you did//
b) pick up when you pick up an item you add charge from the item to already not full item in inventory, then add left charge to empty slot...
if inventory full while there are still charge left in item, drop item on the floor (correct the bug here where the dropped item charge are incorrect)
when you pick up an item with more than max charge automatically add the charge to already possessed item of same type that are not full, then add the item to an empty slot but give the item only max charge, if charge left repeat in every empty slot until no more slot or no more charge...if charge left drop item in pack of item with max stack.
Ex: i have inventory with: slot1 3 stone(max5) slot2 5 stone(max5) slot3 5 Meat(max10) slot4 empty slot5 empty slot6 empty
i pick up a stone with 23 charges (normaly you can't reach that but with trigger you can make any charge number, and i need your trigger to make max stack pack for me needed for my recipe system in JTR)
first 2 charges are added to slot1 (become 5 stone), then 5 charges are added to slot4 (become 5 stone), then 5 charges are added to slot5 (become 5 stone), then 5 charges are added to slot6 (become 5 stone)...
(2+5+5+5=17 --> 23-17=6 charges left) drop a stone with 5 charges on floor, drop another stone with 1 charge on floor...
(no more charge left)
Geez, i've really gotta stop drinking so much coffee when i code... bug fixed.
@ABM: I'm super busy at the moment, but I'll get around to your suggestion B as soon as i get a free moment. I'm not quite sure what you mean about making a stack of items split when u move it to another slot?? But many thanks for the detailed feedback! You've been credited.
hmmm...
i had the EasyItem__USEITEMLEVEL = false for unlimited stacks like below..
-------- Use item levels to determine stack limit? (false = unlimited stacks) --------
Set EasyItem__USEITEMLEVEL = False
and i was splitting the potion of healing...(in your test map)
and the charges were stacking as they should but...
when the second item reached 10 charges (item level was 10)
it made a new item and added the charges there instead of adding them to the second item...
here is a pic i took...
Geez, i've really gotta stop drinking so much coffee when i code... bug fixed.
@ABM: I'm super busy at the moment, but I'll get around to your suggestion B as soon as i get a free moment. I'm not quite sure what you mean about making a stack of items split when u move it to another slot?? But many thanks for the detailed feedback! You've been credited.
well what i meant is when you move an item to same slot it split into half....
slot 1 move to slot 1 = divide charge in 2
but isn't double click same? i mean is double click same as moving item a from slot 1 to slot 1? if that is the case forget about it, it is just my mistake...
but if it is different then that what i meant...
double click = -1 charge and move to same slot = /2 charge
about (b) that would be really very very helpfull if you do...
i looked at your trigger and i think i know about where in the trigger i should add a change, but i am not sure yet how to do this (would need an if/then/else check) and a divide charge.
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
EasyItem__USEITEMLEVEL Equal to True
(Item level of (Item being manipulated)) Greater than 0
((Charges remaining in (Item carried by (Triggering unit) in slot EasyItem_slot)) + (Charges remaining in (Item being manipulated))) Greater than (Item level of (Item being manipulated))
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Charges remaining in (Item carried by (Triggering unit) in slot EasyItem_slot)) + (Charges remaining in (Item being manipulated))) Greater than ((Item level of (Item being manipulated)) x 2)
Then - Actions
Set D[0] = ((Charges remaining in (Item carried by (Triggering unit) in slot EasyItem_slot)) + (Charges remaining in (Item being manipulated)))
Set D[1] = (D[0] mod (Item level of (Item being manipulated)))
Set D[2] = (D[0] - D[1])
Set D[3] = (D[2] / (Item level of (Item being manipulated)))
For each (Integer A) from 1 to D[3], do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Integer A) Equal to 1
Then - Actions
Item - Set charges remaining in (Item carried by (Triggering unit) in slot EasyItem_slot) to (Item level of (Item being manipulated))
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Integer A) Equal to 2
Then - Actions
Item - Set charges remaining in (Item being manipulated) to (Item level of (Item being manipulated))
Else - Actions
Trigger - Turn off (This trigger)
Hero - Create (Item-type of (Item being manipulated)) and give it to (Triggering unit)
Item - Set charges remaining in (Last created item) to (Item level of (Item being manipulated))
Trigger - Turn on (This trigger)
Trigger - Turn off (This trigger)
Hero - Create (Item-type of (Item being manipulated)) and give it to (Triggering unit)
Item - Set charges remaining in (Last created item) to D[1]
Trigger - Turn on (This trigger)
Else - Actions
Item - Set charges remaining in (Item being manipulated) to (((Charges remaining in (Item carried by (Triggering unit) in slot EasyItem_slot)) + (Charges remaining in (Item being manipulated))) - (Item level of (Item being manipulated)))
Item - Set charges remaining in (Item carried by (Triggering unit) in slot EasyItem_slot) to (Item level of (Item being manipulated))
Else - Actions
Item - Set charges remaining in (Item carried by (Triggering unit) in slot EasyItem_slot) to ((Charges remaining in (Item carried by (Triggering unit) in slot EasyItem_slot)) + (Charges remaining in (Item being manipulated)))
Item - Remove (Item being manipulated)
Set EasyItem_slot = (Size of inventory for (Triggering unit))
and also another change in the drop item section too... this is based on the old 2.6 version...
D(0)= total charge of all item of type (item being manipulated)
D(1)= left over from D(0) when divide in pack (item level of item manipulated)
D(2)= round number of D(0) [D(0)-D(1)]
D(3)= number of pack [D(2)/item level of item manipulated)
then it just need to loop acording to number of pack of items with max stack D(3)
and when done add the last pack with left over D(1)
(oups, i forgot to add a check if D(1)=0 no left over, then don't create the item for last pack)
@ABM: I will add the functionality above as soon as can, i promise. Thanks again for the thorough analysis. I'll have to go through your code in finer detail, but it looks good from what i can see.
P.S. double right-click = move to same slot, unfortunately...
Well honestly even if i might do it right...
i would rather wait for you to do it yourself, i still don't understand all of your code especially the new 2.7, so i would fear putting bugs in it...
since you are the one who understand your trigger the best i will wait for you to find a way of doing it correctly...
i know you are busy, so i will wait till you have time to do it...
Well honestly even if i might do it right...
i would rather wait for you to do it yourself, i still don't understand all of your code especially the new 2.7, so i would fear putting bugs in it...
since you are the one who understand your trigger the best i will wait for you to find a way of doing it correctly...
i know you are busy, so i will wait till you have time to do it...
hey dude about the splitting amount...shouldn't the EasyItem__SPLITSIZE be a private value for each player?
that way we could do a trigger like the one below to set the split amount for each player...
Set Split Amout
Events
Player - Player 1 (Red) types a chat message containing -split amount as A substring
Player - Player 2 (Blue) types a chat message containing -split amount as A substring
Player - Player 3 (Teal) types a chat message containing -split amount as A substring
Player - Player 4 (Purple) types a chat message containing -split amount as A substring
Player - Player 5 (Yellow) types a chat message containing -split amount as A substring
Player - Player 6 (Orange) types a chat message containing -split amount as A substring
Player - Player 7 (Green) types a chat message containing -split amount as A substring
Player - Player 8 (Pink) types a chat message containing -split amount as A substring
Player - Player 9 (Gray) types a chat message containing -split amount as A substring
Player - Player 10 (Light Blue) types a chat message containing -split amount as A substring
Player - Player 11 (Dark Green) types a chat message containing -split amount as A substring
Player - Player 12 (Brown) types a chat message containing -split amount as A substring
Conditions
(Substring((Entered chat string), 1, 13)) Equal to -split amount
Actions
Set EasyItem__SPLITSIZE[(Player number of (Triggering player))] = (Length of (Substring((Entered chat string), 15, 17)))
im just saying that i would prefer it this way but you can do wtv you want, it's your system after all ;p
hey dude about the splitting amount...shouldn't the EasyItem__SPLITSIZE be a private value for each player?
that way we could do a trigger like the one below to set the split amount for each player...
Set Split Amout
Events
Player - Player 1 (Red) types a chat message containing -split amount as A substring
Player - Player 2 (Blue) types a chat message containing -split amount as A substring
Player - Player 3 (Teal) types a chat message containing -split amount as A substring
Player - Player 4 (Purple) types a chat message containing -split amount as A substring
Player - Player 5 (Yellow) types a chat message containing -split amount as A substring
Player - Player 6 (Orange) types a chat message containing -split amount as A substring
Player - Player 7 (Green) types a chat message containing -split amount as A substring
Player - Player 8 (Pink) types a chat message containing -split amount as A substring
Player - Player 9 (Gray) types a chat message containing -split amount as A substring
Player - Player 10 (Light Blue) types a chat message containing -split amount as A substring
Player - Player 11 (Dark Green) types a chat message containing -split amount as A substring
Player - Player 12 (Brown) types a chat message containing -split amount as A substring
Conditions
(Substring((Entered chat string), 1, 13)) Equal to -split amount
Actions
Set EasyItem__SPLITSIZE[(Player number of (Triggering player))] = (Length of (Substring((Entered chat string), 15, 17)))
im just saying that i would prefer it this way but you can do wtv you want, it's your system after all ;p
Hey man. It would be awesome to do it like this, but then how would people be able to set the default splitsize without having to set it for each player separately?
Hey man. It would be awesome to do it like this, but then how would people be able to set the default splitsize without having to set it for each player separately?
duuuuuuuudeeeeeeeeeeee!!!? when are you going to update your system? -.-
im still waiting for the private custom item split function!! too bad your system is so confusing (and awesome^^) and i can't do it on my own *_*
duuuuuuuudeeeeeeeeeeee!!!? when are you going to update your system? -.-
im still waiting for the private custom item split function!! too bad your system is so confusing (and awesome^^) and i can't do it on my own *_*
Lol, sorry man, I really dropped the ball on this. Life, hey...
I'll be honest, I don't like the idea of having a "Preference Variable" in a loop. I could make you a custom version that has that, but I really can't promise u an ETA.
You'll have to try harder than that. You did find a fail in my comment though. That variable just enables/disables splitting, of any type. (Double right-click is the same as dropping an item on itself. WC3 can't differentiate between the two.)
That variable is used in the feature I added where if u consecutively split an item stack (spam right-click!) it splits off into the same pile, instead of separate items of 1 charge. The SplitStackDelay is just the time it takes to "reset". E.g. If you split a stack of 10 four times, you'll have one stack of 6 and one of 4. Then if you wait 2 seconds (or whatever you set the variable to) and split the same stack of now 6, it'll start stacking into a new stack, so you'll end up with 3 stacks. And so on...
For anyone interested, I've decided to consider making a version 3 of the system, in which items will be purchasable from shops regardless of a full inventory.
Before you all jump for joy wink, the reason I haven't added this function to my system yet is simply because the ONLY way to possibly make this work (yes, the only way...) is to use duplicate dummy powerup items of your actual items, and you'd also have to add a line of code (function or variable maybe) into a "Setup" trigger for each item, tying the real item to the dummy item, so to speak.
Now this really isn't toooo difficult, but it does kind of go against the "Easy" part of the system, especially since at the moment it's pretty much copy+paste. So if any of you think it would be a good idea (or bad idea) to add this feature, leave a comment below. If I don't get a good enough response on this, it just won't be worth the time and potential confusion for (new?) mapmakers.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.