| 12-30-2002, 09:07 PM | #1 |
Just as an example here I'm going to use Agility bonus +1 as the item. Say you want to buy 3 of them, but you only have 1 open slot, is there a way to make them all stack simply? I know how to do it through triggers, and multiple custom items of the same type, with 1 extra use. But is there anyway to do besides that? |
| 12-30-2002, 09:34 PM | #2 |
For each stackable item you would need to create a new unit with 1 more charge than the other, so if u wanted to be able to stack 50 items, u would need 50 different custom items, with 1 charge all the way up to 50. Then when the person buys a item, you would need to check thier inventory for a item of the type, if so, remove the orignal item, wait .1 seconds then create the new item (you must have the wait other wise if thier invenoty is full when you remove the item and replce, the new item will fall to the floor. Now to do the item of the type, you would need: A item array and set all the items to the array, then to run the check: For each interger a 1-50 do: If Item type is = to ItemArray[IntergerA] Then do Trigger Run "Another Trigger" else do nothing Another Trigger Remove Item - ItemArray[IntergerA] wait 0.1 Create item for hero (triggering unit)- ItemArray[Arithimatic(IntergerA + 1)] Note: if u convert to custom text u can do all this in 1 trigger by placing all the actions under the IF statment instead of making multiple triggers... that should do it... |
| 12-30-2002, 09:45 PM | #3 |
Can't you just change it so you buy them at quantities of three? |
| 12-31-2002, 06:52 PM | #4 |
Dakan, I have tried that method, and a few others - but they just dont want to work. I have to remove the item being manipulated first otherwise I end up with 2 items with 2 charges. It just doesn't want to work properly, and if it did it would be a pain to do, because if someone drops an item with 4 charges and you have 3, it won't know to make it 7. Unless you got a better idea, im scrapping this. |
