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

Hero Tavern related question

Status
Not open for further replies.
Level 2
Joined
May 2, 2008
Messages
10
Hi. I am a little new to triggers, and i try, for the first time, to create a map using a bunch of triggers. While making the map i met a problem, which i could not resolve. I made some triggers, which buy a hero from a tavern, destroy the buying unit, and move the hero to a location, ready for action. All that works very well. But when i try to make only one player in the map can have that type of hero, everything i try is not working correctly.
Anyone got any clue of what to do? :spell_breaker:
 
This increadibly simple trigger makes a hero completly dissapear from the tavern.
  • Hero Disable
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • ((Sold unit) is A Hero) Equal to True
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Player - Make (Unit-type of (Sold unit)) Unavailable for training/construction by (Picked player)
It works quite well, but If you are doing a game with a rematch feature, then you have a snag.
  • Reset
    • Events
      • Round End
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
        • Loop - Actions
          • Player Group - Pick every player in (All players) and do (Actions)
            • Loop - Actions
              • Player - Make (Unit-type of (Picked unit)) Available for training/construction by (Picked player)
A few leaks in an initilization or end trigger arnt going to kill you, the triggers that you really have to look out for are the periotic events.
 
Status
Not open for further replies.
Top