• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Trigger Issue with training unit

Status
Not open for further replies.
Level 8
Joined
Feb 23, 2020
Messages
255
Hello, how do i make this trigger work? I'm just having an ordinary altar, so when someone starts training that unit-type, it should dissapear.

  • Hero Pick
    • Events
      • Unit - A unit Begins training a unit
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Player - Make (Unit-type of (Trained unit)) Unavailable for training/construction by (Picked player)
 
  • Player - Limit training of Mountain King to 1 for (Picked player)
Put it in a map initialization trigger.
Hm, i have around 30 heroes, i should do that with each one then?

Edit: No one should be able to pick the same Hero, so if someone picks XXX, then no one else should be able to pick him.
 
If the goal is to stop people from picking the Hero after it's already been picked once then the trigger you posted should work, just change 'begins training' to 'finishes training'
Yeah what you just said works perfectly fine. But if 2 people start the training at the same time, both will get it, which is not what i want.
 
Last edited:
This will pick every altar on the map (modify it to your unit type) and cancel the unit currently being trained. If you want it to only cancel the unit type your after, you could use A unit begins training events to constantly update the unit type in a hashtable, as I don't think theres a way to detect this using conditions normally

  • Untitled Trigger 002
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
    • Actions
      • Set VariableSet TempGroup = (Units of type Altar of Kings)
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Custom script: call IssueImmediateOrderById (GetEnumUnit(), 851976)
      • Custom script: call DestroyGroup(udg_TempGroup)
 
Last edited by a moderator:
This will pick every altar on the map (modify it to your unit type) and cancel the unit currently being trained. If you want it to only cancel the unit type your after, you could use A unit begins training events to constantly update the unit type in a hashtable, as I don't think theres a way to detect this using conditions normally

  • Untitled Trigger 002
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
    • Actions
      • Set VariableSet TempGroup = (Units of type Altar of Kings)
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Custom script: call IssueImmediateOrderById (GetEnumUnit(), 851976)
      • Custom script: call DestroyGroup(udg_TempGroup)
This could actually work, thank you! ^^
 
Status
Not open for further replies.
Back
Top