HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Small ItemStacking Problem

01-04-2009, 01:07 PM#1
akolyt0r
Hey,
Expand JASS:

i dont know how i can get the above script to work, when the inventory is already full... otherwise it performs quite well :)

If trying to buy an item, altough the inventory is already full would fire an orderevent, i would perhaps be able to fix the problem for myself, but it seems like it doesnt fire any orderevent :/

Thanks in advance, Akolyt0r
01-04-2009, 01:27 PM#2
Alexander244
One solution is to make a powerup version of every item, and an inventory version of every item.
01-04-2009, 02:10 PM#3
akolyt0r
Quote:
Originally Posted by Alexander244
One solution is to make a powerup version of every item, and an inventory version of every item.

That really sounds like a lot of boring object-editor work 0.o
Is there any other possibility ?
01-04-2009, 02:45 PM#4
ToukoAozaki
Needs more investigation, but here's a tip. You can put two different inventory abilities into a unit. Try using a one-slot inventory ability and use triggers to make sure nothing gets into that.
01-04-2009, 02:54 PM#5
akolyt0r
Quote:
Originally Posted by ToukoAozaki
Needs more investigation, but here's a tip. You can put two different inventory abilities into a unit. Try using a one-slot inventory ability and use triggers to make sure nothing gets into that.
Sounds like a possibility ...but ensuring that with triggers would be quite messy aswell ...
either you would have to drop the item on the ground instead, or remove it, and add the itemcost to players gold again ....but you cant get an items cost with triggers :/
...Well yeah there is a system somewhere on this page which accomplishes that, but i dont like how it works :> looks to messy and its performance isnt that good aswell...

If there isnt any other possibility i will either use the Tome-way, or just ...call DoNothing()
01-04-2009, 03:02 PM#6
ToukoAozaki
Quote:
Originally Posted by akolyt0r
Sounds like a possibility ...but ensuring that with triggers would be quite messy aswell ...
either you would have to drop the item on the ground instead, or remove it, and add the itemcost to players gold again ....but you cant get an items cost with triggers :/
...Well yeah there is a system somewhere on this page which accomplishes that, but i dont like how it works :> looks to messy and its performance isnt that good aswell...

If there isnt any other possibility i will either use the Tome-way, or just ...call DoNothing()

Well, actually that's pretty straightforward and not so messy. You just have to:
1. stack item and quit if possible
2. check inventory item count
3. drop item if count is 7 (or 6 if the item is not in the inventory at the time of event)

Event will catch any incident of an item getting into the inventory. AFAIK DotA does this too.