• 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.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

How to create a simple item stacking system?

Status
Not open for further replies.
Level 8
Joined
Mar 26, 2009
Messages
301
What would be the most basic and non-buggy form of item stacking?
I tried lots of methods on my own, the closest thing I got to a successful stack was items starting with 2 charges on it; if it is 2 or more, it did stack well. I thought it was easy. But when I use "Unit acquired item" event and use "Item Type of Blah owned by Blah" thing, that counts the item that've been picked up at that very moment. I've wasted the triggers since they got all too confusing.. Please someone help.
 
Level 13
Joined
Sep 13, 2010
Messages
550
It's quite old, not system and since the Unit - A unit Acquires an item event you can use 5 inventory spaces. It looks a bit complicted but as I see it doesn't have any leaks... You should set Number of charges to 1 in object editor.

  • Stack item
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-class of (Item being manipulated)) Equal to (==) Campaign
      • (Item being manipulated) Not equal to (!=) (Item carried by (Triggering unit) of type (Item-type of (Item being manipulated)))
    • Actions
      • Item - Set charges remaining in (Item carried by (Triggering unit) of type (Item-type of (Item being manipulated))) to ((Charges remaining in (Item carried by (Triggering unit) of type (Item-type of (Item being manipulated)))) + (Charges remaining in (Item being manipulated)))
      • Item - Remove (Item being manipulated)
 
Maybe?
  • Events
    • Unit - A unit Acquires an item
  • Conditions
    • Or - Any (Conditions) are true
      • Conditions
        • (Item-type of (Item being manipulated)) Equal to Greater Potion of Healing
        • (Item-type of (Item being manipulated)) Equal to Greater Potion of Mana
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • ((Hero manipulating item) has an item of type (Item-type of (Item being manipulated))) Equal to True
        • (Item being manipulated) Not equal to (Item carried by (Hero manipulating item) of type (Item-type of (Item being manipulated)))
      • Then - Actions
        • Item - Set charges remaining in (Item carried by (Hero manipulating item) of type (Item-type of (Item being manipulated))) to ((Charges remaining in (Item carried by (Hero manipulating item) of type (Item-type of (Item being manipulated)))) + (Charges remaining in (Item being manipulated)))
        • Hero - Drop (Item being manipulated) from (Hero manipulating item)
        • Item - Remove (Last dropped item)
      • Else - Actions
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
It's quite old, not system and since the Unit - A unit Acquires an item event you can use 5 inventory spaces. It looks a bit complicted but as I see it doesn't have any leaks... You should set Number of charges to 1 in object editor.

  • Stack item
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-class of (Item being manipulated)) Equal to (==) Campaign
      • (Item being manipulated) Not equal to (!=) (Item carried by (Triggering unit) of type (Item-type of (Item being manipulated)))
    • Actions
      • Item - Set charges remaining in (Item carried by (Triggering unit) of type (Item-type of (Item being manipulated))) to ((Charges remaining in (Item carried by (Triggering unit) of type (Item-type of (Item being manipulated)))) + (Charges remaining in (Item being manipulated)))
      • Item - Remove (Item being manipulated)

This trigger works greatly for what I want... but i'd like to add an Stock Limit (To 12), and a Split system (Half/half), and autocast (Click->Cast on self) and not (Click->select target)...

How would we do that?

And, most important... Avoid the "Inventory is Full" having a Potion with 1 charge...
 
Last edited by a moderator:
Status
Not open for further replies.
Top