• 🏆 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 System

Status
Not open for further replies.
Level 14
Joined
Dec 29, 2009
Messages
931
I looked in the tutorials section for help on how to make an item stacking system and I found this. http://www.hiveworkshop.com/forums/...s-incredible-item-stacking-system-doom-20961/

I'm trying to get it to work with items bought from a shop. Here is what I have.

  • ItemStack1
    • Events
      • Unit - A unit Sells an item (from shop)
    • Conditions
      • (Item-type of (Sold Item)) Equal to Lesser Healing Potion (R)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) has an item of type Lesser Healing Potion) Equal to True
        • Then - Actions
          • Item - Set charges remaining in (Item carried by (Buying unit) of type Lesser Healing Potion) to ((Charges remaining in (Item carried by (Buying unit) of type Lesser Healing Potion)) + 1)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Triggering unit) has an item of type Lesser Healing Potion) Equal to False
            • Then - Actions
              • Hero - Create Lesser Healing Potion and give it to (Buying unit)
            • Else - Actions

I thought this would work, but it doesn't do anything... The potion is bought, and a non-runic potion is added to the hero/placed on the ground however when you purchase another one, it doesn't add to the charges, instead it makes a completely new one, with one charge.

Is there something I'm doing wrong?

Key
(R) - "Runic Potion"
 
Level 26
Joined
Mar 19, 2008
Messages
3,140
As far as I know, anything with charges can be stacked. In the item editor, there isn't an option to set the maximum amount of stacks.

There isn't? My Editor is in polish so let me explain: part which i underlined means: Amount of Stacks.
 

Attachments

  • item.JPG
    item.JPG
    19.8 KB · Views: 73
Level 14
Joined
Dec 29, 2009
Messages
931
Wow, you expect me to understand any of that? ENLGISH please. And no, there isn't.

Here is the closest thing to maximum charges, and this simply adds charges to the item when you buy it. So for instance, if I bought a potion that had Stats - Number Of Charges: set to 10, when I bought the potion, if would give me 10 of the potion.
 
Level 14
Joined
Dec 29, 2009
Messages
931
Yeah, I fixed that.

EDIT: Ooops. I thought I fixed that anyway... On one of them I did, the other one (top) was still triggering unit... HAHAHAHAH, okay, I must have hit the cancel button by accident.

Thanks guys, +REP to both of you for helping me.
 
Status
Not open for further replies.
Top