• 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] Leaks?

Status
Not open for further replies.
Level 8
Joined
May 21, 2008
Messages
218
  • Fade Away
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Set temp_group = (Units in (Playable map area))
      • Unit Group - Pick every unit in temp_group and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Custom value of (Picked unit)) Greater than or equal to (Integer(0.50))
            • Then - Actions
              • Unit - Set the custom value of (Picked unit) to ((Custom value of (Picked unit)) - (Integer(0.50)))
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • ((Picked unit) has buff Fade Away Aura 1) Equal to True
                  • ((Picked unit) has buff Fade Away Aura 2) Equal to True
                  • ((Picked unit) has buff Fade Away Aura 3) Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) has buff Fade Away Aura 1) Equal to True
                • Then - Actions
                  • Unit - Set the custom value of (Picked unit) to ((Custom value of (Picked unit)) + (Integer(1.50)))
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) has buff Fade Away Aura 2) Equal to True
                • Then - Actions
                  • Unit - Set the custom value of (Picked unit) to ((Custom value of (Picked unit)) + (Integer(2.50)))
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) has buff Fade Away Aura 3) Equal to True
                • Then - Actions
                  • Unit - Set the custom value of (Picked unit) to ((Custom value of (Picked unit)) + (Integer(3.50)))
                • Else - Actions
              • Set Coloring = (Real((Custom value of (Picked unit))))
              • Animation - Change (Picked unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with Coloring% transparency
              • Animation - Change (Picked unit)'s size to ((Coloring + 100.00)%, (Coloring + 100.00)%, (Coloring + 100.00)%) of its original size
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Custom value of (Picked unit)) Greater than or equal to 80
                • Then - Actions
                  • Set temp_point = (Position of (Picked unit))
                  • Set temp_unittype = Flash
                  • Unit - Create 1 temp_unittype for Neutral Passive at temp_point facing Default building facing degrees
                  • Set temp_unit = (Last created unit)
                  • Unit - Add a 2.50 second Generic expiration timer to temp_unit
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Custom value of (Picked unit)) Greater than or equal to 100
                • Then - Actions
                  • Unit - Explode (Picked unit)
                  • Set temp_point = (Position of (Picked unit))
                  • Set temp_unittype = Dispel
                  • Unit - Create 1 temp_unittype for Neutral Passive at temp_point facing 270.00 degrees
                  • Set temp_unit = (Last created unit)
                  • Unit - Add a 2.50 second Generic expiration timer to temp_unit
                • Else - Actions
            • Else - Actions
      • Custom script: call RemoveLocation (udg_temp_point)
      • Custom script: call DestroyGroup (udg_temp_group)
Any Leaks?
 
Level 5
Joined
Oct 17, 2006
Messages
151
You should seriously consider using the "If Then Else" instead of the "If Then Else - Multiple actions". It makes reading triggers a lot easier for yourself included... :wink:

Whats the purpose of the trigger? Knowing that could help (at least me) when I am trying to find a problem in triggers.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
You should seriously consider using the "If Then Else" instead of the "If Then Else - Multiple actions". It makes reading triggers a lot easier for yourself included... :wink:

Yes, and having 50 if/then/else's with lots of useless Do Nothing's sure will help.
Besides, believe me it will be x10 harder to read it.


Anyhow, you set temp_point twice and remove it only once.
Remove it right after you create the unit instead.

Also, that bj_wantDestroyGroup is useless since you destroy the group at the end of the trigger.
 
Level 5
Joined
Oct 17, 2006
Messages
151
  • Example
    • Then - Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • ((Picked unit) has buff Fade Away Aura 1) Equal to True
  • Then - Actions
  • Unit - Set the custom value of (Picked unit) to ((Custom value of (Picked unit)) + (Integer(1.50)))
  • Else - Actions
These are what I am talking about... I think that these could be converted into 1 code making it easy to read and when your looking for mistakes, you don't have 2 scroll all the way down to the bottom of the trigger to look for it. =D
 
Status
Not open for further replies.
Top