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

[Help!!!]Item Sold Out Remove

Status
Not open for further replies.
Level 3
Joined
Sep 14, 2008
Messages
26
How to remove item that sold at the unit?
How the neutral building remove item sold work?

Actually I want is after I buy this item from shop, the item will be remove from the vendor. Does anyone know how to do this?
 
Level 12
Joined
Apr 16, 2010
Messages
584
To remove it from shop you'll have to add first through triggers, else won't work!
Example:
  • Add
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Neutral Building - Add "Your Item" to ("Your Shop") with 1 in stock and a max stock of 1
  • Buy
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to "Your Item"
    • Actions
      • Neutral Building - Remove "Your Item" from ("Your Shop")
 
Level 12
Joined
Apr 16, 2010
Messages
584
Like for every player, there's each item in shop? In same slot of course. Nah there's no way to do that, but you can do it other way:
  • Untitled Trigger 001
    • Events
    • Conditions
    • Actions
      • Set Point = (Center of (Playable map area)) //point of your shop
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Unit - Create 1 "Your Shop" for (Player((Integer A))) at Point facing Default building facing degrees
          • Neutral Building - Add "Your Item" to (Last created unit) with 1 in stock and a max stock of 1
          • Unit - Hide (Last created unit)
          • Custom script: if (GetLocalPlayer() == Player(bj_forLoopAIndex)) then
          • Unit - Unhide (Last created unit)
          • Custom script: endif
      • Custom script: call RemoveLocation(udg_Point)
Here you create a shop for every player, each player player sees only his shop, so it's the same result.
 
Level 12
Joined
Apr 16, 2010
Messages
584
Well i'm sure that's is what i posted before ^^ It created a shop for every player at same location, but only shop 1 visible to player 1, shop 2 to player 2 and so on. This is the same thing, if you but item you can't buy it anymore, but other players can buy it, but only once as you. Good luck with that anyway. I'm gone... almost gone =)
 
Status
Not open for further replies.
Top