[General] Buying items with full inventory

Status
Not open for further replies.
Hello guys, I just want to ask if it is possible to acquire an item (or in this case, buy a new item) with hero having occupied all the slots of inventory? I want to store the amount of charges to an integer variable, so when the hero acquire a charged item, a random item should be dropped from hero's inventory - to give space for the item acquired by the hero, store the amount of charges the item to the integer variable, remove the bought charged item from the hero's inventory, and reacquire the random item dropped. It should prevent a warning that the hero occupied all slots ("Inventory is full" warning) when buying a charged item with full inventory.

- Also what is the order string/id of hero acquiring an item?
 
Last edited:
Level 12
Joined
Feb 22, 2010
Messages
1,115
As far as I know only way to enable buy with full inventory is, your shop sells dummy units. When an unit is bought from the shop:
1- Corresponding item is created
2- If buying unit has empty inventory slot or item is a charged item that buying unit already has (like a hp/mana pot) it is added to buying unit's inventory. If there is no available slot put it near buying unit or wherever you want.
3- Bought dummy unit is removed from the game.
 
Personnally I used dummy items (copy of my stackable items with "use automatically when acquire = true"), and a version I modified of the Easy Item Stack 'n Split v2.7.4 system.

As a consequence: it adds the charges to your inventory. If max charge is reached, it drops the remaining charges on the floor.

If you want the modified version of Easy Item Stack 'n Split v2.7.4, I can send it to you :)
 
Level 13
Joined
May 10, 2009
Messages
868
It crashes because the unit is attempting to acquire an ability which modifies a hero attribute (XP, agility, strength, intelligence). However, they still can buy items which are set to be "used automatically when acquired". E.g. Manual of Health (+50 HP) can be bought by units.
 
Status
Not open for further replies.
Top