• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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:
Level 26
Joined
Mar 19, 2008
Messages
3,140
@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: 36

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,184
  • 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