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

Looping action

Status
Not open for further replies.
Level 3
Joined
Mar 25, 2008
Messages
56
hi guys i want to me a trigger that after a specific unit's hp drops below 190,000 that he create 2 "warriors" at a random point in the region and constantly do so every 5 seconds until it dies.

I got the specific unit hp part but im not sure how to make it loop every 5 seconds unit unit dies any tips?
 
  • Trigger 1
  • Events
    • Unit - Boss' health goes under 190000
  • Conditions
  • Actions
    • Trigger - Turn on Trigger 2
  • Trigger 2
  • Events
    • Time - Every 5 seconds
  • Conditions
  • Actions
    • set TempPoint1 = Position of boss
    • Create 2 Warriors for player 14 neutral hostile at TempPoint1, facing default building degrees
    • Custom script: call RemoveLocation(udg_TempPoint1)
    • If Boss is dead equal to true then Trigger - Disable this trigger else do nothing
This SHOULD work, tell me any bugs.
 
Level 13
Joined
Sep 14, 2008
Messages
1,408
Nooo....

Why use 2 triggers... that's a total waste in my opinion.

Just go like: This

  • Trigger 2
  • Events
    • Time - Every 5 seconds
    • Unit - Boss' health goes under 190000
  • Conditions
  • Actions
  • If(Boss health is < 190000)
  • Then
    • set TempPoint1 = Position of boss
    • Create 2 Warriors for player 14 neutral hostile at TempPoint1, facing default building degrees
    • Custom script: call RemoveLocation(udg_TempPoint1)
    • If Boss is dead equal to true then Trigger - Disable this trigger else do nothing
 
In the loop trigger, you will need some condition, to check if the boss's health is still under 190.000.
  • Trigger1
  • Events
    • Time - Every 5.00 seconds of game-time
  • Conditions
  • Actions
    • If (All conditions are true) then do (Actions)
      • If - Conditions
        • (Life of (Boss)) Less than or Equal to 190000
      • Then - Actions
        • Set TempPoint = (Random point in (Your region <gen>))
        • Unit - Create 2 Warrior for (Owner of (Boss)) at TempPoint facing default building degrees
        • Custom script: call RemoveLocation (udg_TempPoint1)
      • Else - Actions
  • Trigger2
  • Events
    • Unit - A unit dies
  • Conditions
    • (Triggering unit) Equal to Boss 000 <gen>
  • Actions
    • Trigger - Turn off (Trigger1 <gen>)
 
Status
Not open for further replies.
Top