• 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.

Is it possible to remove/hide an item in the store?

Level 3
Joined
Jul 27, 2021
Messages
8
I want to make it so that when you buy an item, it is removed, and it can no longer be bought.
Trigger to delete an item works on the hero, but not on the building where the item is bought.
Through the trigger to delete an item in a neutral building — did not work.
Is it possible to delete an item in the store or not?
 
Level 30
Joined
Aug 29, 2012
Messages
1,383
Yes you can do this
  • Shop
    • Events
      • Unit - A unit Sells an item (from shop)
    • Conditions
      • (Item-type of (Sold Item)) Equal to Tome of Experience
    • Actions
      • Neutral Building - Remove Tome of Experience from Goblin Merchant 0000 <gen>
But it only works if you have added the item via trigger

  • Neutral Building - Add Tome of Experience to Goblin Merchant 0000 <gen> with 0 in stock and a max stock of 1
Items that you set to be sold in the unit editor can't be removed that way
 
Level 3
Joined
Jul 27, 2021
Messages
8
Yes you can do this
  • Shop
    • Events
      • Unit - A unit Sells an item (from shop)
    • Conditions
      • (Item-type of (Sold Item)) Equal to Tome of Experience
    • Actions
      • Neutral Building - Remove Tome of Experience from Goblin Merchant 0000 <gen>
But it only works if you have added the item via trigger

  • Neutral Building - Add Tome of Experience to Goblin Merchant 0000 <gen> with 0 in stock and a max stock of 1
Items that you set to be sold in the unit editor can't be removed that way
Oh, my God, thank you so much. I don't know what I would have done without you.
I had to tweak the trigger for the card itself a bit, but overall, the triggers are exactly as you wrote.
Thank you. Thank you. Thank you.
 
Level 24
Joined
Feb 27, 2019
Messages
833
There is an alternate approach if your shop only contains a maximum of 12 items.

Abilities - Normal: Shop sharing, Allied Bldg., Select Hero, Shop Purchase Item
Techtree - Items Made: Add items here

Use the native call SetPlayerUnitAvailableBJ( 'itemId', false, Player(PLAYER_NEUTRAL_PASSIVE) ) to hide/show item

Its this action but its not possible to select items in the scroll down menu in GUI but it will work for them.
  • Player - Make Peasant Available for training/construction by Neutral Passive
The benefit of this is that it keeps the hex color coding. The limitation is that the shop can only contain a maximum of 12 items and the hide/show affects all shops containing the items. The shop will have the same behaviour as a player shop in melee.
 
Top