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

Need an trigger for Night Elf building renew

Status
Not open for further replies.
Level 3
Joined
Jun 18, 2010
Messages
33
Hi all!

I need your help, once again.
Iam creating new map, and I need an trigger what commands the computer (P7) to repair his buildings that are wounded, but like that there's only max 10 Wisps repairing same building at once.

There's 30 buildings on this base, could someone make an lightweight trigger that commands Wisps to repair if building's hp is not 100%, and check that there's not more than 10 Wisps already repairing that building?

Thank you.

P.S. It would be better if it's in GUI. :p
Helper's ass will be filled by rep. :D
 
Level 17
Joined
Feb 11, 2011
Messages
1,860
Do you want all the wisps to repair the same building at once? I would suggest having 1 wisp per building. Then, every x seconds the game checks if the building doesn't have 100% health and sends the Wisp to repair it. You would need to set each building and Wisp as a variable though.

  • Repair
    • Events
      • Time - Every 10.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 30, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Percentage life of Building[(Integer A)]) Less than 100.00
            • Then - Actions
              • Unit - Order Wisp[(Integer A)] to Night Elf Wisp - Restore Building[(Integer A)]
            • Else - Actions
 
Level 3
Joined
Jun 18, 2010
Messages
33
With this trigger there will only be 1 Wisp per building. If you want a max of 10 it will be a more complicated trigger.

I know, and that's why im asking for help. :DD
Rep for you anyway. :D

However, the problem is not solved yet.
I don't accually care about that is the max 10 wisps, but i just want that there's not 100 wisps trying to repair same building at the same time...
Just couple.
 
Last edited:
@Mr_Bean Your trigger is inaccurate, it's simpe order-repair trigger ;/

@RatchetNClank Here is a test map with requested mini-system. I'll improve it soon if I find better finding formula. Done in GUI as you wanted. Requires Unit Indexer and DamageEvent (creadits to Bribe).

EDIT: Trigger below (Darkgrom's one) does actually the same thing as Mr_Bean's script. One again: it's simple order-repair.
 

Attachments

  • OrderRepair.w3x
    30.8 KB · Views: 37

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,219
  • Repair
    • Events
      • Time - Every 10.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 30, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Percentage life of Building[(Integer A)]) Less than 100.00
            • Then - Actions
              • Unit - Order Wisp[(Integer A)] to Night Elf Wisp - Restore Building[(Integer A)]
              • Set Your_repairing_building = (Target unit of issued order)
              • Set - Wisps_repair = Wisps_repair + 1
              • Set max_HP = (Max life of Your_repairing_building)
            • Else - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • Wisps repair Equal to 10
              • Then Action
                • Trigger - Add to repair done <gen> the event (Unit - Your_repairing_building's life becomes Equal to max_HP)
                • Trigger - turn off this trigger
you got to made another trigger to turn it on.

  • repair done
    • Events
    • Conditions
    • Actions
      • Trigger - Turn on Repair <gen>
 
Status
Not open for further replies.
Top