• 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.
  • 💡 We're thrilled to announce that our upcoming texturing contest is in the works, and we're eager to hear your suggestions! Please take this opportunity to share your ideas in this theme discussion thread for the Texturing Contest #34!
  • 🏆 Hive's 7th HD Modeling Contest: Icecrown Creature is now open! The frozen wastes of Icecrown are home to some of Azeroth’s most terrifying and resilient creatures. For this contest, your challenge is to design and model a HD 3D monster that embodies the cold, undead, and sinister essence of Icecrown! 📅 Submissions close on April 13, 2025. Don't miss this opportunity to let your creativity shine! Enter now and show us your frozen masterpiece! 🔗 Click here to enter!

Item problem

Status
Not open for further replies.
Level 5
Joined
Dec 7, 2008
Messages
90
I was wondering if there's a way to make more items stay in one slot of inventory.

I have an item called METAL ORE. And a quest requests that I pick up 5 Metal Ores, but when the unit picks them up, all the METAL ORES go in different slots. Can all those items (of same type and class, everything same) go to one slot in my unit's inventory?
 
Level 5
Joined
Dec 18, 2007
Messages
205
an easy item stack system would be this:

  • other stack
    • Events
      • Unit - A unit Aquires an item
    • Bedingungen
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Item-type of (Item being manipulated)) Gleich Metal Ore
              • (Item-type of (Item being manipulated)) Gleich Other items that spuld stack....
          • (Charges remaining in (Item being manipulated)) bigger than 0
        • 'THEN'-Actions
          • For each (Integer B) from 1 to 6, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • 'IF'-Bedingungen
                  • (Item carried by (Triggering unit) in slot (Integer B)) not equal to (Item being manipulated)
                  • (Item-type of (Item being manipulated)) equal to (Item-type of (Item carried by (Triggering unit) in slot (Integer B)))
                • 'THEN'-Aktionen
                  • Item - Set charges remaining in (Item carried by (Triggering unit) in slot (Integer B)) to ((Charges remaining in (Item carried by (Triggering unit) in slot (Integer B))) + (Charges remaining in (Item being manipulated)))
                  • Item - Remove (Item being manipulated)
                  • Skip remaining actions
                • 'ELSE'-Aktionen
        • 'ELSE'-Aktionen
it is just copied/paste (german) and a little bit edited, so ask, if there's something unclear.

to your quest: just check whether the unit has an item of type metal ore with 5 (or more) stacks

greetings
 
Level 11
Joined
Jun 21, 2007
Messages
505
To stack items you can try this:
  • Item Stacking
  • Events
    • Unit - A unit acquires an item
  • Conditions
  • Actions
    • If (Conditions) Then (Then actions) Else (Else actions)
      • If - Conditions
        • Hero has item of type (Item Type of (Item being manipulated))
      • Then - Actions
        • Set A_VARIABLEOFTYPE_INTEGER = 0
        • For each integer A from 1 to 6 do actions
          • If (Item carried in slot (Integer A) of (Unit manipulating the item) Equal to item-type of (Item being manipulated)) then do (Set A_VARIABLEOFTYPE_INTEGER = A_VARIABLEOFTYPE_INTEGER + 1) else do (Do nothing)
        • Set A_VARIABLEOFTYPE_ITEMTYPE = Item-type of (Item being manipulated)
        • For each integer A from 1 to 6 do actions
          • If (Item carried in slot (Integer A) of (Unit manipulating the item) Equal to item-type of (Item being manipulated)) then do (Remove item carried in slot (Integer A) of (Hero manipulating the item) else do (Do nothing)
        • Hero - Create item of type (A_VARIABLEOFTYPE_ITEMTYPE) and give it to (Hero manipulating the item)
        • Item - Set charges of (Last created item) to (A_VARIABLEOFTYPE_INTEGER)
      • Else - Actions
        • Do nothing
 
Last edited:
Status
Not open for further replies.
Top