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

[Trigger] Burn trigger issue

Status
Not open for further replies.
Level 11
Joined
Dec 5, 2009
Messages
846
Hey there! In this trigger all units in a unit group will be damaged over 10 sec.
But when the effect is over the groups should be cleared, however if 2 instances or more are running then it will be hard to clear the groups because the targets are all in one group. I wonder if there's a way to separate units in groups or something like that. Here's my trigger.

  • Firebolt Burn
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Firebolt_Group2 and do (Actions)
        • Loop - Actions
          • Set Firebolt_u2 = (Picked unit)
          • Set Firebolt_Index = (Custom value of Firebolt_u2)
          • Unit - Hide Firebolt_u2
          • Set Firebolt_u4[Firebolt_Index] = Firebolt_u2
          • Set Firebolt_BurnDuration[Firebolt_Index] = (Firebolt_BurnDuration[Firebolt_Index] - 1.00)
          • Unit Group - Pick every unit in Firebolt_Group3 and do (Actions)
            • Loop - Actions
              • Set Firebolt_u3 = (Picked unit)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Firebolt_u3 is alive) Equal to True
                • Then - Actions
                  • Special Effect - Create a special effect attached to the overhead of Firebolt_u3 using Firebolt_Beffect[Firebolt_Index]
                  • Special Effect - Destroy (Last created special effect)
                  • Unit - Cause Firebolt_u2 to damage Firebolt_u3, dealing Firebolt_BurnDamage[Firebolt_Index] damage of attack type Spells and damage type Normal
                • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Firebolt_BurnDuration[Firebolt_Index] Less than or equal to 0.00
            • Then - Actions
              • Unit Group - Remove Firebolt_u2 from Firebolt_Group2
              • Unit Group - Remove Firebolt_u3 from Firebolt_Group3
              • Unit - Remove Firebolt_u2 from the game
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Firebolt_Group2 is empty) Equal to True) and ((Firebolt_Group3 is empty) Equal to True)
            • Then - Actions
              • Trigger - Turn off Firebolt Burn <gen>
            • Else - Actions
Right now on this line
  • Unit Group - Remove Firebolt_u3 from Firebolt_Group3
it will only remove 1 unit of alls units in the group.
 
Level 19
Joined
Feb 25, 2009
Messages
2,004
Use units custom value to attach a timer to them.
So when custom value is 0, remove the unit from the group.

Also you could simply create one dummy and give it an "Immolation" ability modified to your needs, but I don't know if this is going to work since you haven't described what is supposed to happen.
 
Level 11
Joined
Dec 5, 2009
Messages
846
I tried both of the ways with the indexing but it will only remove 1 unit from the unit group.
The spell does following, a ball of fire if it hits a target it will do aoe dmg and burn those units for 10 sec. Imolation wont work because the damage done will have variables in it
 
Level 4
Joined
Nov 27, 2012
Messages
85
Try this. Move this

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
    • Firebolt_BurnDuration[Firebolt_Index] Less than or equal to 0.00
  • Then - Actions
    • Unit Group - Remove Firebolt_u3 from Firebolt_Group3
into this
  • Unit Group - Pick every unit in Firebolt_Group3 and do (Actions)
 
What's Firebolt_u4[Firebolt_Index] for?

Anyways, you can for example create subgroups for Firebolt Burn's dummies and destroy them at the end of effect.
  • Firebolt Burn
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Firebolt_Group2 and do (Actions)
        • Loop - Actions
          • Set Firebolt_u2 = (Picked unit)
          • Set Firebolt_Index = (Custom value of Firebolt_u2)
          • Unit - Hide Firebolt_u2
          • Set Firebolt_u4[Firebolt_Index] = Firebolt_u2
          • Set Firebolt_BurnDuration[Firebolt_Index] = (Firebolt_BurnDuration[Firebolt_Index] - 1.00)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Firebolt_BurnDuration[Firebolt_Index] Greater than or equal to 0.00
              • (Firebolt_Group[Firebolt_Index] is empty) Equal False
            • Then - Actions
              • Unit Group - Pick every unit in Firebolt_Group[Firebolt_Index] and do (Actions)
                • Loop - Actions
                  • Set Firebolt_u3 = (Picked unit)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Firebolt_u3 is alive) Equal to True
                    • Then - Actions
                      • Special Effect - Create a special effect attached to the overhead of Firebolt_u3 using Firebolt_Beffect[Firebolt_Index]
                      • Special Effect - Destroy (Last created special effect)
                      • Unit - Cause Firebolt_u2 to damage Firebolt_u3, dealing Firebolt_BurnDamage[Firebolt_Index] damage of attack type Spells and damage type Normal
                    • Else - Actions
                      • Unit Group - Remove Firebolt_u3 from Firebolt_Group[Firebolt_Index]
            • Else - Actions
              • Unit Group - Pick every unit in Firebolt_Group[Firebolt_Index] and do Remove (Picked unit) from Firebolt_Group[Firebolt_Index]
              • Unit Group - Remove Firebolt_u2 from Firebolt_Group2
              • Unit - Remove Firebolt_u2 from the game
              • Custom script: DestroyGroup(udg_Firebolt_Group[udg_Firebolt_Index])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Firebolt_Group2 is empty) Equal to True
        • Then - Actions
          • Trigger - Turn off Firebolt Burn <gen>
        • Else - Actions
 
Status
Not open for further replies.
Top