• 🏆 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!
  • ✅ Time to vote for the top 3 models! The POLL for Hive's 6th HD Modeling Contest: Mechanical is now open! 📅 Poll close on July 16, 2024! 🔗 Cast your vote now!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

[Trigger] Repair all buildings

Status
Not open for further replies.
Hi, I have an item that when you buy it you automatically use it and the trigger repairs all buildings with some percentage. It's based on item agility gain. Also I set the agility gain of item agility gain to 0.But this here is not working, can you tell me why?

  • repair buildingss
    • Events
      • Unit - A unit Uses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Repair
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area) matching ((((Matching unit) is A structure) Equal to True) and ((Race of (Owner of (Triggering unit))) Equal to (Race of (Matching unit))))) and do (Actions)
        • Loop - Actions
          • Unit - Set life of (Picked unit) to ((Percentage life of (Picked unit)) + 90.00)%
 
Level 5
Joined
Jan 27, 2014
Messages
164
What isn't working? The trigger looks fine to me.

My advice is add game text at the first line of action. And another game text within the loop.

If you can't see the first game text, then it's probably caused by the wrong primary condition (you setup the wrong item or the item wasn't even used at all). If the first game text appear but not the second game text then it's your unit group conditioning problem (either it's the wrong race or your structures aren't structures after all).
 
Level 26
Joined
Sep 26, 2009
Messages
2,434
The trigger in post #1 works, I just tested it using the very same trigger.
The only thing that comes to my mind is that the player slot's race is different than of other player, though both these players use same type of buildings. In that case, it would not "heal" the building.

example:
Player 1 has Human race, uses Human structures
Player 2 has Orc race, but he uses Human structures as well

In this case, when player 1 uses item, it won't heal Player 2's structures, since even though their types of buildings are same, their races (human x orc) do not match.
 
Status
Not open for further replies.
Top