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

An amount of unit at a time

Status
Not open for further replies.
Level 10
Joined
May 25, 2021
Messages
376
Hello everyone,

Can someone help me create a trigger to
a) make a unit type (in my case: Sapphiron(living), able to be built from the Boneyard) to exist only one at a time (like the Mothership in SCII)?
b) make a hero only be sold once in the tavern?

Thank you very much.

P/s: Pardon my English if there is any mistake.
 
I can help you a bit with the logic you need to apply. If you are searching for the right events and actions to click in GUI, I suggest using the GUI search for keyword functionality (you know, where you can search for actions containing a keyword, right?).

a) You can make unittypes available/unavailable for training for any particular player via triggers.
Logic would be:
  • Trigger1:
    Event - A unit begins training a unit
    Condition - Unittype of trained unit equal to <your unittype>
    Action - Make <your unittype> unavailable for training for owner of triggering unit
    I'm not sure, if the trained unit can actually be grasped after that event, though. If not, you might switch to the event "A player finishes training a unit" and set the training time to 0 to prevent players from training a second unit of that type, before the first has been finished.
  • Trigger2:
    Event - A unit cancels training a unit
    Condition - Unittype of trained unit equal to <your unittype>
    Action - Make unittype available for training for owner of triggering unit
    Again, if the trained unit can't be grasped after that event, the solution in bullet above (training time 0) would make this trigger obsolete.
  • Trigger 3:
    Event - A unit dies
    Condition - Unittype of triggering unit equal to <your unittype>
    Action - Make unittype available for training for owner of triggering unit
b) Isn't that a simple setting in the object editor? Set the heroes max stock size to 1 and refill time to an amount greater than the game length.
Or again, use a trigger removing that hero from the stock of all taverns.
 
Status
Not open for further replies.
Top