• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[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