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

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
I know that there are a lot of item stacking system, but it works with full inventory!

I took the map of Googlieeyes, then I added the triggers that make it work with full inventory... all in GUI...

SORRY IF I TOOK THE MAP THAT DIDN'T BELONGED TO ME, HOPES YOU ARE OK...

Credits: Googlieeyes (and PippoKiller)

Keywords:
item stack stacking system with full inventory work
Contents

Item Stack system (Map)

Reviews
09:40, 21st Oct 2009 TriggerHappy187: You leak about 60 groups and 60 locations every second, which could cause major lag. And there is already a better item charge system so I'm go to have to reject this.

Moderator

M

Moderator

09:40, 21st Oct 2009
TriggerHappy187:

You leak about 60 groups and 60 locations every second, which could cause major lag. And there is already a better item charge system so I'm go to have to reject this.
 
Level 2
Joined
Aug 9, 2008
Messages
22
The easiest way (but also memory inefficient) is to make all items powerups and then when you pick one up you either place the non-powerup version of the item in the inventory or you increase the charges if the item is stackable and already in the inventory. That way there is no error message and the triggers to accomplish this are fairly simple. You just have to have two instances of every stackable item (the powerup and the non-powerup). Good thing blizzard upped our limit to 8 megs :thumbs_up:
 
Level 13
Joined
Mar 6, 2008
Messages
525
The easiest way (but also memory inefficient) is to make all items powerups and then when you pick one up you either place the non-powerup version of the item in the inventory or you increase the charges if the item is stackable and already in the inventory. That way there is no error message and the triggers to accomplish this are fairly simple. You just have to have two instances of every stackable item (the powerup and the non-powerup). Good thing blizzard upped our limit to 8 megs :thumbs_up:

Man, i didn't understood what you mean...

Anyway, the first try didn't work...it could work but it may sucks...
 
Level 2
Joined
Aug 9, 2008
Messages
22
Man, i didn't understood what you mean...

Anyway, the first try didn't work...it could work but it may sucks...

A powerup is an item that you can pick up with a full inventory, like a tome of power or bundle of lumber. If all items are powerups when you drop them from a creep/boss/quest or buy them from a store then you can pick them up no problem even with a full inventory.

Then all you have to do is run a trigger to check from the corresponding item in the acquiring unit's inventory and either add that item to the inventory (if it is not already there) or increase the charge of the item (if it is).

How do you make the powerup 'correspond' with the non powerup? Since wc3 doesn't allow for two dimensional arrays you have to use parallel arrays and fill them at initialization or shortly thereafter.

If you want to be able to look up corresponding items directly (so that you don't have to search the entire array ever time a unit picks up an item) I would recommend using the item's health as the array index. Make sure units in your map can't attack items or make the item invulnerable so that they can't attack an item and then pick it up to get a different one.

Does that clear it up for you a bit?
 
Level 13
Joined
Mar 6, 2008
Messages
525
A powerup is an item that you can pick up with a full inventory, like a tome of power or bundle of lumber. If all items are powerups when you drop them from a creep/boss/quest or buy them from a store then you can pick them up no problem even with a full inventory.

Then all you have to do is run a trigger to check from the corresponding item in the acquiring unit's inventory and either add that item to the inventory (if it is not already there) or increase the charge of the item (if it is).

How do you make the powerup 'correspond' with the non powerup? Since wc3 doesn't allow for two dimensional arrays you have to use parallel arrays and fill them at initialization or shortly thereafter.

If you want to be able to look up corresponding items directly (so that you don't have to search the entire array ever time a unit picks up an item) I would recommend using the item's health as the array index. Make sure units in your map can't attack items or make the item invulnerable so that they can't attack an item and then pick it up to get a different one.

Does that clear it up for you a bit?

Yeah now it's clare... i'll do it when i have some free time
 
Level 13
Joined
Mar 6, 2008
Messages
525
If you want to be able to look up corresponding items directly (so that you don't have to search the entire array ever time a unit picks up an item) I would recommend using the item's health as the array index. Make sure units in your map can't attack items or make the item invulnerable so that they can't attack an item and then pick it up to get a different one.

No, i will use the item name...it is easyer...right?
 
Level 2
Joined
Aug 9, 2008
Messages
22
No, i will use the item name...it is easyer...right?

Except the item name doesn't work for an array index? You need a number and specifically an integer but a simple R2I() fixes that for you. Using the item name you'd have to search your whole array which is much less efficient (although depending on the number of item types included it may be unnoticeable).
 
Level 13
Joined
Mar 6, 2008
Messages
525
Except the item name doesn't work for an array index? You need a number and specifically an integer but a simple R2I() fixes that for you. Using the item name you'd have to search your whole array which is much less efficient (although depending on the number of item types included it may be unnoticeable).

Could you do it for me?

I'm not so pro :/
 
Level 2
Joined
Aug 9, 2008
Messages
22
I'm gonna do it for myself sometime soon so i'll send you the algorithm i guess. not sure when it'll get done since i'm going back to school in less than two weeks but it'll happen eventually.
 
Level 2
Joined
Dec 26, 2007
Messages
13
say the hero has a full inventory, and one of the items it has are healing wards
if another hero passes over to that hero more healing wards, they dont stack, they just drop on the floor.

other than that good system

also, is there a way to make a maximum amount of charges, eg 100 healing wards max.
 
Level 2
Joined
Aug 9, 2008
Messages
22
just put a condition on the actual stacking part. either if over 100 set to 100 or if over 100 create same item on the ground with leftover charges.
 
Top