• 🏆 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!
  • ✅ Time to vote for the top 3 models! The POLL for Hive's 6th HD Modeling Contest: Mechanical is now open! 📅 Poll close on July 16, 2024! 🔗 Cast your vote now!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

Restocking a sellable unit.

Status
Not open for further replies.
Level 6
Joined
May 11, 2010
Messages
236
Hi guys, I'm trying to work out if there's a way to restock a unit, as in;

A building sells a unit and the stock of that unit goes to 0, so no more can be bought. When that unit dies, the stock of that unit goes back to 1 so that another can be bought. I've already thought about replacing the building but that will reset any other purchases too, I've also thought about limiting players to only a certain amount of that unit, but that doesn't apply to 'sold' units, only trained - also, I only want to have one of these units on the field at the time, not 1 per player, so selling and (somehow) restocking once it dies seems to be the way to go. I'm hoping there's a simple trigger function I've missed :p.

- thanks :)
:goblin_boom:
 
Level 7
Joined
Mar 5, 2009
Messages
254
Ok try this :
  • Untitled Trigger 001
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Footman
    • Actions
      • Neutral Building - Remove Footman from all marketplaces
Note : Make a variable type unit and set the variable to Selling Unit.

  • Untitled Trigger 002
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Footman
    • Actions
      • Neutral Building - Add Footman to (Triggering unit) with 1 in stock and a max stock of 1
Note 2 : Here use the variable and replace triggering unit with your variable.
 
Level 6
Joined
May 11, 2010
Messages
236
Ok try this :
  • Untitled Trigger 001
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Footman
    • Actions
      • Neutral Building - Remove Footman from all marketplaces
Note : Make a variable type unit and set the variable to Selling Unit.

  • Untitled Trigger 002
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Footman
    • Actions
      • Neutral Building - Add Footman to (Triggering unit) with 1 in stock and a max stock of 1
Note 2 : Here use the variable and replace triggering unit with your variable.

That's it! That's the function I was looking for! Neutral building... urgh. Thanks Lifee :ogre_haosis:
 
Status
Not open for further replies.
Top