System Item Stacking

SFilip

Gone but not forgotten
Reaction score
634
Item Stacking System II​

Edit (November 8th, 2006): Replaced the item list condition with something more global, now affects all stackable items.

I decided to remake my old system in order to make it better. This one has a limit of items that can be in one slot at time. I figured that the most suitable way to define this limit would be the item level. By default the level can't go above 8, but you can bypass that by simply holding Shift when changing the level field.
Also you only need one trigger for this system while the second is optional (but recommended & useful).
There is also a demo map this time if you don't want to do everything manually. ;)

Code:
Acquire
    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

This is the second, optional trigger. It allows you to split stackable items by making a double right-click.
Requires 2 variables: order (of type Integer) and L (of type Point).
Code:
Split
    Events
        Unit - A unit Is issued an order targeting an object
    Conditions
    Actions
        Custom script:   set udg_order = GetIssuedOrderId()
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                order Greater than or equal to 852002
                order Less than or equal to 852007
                (Target item of issued order) Equal to (Item carried by (Ordered unit) in slot (order - 852001))
                (Charges remaining in (Target item of issued order)) Greater than 1
            Then - Actions
                Item - Set charges remaining in (Target item of issued order) to ((Charges remaining in (Target item of issued order)) - 1)
                Set L = (Position of (Ordered unit))
                Item - Create (Item-type of (Target item of issued order)) at L
                Custom script:   call RemoveLocation(udg_L)
                Item - Set charges remaining in (Last created item) to 1
            Else - Actions

If you are curious about the order...852002 is the order id used when you move the item to inventory slot 1. 852003 is the same thing, but for slot 2 etc.
The third condition checks if the slot you dropped it on is the same as the slot used by the item previously.

If you find any bugs feel free to PM me and i'll fix them right away.
 

Attachments

  • StackingSystemII.w3x
    14.1 KB · Views: 2,556
I

icearrow

Guest
This was incredibly helpful. Thanks so much. I am typically really good with triggers, but I tried to figure out this trigger for a long time and I finally gave up and searched hard for a tutorial. This trigger works very soundly. I still am puzzled how you came up with such a trigger. Nice Job!
 
T

Trigath

Guest
When I try to open the example map in the editor I get an error saying:

"Trigger does not exist in database: GetItemCharges"

and then the editor crashes...what's the problem here?
I use the normal TFT world editor...
 

Black Hawk

New Member
Reaction score
16
When I try to open the example map in the editor I get an error saying:

"Trigger does not exist in database: GetItemCharges"

and then the editor crashes...what's the problem here?
I use the normal TFT world editor...

You need to update Warcraft 3 TFT by getting the latest patch.

Oh and SFilip Thanks for the triggers. I needed them for an Rpg im making.
 

Black Hawk

New Member
Reaction score
16
Help

I am making a map with throwing knives and other items. The map has the same system you have created but doesent stack.
 

SFilip

Gone but not forgotten
Reaction score
634
Have you set the item's level properly?
Is the item stackable?
 

Black Hawk

New Member
Reaction score
16
Im sorry I replied this late. I attatched a word file with the stats of two items.
 

Attachments

  • Items.doc
    76 KB · Views: 639

SFilip

Gone but not forgotten
Reaction score
634
Well the only solution I found for that is Appie's system which uses two versions of each items, one that works as a tome that does nothing and the other being the actual item. However I never really got this system to work so...
 
K

Kesrith

Guest
First thank you for this i works really fine. But i have a question. I wanted to make items like claws of attack stackable, but now the claws stack but the damage they give doesnt. I hope somebody can tell me how i can fix that.
 

SerraAvenger

Cuz I can
Reaction score
234
First thank you for this i works really fine. But i have a question. I wanted to make items like claws of attack stackable, but now the claws stack but the damage they give doesnt. I hope somebody can tell me how i can fix that.

Only easy solution here was using my doubler instead of a stacker, but that would only work with powers of two and only with a low number of stacks.
Another possibility would be the following:
You'll need a +damage skill with X levels, and a maximum stack of X. Then you let the damage of the skill be claw damage * level.
Now whenever someone picks up an item, you let the claws stack and then you'll need to find the stack and set the level of the skill for the picking unit to the number of claws on the stack.

hth, davey
 

Ultramen

Cool Member
Reaction score
3
Reply

Whoa, i made a thread how to combine items with charges, i had a post to check this thread out, and what do you know. It works.
 

Hildagarn

Member
Reaction score
20
When i buy 2 of the same items the stacking goes blank and i can use the number unlimited times :/ I don't know what im doing wrong...i copied ur trigger, my item has 1 charge and is lvl 5
 

DrEvil

FCRI Associate!
Reaction score
111
I give you a 5 star rating

Ive been needing a stacking system lately and now ive found it .

:D Good Job
 

lindenkron

You can change this now in User CP
Reaction score
102
The split system dont work for me. It does merge the items on pickup..

What item do you use? I tried with health pot, scroll of haste and alot others.. They wont split, they just move the entire group.
 

SFilip

Gone but not forgotten
Reaction score
634
If you imported it correctly, a double right-click should split the item.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +1
  • V-SNES V-SNES:
    Happy Friday!
    +1

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top