1. Find your way through the deepest dungeon in the 18th Mini Mapping Contest Poll.
    Dismiss Notice
  2. A brave new world lies beyond the seven seas. Join the 34th Modeling Contest today!
    Dismiss Notice
  3. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
Hive 3 Remoosed BETA - NOW LIVE. Go check it out at BETA Hive Workshop! Post your feedback in this new forum BETA Feedback.
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Trigger Issue with training unit

Discussion in 'World Editor Help Zone' started by Xzere, May 5, 2020.

Tags:
  1. Xzere

    Xzere

    Joined:
    Feb 23, 2020
    Messages:
    152
    Resources:
    0
    Resources:
    0
    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)
     
  2. Wrda

    Wrda

    Joined:
    Nov 18, 2012
    Messages:
    1,317
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    • Player - Limit training of Mountain King to 1 for (Picked player)

    Put it in a map initialization trigger.
     
  3. Xzere

    Xzere

    Joined:
    Feb 23, 2020
    Messages:
    152
    Resources:
    0
    Resources:
    0
    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.
     
  4. Quetra

    Quetra

    Joined:
    Feb 16, 2020
    Messages:
    9
    Resources:
    0
    Resources:
    0
    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'
     
  5. Xzere

    Xzere

    Joined:
    Feb 23, 2020
    Messages:
    152
    Resources:
    0
    Resources:
    0
    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: May 5, 2020
  6. Wrda

    Wrda

    Joined:
    Nov 18, 2012
    Messages:
    1,317
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    Then don't use the altar, use a tavern.
     
  7. Xzere

    Xzere

    Joined:
    Feb 23, 2020
    Messages:
    152
    Resources:
    0
    Resources:
    0
    Well i could, but the unit is not sold, it's trained. And it also have upgrades for more heroes
     
  8. Quetra

    Quetra

    Joined:
    Feb 16, 2020
    Messages:
    9
    Resources:
    0
    Resources:
    0
    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: May 5, 2020
  9. Xzere

    Xzere

    Joined:
    Feb 23, 2020
    Messages:
    152
    Resources:
    0
    Resources:
    0
    This could actually work, thank you! ^^