• 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.

Badly need help with automatic Item Stacking

Status
Not open for further replies.
Level 2
Joined
Dec 19, 2007
Messages
20
Hi
I have a problem getting a very simple thing to work, and its item stacking. It begins with the event "Unit - Aquires an item" with conditions saying that it should only happen if I already have another one of the same item I aquire. More than that its mostly just a trigger saying this should only happen to some items like for example I dont want my heroes able to have stacked weapons and stuff and maybe receive bonuses for wielding like hundreds of swords. I dont know why but this of all simple things wont work when it should and I have tried all possible combinations and added what would be uneccesery conditions and stuff. If anyone shows me a full working trigger that automaticly stacks the items when aquired and it shows to be more complicated than imagined he will get huge credits, or in any case at least some credits since this is a very important part of my map. So credits in any case to the one that can solve my problem.
 
Level 7
Joined
Jun 1, 2006
Messages
375
Umm, i think for items to stack they have to be item type > charges. that is, if you mean by stack, items overlapping eachother so that 10 items can fit into one slot.
 
Level 2
Joined
Aug 15, 2007
Messages
26
Use this one if your not into custom scripts :)

  • Combining charged
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item-type of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to (Item-type of (Item being manipulated))
              • (Item carried by (Hero manipulating item) in slot (Integer A)) Not equal to (Item being manipulated)
              • (Item-class of (Item being manipulated)) Equal to Charged
            • Then - Actions
              • Item - Set charges remaining in (Item carried by (Hero manipulating item) in slot (Integer A)) to ((Charges remaining in (Item carried by (Hero manipulating item) in slot (Integer A))) + (Charges remaining in (Item being manipulated)))
              • Item - Remove (Item being manipulated)
            • Else - Actions
 
Level 5
Joined
Nov 12, 2007
Messages
134
Use this if you want to remove the item your unit just acquired and add the charges to the item type that he already has.

  • Stacking Items
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Charges remaining in (Item being manipulated)) Not equal to 0
    • Actions
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item-type of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to (Item-type of (Item being manipulated))
              • (Item carried by (Hero manipulating item) in slot (Integer A)) Not equal to (Item being manipulated)
            • Then - Actions
              • Item - Set charges remaining in (Item carried by (Hero manipulating item) in slot (Integer A)) to ((Charges remaining in (Item carried by (Hero manipulating item) in slot (Integer A))) + (Charges remaining in (Item being manipulated)))
              • Item - Remove (Item being manipulated)
            • Else - Actions
              • Do nothing

Use this if you want to remove the item that your unit already has and add the charges to the item it just acquired. The difference of these 2 triggers is that if you use the first one, the item won't change place, but if you use the second one, there will be an empty slot where the item your unit already had was.

  • Stacking Items 2
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Charges remaining in (Item being manipulated)) Not equal to 0
    • Actions
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item-type of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to (Item-type of (Item being manipulated))
              • (Item carried by (Hero manipulating item) in slot (Integer A)) Not equal to (Item being manipulated)
            • Then - Actions
              • Item - Set charges remaining in (Item being manipulated) to ((Charges remaining in (Item carried by (Hero manipulating item) in slot (Integer A))) + (Charges remaining in (Item being manipulated)))
              • Item - Remove (Item carried by (Hero manipulating item) in slot (Integer A))
            • Else - Actions
              • Do nothing
 
Status
Not open for further replies.
Top