[Trigger] Mine Item-Stacking System - The best one ?

Status
Not open for further replies.
Level 6
Joined
Jan 12, 2011
Messages
110
Hello,
as the title says, this is mine Item-Stacking system.
I have searched for many and many systems, but all were not efficient as I wanted, or they were too much complicated, with many variables, that are not needed.
So I decided to create my own system, that will be pretty easy and even efficient.

This system works even if your inventory is full !!!

1. What do we have to do, before making the trigger itself ?

Ok, first, we need some item, you want to stack.
- I'll use mine custom item called Minor Healing Potion

2. Creating the trigger
stackingtrigger1.jpg

Let's start.

1) As you see at the picture, Set event to: Event - Generic Unit Event (A unit Is issued an order targeting an object)

2) Create Or - Any (Multiple) Conditions are true, so you can add more items to this system and it will still work for any item that is here

3) Under Actions create If/Then/Else Multiple Action
Conditions
- 1st Item Comparison
- 2nd Boolean Comparison
- 3rd Boolean Comparison
- 4th Boolean Comparison
Then actions
-Well, the first one is pretty long, so here is the picture of whole action:
stackingtrigger2.jpg

-and then just simple Item Remove action where you remove that targeted item.
Else actions
- leave blank

How does it work:
1. Unit targets some object - if its any object of object we specified (ex. Minor Healing Potion), it will start an action
2. It checks, if we have item of that targeted object, if no, then A, if yes theb B
A- The Unit will just normally pick up the item
B- If the unit has the same item as is targeted object, and is in range of 250 of that object, it will add one more charge to that item and removes the targeted item.

Don't say its not simple enough. :grin:

Pros:
Easy GUI
Efficient
You can have full inventory and it will still stack

Cons:
If you have that item and its going to stack, the hero will move at the position of that item - I didn't figured how to stop him from doing that


If you find any mistakes in the system, please, reply it and share with others :)
Thanks


Demo map with stacking trigger:
 

Attachments

  • ItemStackingSystem_by_Donach.w3x
    20 KB · Views: 47
Level 6
Joined
Jan 12, 2011
Messages
110
1) How do you mean unit group ?
2) I'm not pretty sure how or why it should leak ?
3) If invetory is full, the potions will still stack, so where is the issue ?
4) Max stack size - I don't think this is problem, because this system is mainly for potions... Still, I'll think about limit to 100
5)Uh, don't know what you mean. If you have the item you are targeting, it will increase set charges to sum of charges of both items (in inventory and that one on the ground)
6) It was my purpose, to make it withou variables, because it is crazy system then and long in GUI (and I don't know JASS :))
7) Unstacking is different system, this is stacking. Still, I'll try to implent it.

Thx for all your misunderstandings found.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
1) How do you mean unit group ?
2) I'm not pretty sure how or why it should leak ?
3) If invetory is full, the potions will still stack, so where is the issue ?
4) Max stack size - I don't think this is problem, because this system is mainly for potions... Still, I'll think about limit to 100
5)Uh, don't know what you mean. If you have the item you are targeting, it will increase set charges to sum of charges of both items (in inventory and that one on the ground)
6) It was my purpose, to make it withou variables, because it is crazy system then and long in GUI (and I don't know JASS :))
7) Unstacking is different system, this is stacking. Still, I'll try to implent it.

Thx for all your misunderstandings found.
  1. You know, a group of units. It leaks one.
  2. Search for the term "Memory Leak" on the hive's tutorial-page.
  3. Yet the error will still display, won't it?
  4. A stacking system should support exceptions - even if only 1 item needs a limit this system is rendered useless because it does not allow such a limit.
  5. [skip]
  6. Then you have to learn more, because variables make systems EASIER and they allow more flexibility. Without variables, your system will be very basic.
 
Status
Not open for further replies.
Top