• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Neutral Passive Shop Hold items

Status
Not open for further replies.
Level 25
Joined
Jul 10, 2006
Messages
3,315
Simplest way:
Remove the sell ability from the shop, give it an inventory ability. Now you can drop items on the shop, and have them remain in its inventory. Make a trigger that will drop the item from it, maybe a text command or an ability.
Of course this method has the side effect of making the shop no longer sell items.
 
Level 25
Joined
Jul 10, 2006
Messages
3,315
Definitely.

It needs to following abilities:
Shop Sharing (this allows other players to control the unit)
Inventory (so that you can drop items on it)

Storing the items is simple enough, but next you need to retrieve the item, and prevent players from using more than one storage space.
Make an array item variable called StoredItem[ ]
When the shop acquires an item, you set StoredItem[player number of (previous owner of acquired item)] = acquired item
But before that, you must check if StoredItem[as above] is already set to an item, at which point you should drop it since the hero already has something stored.

So now you need to make a way for the shop to drop the item.
Make a powerup item (based on healing rune or whatever) called Retrieve item, and have your shop sell it.
Now make a new trigger: when a hero acquires the Retrieve Item, make the shop drop StoredItem[player number of owner of triggering unit]
Don't forget to now set StoredItem[as above] = no item to reenable storage
 
Level 10
Joined
Jan 20, 2011
Messages
492
Thank you so much for that, I will work on the code tomorrow.

One last question, sorry, i want to make an enchant item which creates a stronger item for the player, new item, on the ground. I know i have to make an item for enchant, but what im asking is how to find the correct item for the triggering player, in the slots then create item on the ground, and if not it destroys the enchant item.

I have a idea how to do this, but i would like an experts opinion

+rep for your help so far
 
Level 10
Joined
Jan 20, 2011
Messages
492
Ok;
Say you have 3 items in the neutral passive units inventory, and 1 space spare, player 1 wants to enchant his item which is in the first slot designated by the last trigger you told me, now when you use enchant it finds the slot owned on the unit by player 1, then if its a specific item, it destroys the item in the slot, and creates a new one in player 1s hero inventory, but if he has the wrong item or slot empty it destroys the enchant item, which i had to create to do the trigger, and comes up with the message 'cannot enchant'.

Is that explanation better?
 
Level 10
Joined
Jan 20, 2011
Messages
492
Ok thanks again for your help, I will PM you if I have any more troubles. Hopefully I won't

EDIT: OK I noticed one minor problem, when I sell and item it drops on the ground, say Enchant. This is ok, I will just have to change the Event to A unit sell and item, instead of acquires. I try selecting my unit, with the enchanter it shows the arrow, but it won't give the item to me, just drop it on the ground. This might be due to not having the sell items ability, idk. Not a big problem just thought I would let you know.
 
Last edited:
Level 20
Joined
Jul 14, 2011
Messages
3,213
CroMoX you're already asking the same thing about enchanting in another thread. In fact, I explained and made a system for you to enchant items on the ground.
 
Status
Not open for further replies.
Top