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

[Solved] Mass repair

Status
Not open for further replies.
Level 4
Joined
May 24, 2017
Messages
93
I would like to modify the human repair ability to heal all structures of a type that are next to each other. How do I trigger this? I also want it to auto-cast like the repair ability, so no spam clicking if possible.

I thought of selecting all units of the repaired type and increase health with triggers but then the building could be on the other side of the map and I want the repairing unit to have to be in the area. Any help is appreciated! +rep to any replys

EDIT: How can I detect everytime the Repair ability is used? Like every time the unit gains health?
 
Last edited:
Level 5
Joined
Jul 31, 2020
Messages
103
Selecting all units was the right idea. You can do it in a rect, or in range. Doesn't have to be the entire map.

Although that question in your edit is a volatile one, as nobody is ever really sure if it works or not since it's rather... wonky, order id comparison would probably work for detecting Repair. Don't quote me on this because I personally haven't tested this case, but it should work on paper.
 
Level 4
Joined
May 24, 2017
Messages
93
The repair order id is only detected on the first repair. It does not loop on every health increase.

  • Mass repair
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • (Ability being cast) Equal to Repair (Player)
      • (Unit-type of (Target unit of ability being cast)) Equal to Barricade
    • Actions
      • Set VariableSet temp_group = (Units owned by (Owner of (Triggering unit)) of type Barricade)
      • Unit Group - Pick every unit in temp_group and do (Actions)
        • Loop - Actions
          • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + 5.00)
      • Unit Group - Remove all units from temp_group.
What do I use for the event and conditions? Am I checking an order id and when is the heal applied? At what event? Its not channeling. Maybe starts the effect? I tried but I might have the wrong conditions. Ignore that it is picking all Barricades.

EDIT: After testing, there is no repair order id to detect on loop. Do I use another ability like priest heal? that only targets buildings and change the stats to be like repair? just an idea
 
Last edited:
Level 5
Joined
Jul 31, 2020
Messages
103
The repair order id is only detected on the first repair. It does not loop on every health increase.

What do I use for the event and conditions? Am I checking an order id and when is the heal applied? At what event? Its not channeling. Maybe starts the effect? I tried but I might have the wrong conditions. Ignore that it is picking all Barricades.

EDIT: After testing, there is no repair order id to detect on loop. Do I use another ability like priest heal? that only targets buildings and change the stats to be like repair? just an idea

I checked. 852024 as long as the Peasant is repairing, and also while he's running up to the building he's about to repair.
 
Level 4
Joined
May 24, 2017
Messages
93
Thank you for the help, I figured out a work around by changing up the heal ability and triggering the repair. Thanks for the help.

EDIT:
My trigger for future refrence
  • Mass repair
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Repair (Healing)
      • (Unit-type of (Target unit of ability being cast)) Equal to Barricade
    • Actions
      • Set VariableSet temp_group = (Units within 200.00 of (Position of (Triggering unit)) matching (((Owner of (Matching unit)) Equal to (Owner of (Triggering unit))) and ((Unit-type of (Matching unit)) Equal to Barricade)).)
      • Unit Group - Pick every unit in temp_group and do (Actions)
        • Loop - Actions
          • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + 5.00)
      • Unit Group - Remove all units from temp_group.
 
Status
Not open for further replies.
Top