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

Restocking a sellable unit.

Status
Not open for further replies.
Level 6
Joined
May 11, 2010
Messages
237
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
237
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