• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Item stacking in the inventory

Status
Not open for further replies.
Level 4
Joined
Mar 12, 2008
Messages
83
Is it possible for item to stack in inventory in groups of 10 without trigger use? Like cooked meat in Island Troll Tribes? I made item and its charges are 10, then when item drops from animal trigger changes its charges to 1. But when hero picks up two items with 1 charges it dont stack to one item with 2 charges he just jas 2 items with 1 charge :/.
 
Level 4
Joined
Jan 20, 2007
Messages
65
It is impossible to stack two items together without triggers. It is also impossible to add charges to an item without triggers.
 
Level 11
Joined
Jun 20, 2009
Messages
880
Its pretty easy do with triggers:

  • Stack
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • ((Triggering unit) 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)))
    • 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 (Item being manipulated)
 
Level 4
Joined
Mar 12, 2008
Messages
83
Thanks it works nicely. But i have another problem. I want the items to stack, lets say at 10 max. I tried to make condition that to stack charges of item in hero + charges of item on ground must be equal or lower 10. And when i pick up items they stack and 10 and then when i pick another item it dont stack, but when i pick next item it dont stack too! Like the trigger refers always to the first stack which is 10. :(
 
Status
Not open for further replies.
Top