• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

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