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. The 15th Mini-Mapping Contest came to an end. The Secrets of Warcraft 3 are soon to be revealed! Come and vote in the public poll for your favorite maps.
    Dismiss Notice
  4. The 12th incarnation of the Music Contest is LIVE! The theme is Synthwave. Knight Rider needs a song to listen to on his journey. You should definitely have some fun with this theme!
    Dismiss Notice
  5. Join other hivers in a friendly concept-art contest. The contestants have to create a genie coming out of its container. We wish you the best of luck!
    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.

Easy Item Stack 'n Split v2.7.4

Submitted by Dangerb0y
This bundle is marked as approved. It works and satisfies the submission rules.
Easy Item Stack 'n Split v2.7.4
by Dangerb0y

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.

How to remove WC3's Full Inventory error
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. :)
What's changed?
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!
Thanks for stuff and things
+REP for anyone who finds a bug or leak for me to fix :)

Keywords:
item, stack, split, inventory, full, items, system, simple, easy, everything, unit, jass, vjass, gui, warcraft, editor, wc3
Contents

Easy Item Stack 'n Split v2.7.4 (Map)

Reviews
Moderator
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...
  1. xorkatoss

    xorkatoss

    Joined:
    Jul 12, 2010
    Messages:
    1,491
    Resources:
    6
    Models:
    5
    Maps:
    1
    Resources:
    6
    i like the idea of being able to purchase items from shops regardless of a full inventory.
    a bag system could be useful too...even though there are lots of bag systems in the hive...
     
  2. fvtb

    fvtb

    Joined:
    May 30, 2011
    Messages:
    5
    Resources:
    0
    Resources:
    0
    Thanks for this system. It's easy to use.

    +rep! :thumbs_up:
     
  3. xorkatoss

    xorkatoss

    Joined:
    Jul 12, 2010
    Messages:
    1,491
    Resources:
    6
    Models:
    5
    Maps:
    1
    Resources:
    6
    hey dude, it's been a while...
    as you already know, this is the best stacking system available BUT it takes more space than it's supposed to be...(IMO)
    a normal stacking system takes about 5-6kb and yours is about 25kb...
    i know that 20kb is not that much BUT im making a roc map for b.net with tft data...
    so as you can see even 1kb lower is good 4 me since i want players to download my map fast...

    what im trying to say:
    could you please add a bonus stacking system that can:
    1)stack items
    2)split into half
    3)unlimited stacks
    4)pick up regardless of full inventory
    5)no parameters and comments(to reduce size)
    6)call it Item Stack and Split Lite? :D
    7)make it in GUI if possible...(i don't like vJass sry)
    8)use as less actions as possible (ofc :p)

    thnx for wasting your time to read this!
    and a bigger thnx plus rep if you do my request!!^^

    EDIT:
    oh well i guess you are not interested in my idea *_*
     
    Last edited: Jan 2, 2012
  4. Dangerb0y

    Dangerb0y

    Joined:
    Oct 11, 2009
    Messages:
    41
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Hey man. Sorry for the extremely late reply. To be honest I'm not really supporting this system anymore. I just don't have time for it these days. So i'm gonna have to turn down your request unfortunately.

    If you wanna get your map size down, you could just use Wc3mapoptimizer by Vexorian. It'll automatically remove comments and anything else it can to reduce the size of your map as much as possible. I completely understand your concern, but I really don't think 5-25kB makes much of a difference anyway.

    Cheers dude, and good luck with your map. If you send me a link I'll be happy to add it under "Maps Using This System."
     
  5. Smiddle

    Smiddle

    Joined:
    Mar 12, 2008
    Messages:
    434
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Alright, let's necropost.

    In the test map, when I pick up a tome with a full inventory, it plays the error sound. (using the GUI trigger)

    Though it seems like an easy fix, just by throwing an item check condition before playing the sound.
     
  6. RatonLynk

    RatonLynk

    Joined:
    Jun 9, 2015
    Messages:
    1
    Resources:
    0
    Resources:
    0
    Guys, How to install
     
  7. Smiddle

    Smiddle

    Joined:
    Mar 12, 2008
    Messages:
    434
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Activate "automatically create unknown variables when pasting trigger data" (or whatever it is) in preferences and simply paste one of the triggers in your map. Doesn't it work?
     
  8. Barade

    Barade

    Joined:
    Feb 2, 2006
    Messages:
    546
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Does this work with shops if the inventory is full? Can you buy items which will stack even if the inventory is full?
     
  9. BiroN

    BiroN

    Joined:
    Sep 10, 2013
    Messages:
    358
    Resources:
    0
    Resources:
    0
    This is awesome!
     
  10. pred1980

    pred1980

    Joined:
    Mar 19, 2010
    Messages:
    844
    Resources:
    1
    Maps:
    1
    Resources:
    1
    No, but i implemented it by using tomes ;)
     
  11. mr po

    mr po

    Joined:
    Dec 8, 2016
    Messages:
    127
    Resources:
    1
    Maps:
    1
    Resources:
    1
    other player can hear the error sound
     
  12. Sverkerman

    Sverkerman

    Joined:
    Feb 28, 2010
    Messages:
    1,281
    Resources:
    5
    Maps:
    5
    Resources:
    5
    Kind of a late reply, but perhaps I'll find an answer to my question.

    This system makes the event "Unit Generic - Unit Acquires an item" run twice instead of once when picking up an item.
    Anyone with a fix?

    EDIT: Found a good workaround, added a boolean variable and set it to true when the item stack system is giving items/removing items and to false when it is not to track if the Acquire Item/Lose Item event is player based or system based.
     
    Last edited: Jul 5, 2017
  13. Alethos

    Alethos

    Joined:
    Jan 25, 2017
    Messages:
    207
    Resources:
    6
    Models:
    6
    Resources:
    6
    @Sverkerman Hey, can you explain what your workaround is more completely? I'm unfamiliar with boolean variables but the way I would have done it is turning off/on triggers relating to 'unit acquires (or loses) an item' when appropriate... but it seems like your solution may be more simple.

    EDIT: Err... nvm, I think I figured it out- Turning off/on other triggers can be problematic (?) but if I set boolean to true and false before and after the system uses 'give- item' then put a condition: 'is variable false?' than it should work. Thanks :)
     
    Last edited: Jul 8, 2017
  14. Sverkerman

    Sverkerman

    Joined:
    Feb 28, 2010
    Messages:
    1,281
    Resources:
    5
    Maps:
    5
    Resources:
    5
  15. RiotZ

    RiotZ

    Joined:
    Jul 25, 2009
    Messages:
    2,723
    Resources:
    2
    Maps:
    2
    Resources:
    2
    Alright, something which is peeving me is, when you try to pick up power ups with a full inventory it says "Inventory is full." even though I removed this message from gameplay interface and it orders the unit to stop. How do I fix this.
     
  16. IcemanBo

    IcemanBo

    Joined:
    Sep 6, 2013
    Messages:
    6,107
    Resources:
    22
    Maps:
    3
    Spells:
    11
    Template:
    1
    Tutorials:
    4
    JASS:
    3
    Resources:
    22
    Did you Put in a space symbol? IT should contain some character.
     
  17. RiotZ

    RiotZ

    Joined:
    Jul 25, 2009
    Messages:
    2,723
    Resources:
    2
    Maps:
    2
    Resources:
    2
    I did.

    I found the part in his script that is forcing you to stop and removed it when your inventory is full. Simple enough.
     
  18. Cake is a Lie

    Cake is a Lie

    Joined:
    Oct 1, 2017
    Messages:
    99
    Resources:
    0
    Resources:
    0
    But how to put an error message when inventory is really full?
     
  19. Cake is a Lie

    Cake is a Lie

    Joined:
    Oct 1, 2017
    Messages:
    99
    Resources:
    0
    Resources:
    0
    Can I ask how to disable stacking on a specific item?
     
  20. Alethos

    Alethos

    Joined:
    Jan 25, 2017
    Messages:
    207
    Resources:
    6
    Models:
    6
    Resources:
    6
    You can't both have your cake and eat it

    This only affects charged items but if you set the system to 'useitemlevel' as the cap you can set the item level to one for just one charge. Otherwise you can edit the code directly and put conditions for your specific item(s)

    ---
    Question: Jass checker says this trigger leaks a point. Is it a false positive? Is it the jass condition where it checks to see if pointtargetcommand = null (can't remember actual wording) or something else?