• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • ✅ Time to vote for the top 3 models! The POLL for Hive's 6th HD Modeling Contest: Mechanical is now open! 📅 Poll close on July 16, 2024! 🔗 Cast your vote now!

[Trigger] Stack Item

Status
Not open for further replies.
Level 2
Joined
Mar 22, 2008
Messages
20
Hi,
I have found a trigger for stacking items, but it doesn't work...
I tried several times to find the problem but i'm not skilled enough in this trigger things to find the problem on my own so i hope you can help me
here is the trigger:
  • Unit Acquires Item
    • 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))
              • (Charges remaining in (Item carried by (Hero manipulating item) in slot (Integer A))) Less than (Item level of (Item carried by (Hero manipulating item) in slot (Integer A)))
              • (Item carried by (Hero manipulating item) in slot (Integer A)) Not equal to (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 (Hero manipulating item) in slot (Integer A))) + (Charges remaining in (Item being manipulated))) Greater than (Item level of (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 level of (Item being manipulated))))
                  • Item - Set charges remaining in (Item carried by (Hero manipulating item) in slot (Integer A)) to (Item level of (Item being manipulated))
                • Else - 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 3
Joined
Sep 13, 2008
Messages
63
I'll take a guess. Besides the trigger you also need the item to be stackable. For instance, healing slave.
 
Level 2
Joined
Mar 22, 2008
Messages
20
@hawk900:
i think all actions below the line
  • Loop - Actions
are in a loop...
so the integer is in a loop!
dont know what you mean
 
Level 14
Joined
Nov 20, 2005
Messages
1,156
http://www.hiveworkshop.com/forums/f414/cg-inventory-stacking-84998/

Rao's method is slightly better when picking stacking items with a full inventory and using queued orders, but a lot more work and requires a rune item duplicate of every item to stack. Your choice. Learning how to use basic custom code will be a lot faster than coding a GUI system and putting stuff into it manually.
 
Status
Not open for further replies.
Top