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

Is my triggering correct?

Status
Not open for further replies.
Level 7
Joined
May 11, 2010
Messages
278
Have i missed any leaks, made stupid things or whatever?

  • Knockback Start
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Bonk
    • Actions
      • Set unit = (Target unit of ability being cast)
      • Set KnockAngle = (Angle from (Position of (Triggering unit)) to (Position of unit))
      • Set KnockDistance = (800.00 x 0.02)
      • Set KnockDuration = 0.50
      • Hashtable - Save KnockDistance as (Key distance) of (Key (Target unit of ability being cast)) in KnockTable
      • Hashtable - Save KnockAngle as (Key angle) of (Key (Target unit of ability being cast)) in KnockTable
      • Hashtable - Save KnockDuration as (Key duration) of (Key (Target unit of ability being cast)) in KnockTable
      • Unit Group - Add unit to KnockbackGroup
      • Unit - Turn collision for unit Off
  • Knockback Loop Normal
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in KnockbackGroup and do (Actions)
        • Loop - Actions
          • Set KnockAngle = (Load (Key angle) of (Key (Picked unit)) from KnockTable)
          • Set KnockDistance = (Load (Key distance) of (Key (Picked unit)) from KnockTable)
          • Set KnockDuration = (Load (Key duration) of (Key (Picked unit)) from KnockTable)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • KnockDuration Greater than 0.00
            • Then - Actions
              • Set TempPoint = ((Position of (Picked unit)) offset by KnockDistance towards KnockAngle degrees)
              • Unit - Move (Picked unit) instantly to TempPoint, facing (KnockAngle + 180.00) degrees
              • Hashtable - Save (KnockDuration - 0.02) as (Key Duration) of (Key (Picked unit)) in KnockTable
              • Custom script: call RemoveLocation(udg_TempPoint)
            • Else - Actions
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in KnockTable
              • Unit Group - Remove (Picked unit) from KnockbackGroup
              • Unit - Turn collision for (Picked unit) On
  • Explode
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Bats and do (Actions)
        • Loop - Actions
          • Set BatTargets = (Units within 100.00 of (Position of (Picked unit)))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of units in BatTargets) Greater than 1
            • Then - Actions
              • Set TempPoint = (Position of (Picked unit))
              • Special Effect - Create a special effect at TempPoint using Abilities\Spells\Orc\WarStomp\WarStompCaster.mdl
              • Special Effect - Destroy (Last created special effect)
              • Custom script: call RemoveLocation(udg_TempPoint)
              • Unit Group - Pick every unit in BatTargets and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Picked unit) is A Hero) Equal to True
                    • Then - Actions
                      • Unit - Kill (Picked unit)
                      • Unit Group - Remove (Picked unit) from BatTargets
                      • Game - Display to (All players) the text: (|CFFFF0303 + ((Proper name of (Picked unit)) + (|R + ( ( + ((Name of (Owner of (Picked unit))) + () + was blown to smithereens!))))))
                    • Else - Actions
                      • Unit - Kill (Picked unit)
                      • Unit Group - Remove (Picked unit) from BatTargets
                      • Unit Group - Remove (Picked unit) from Bats
            • Else - Actions
              • Unit Group - Remove (Picked unit) from BatTargets
Help is greatly appreciated!
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
2 leaks in Knockback start:
Set KnockAngle = (Angle from (Position of (Triggering unit)) - LEAK to (Position of unit) - LEAK)

1 leak in Knockback Loop:
Set TempPoint = ((Position of (Picked unit)) - LEAK offset by KnockDistance towards KnockAngle degrees)

1 leak in Sucidal bats:
Set BatTargets = (Units within 100.00 of (Position of (Picked unit)) - LEAK)


All those leaks are Point leaks(locations), which are created all over again when you call the functions again and again and again, store them in variable and then at the end of the place(exapmle - if you declared it in if, destroy it in if too if you are not using it anywhere else, but since you are not afaik, you can destroy it in) and call:
  • Custom script: call RemoveLocation(udg_yourvariable)
 
Level 7
Joined
May 11, 2010
Messages
278
Thank you. I believed to have fized the first two, however, I'm unsure of the third.
  • Knockback Start
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Bonk
    • Actions
      • Set unit = (Target unit of ability being cast)
      • Set TempPoint = (Position of (Triggering unit))
      • Set TempPoint2 = (Position of unit)
      • Set KnockAngle = (Angle from TempPoint to TempPoint2)
      • Set KnockDistance = (800.00 x 0.02)
      • Set KnockDuration = 0.50
      • Hashtable - Save KnockDistance as (Key distance) of (Key (Target unit of ability being cast)) in KnockTable
      • Hashtable - Save KnockAngle as (Key angle) of (Key (Target unit of ability being cast)) in KnockTable
      • Hashtable - Save KnockDuration as (Key duration) of (Key (Target unit of ability being cast)) in KnockTable
      • Unit Group - Add unit to KnockbackGroup
      • Unit - Turn collision for unit Off
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Custom script: call RemoveLocation(udg_TempPoint2)
  • Knockback Loop Normal
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in KnockbackGroup and do (Actions)
        • Loop - Actions
          • Set KnockAngle = (Load (Key angle) of (Key (Picked unit)) from KnockTable)
          • Set KnockDistance = (Load (Key distance) of (Key (Picked unit)) from KnockTable)
          • Set KnockDuration = (Load (Key duration) of (Key (Picked unit)) from KnockTable)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • KnockDuration Greater than 0.00
            • Then - Actions
              • Set TempPoint2 = (Position of (Picked unit))
              • Set TempPoint = (TempPoint2 offset by KnockDistance towards KnockAngle degrees)
              • Unit - Move (Picked unit) instantly to TempPoint, facing (KnockAngle + 180.00) degrees
              • Hashtable - Save (KnockDuration - 0.02) as (Key Duration) of (Key (Picked unit)) in KnockTable
              • Custom script: call RemoveLocation(udg_TempPoint)
              • Custom script: call RemoveLocation(udg_TempPoint2)
            • Else - Actions
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in KnockTable
              • Unit Group - Remove (Picked unit) from KnockbackGroup
              • Unit - Turn collision for (Picked unit) On
  • Explode
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Bats and do (Actions)
        • Loop - Actions
          • Set TempPoint = (Position of (Picked unit))
          • Set BatTargets = (Units within 100.00 of TempPoint)
          • Custom script: call RemoveLocation(udg_TempPoint)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of units in BatTargets) Greater than 1
            • Then - Actions
              • Set TempPoint = (Position of (Picked unit))
              • Special Effect - Create a special effect at TempPoint using Abilities\Spells\Orc\WarStomp\WarStompCaster.mdl
              • Special Effect - Destroy (Last created special effect)
              • Custom script: call RemoveLocation(udg_TempPoint)
              • Unit Group - Pick every unit in BatTargets and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Picked unit) is A Hero) Equal to True
                    • Then - Actions
                      • Unit - Kill (Picked unit)
                      • Unit Group - Remove (Picked unit) from BatTargets
                      • Game - Display to (All players) the text: (|CFFFF0303 + ((Proper name of (Picked unit)) + (|R + ( ( + ((Name of (Owner of (Picked unit))) + () + was blown to smithereens!))))))
                    • Else - Actions
                      • Unit - Kill (Picked unit)
                      • Unit Group - Remove (Picked unit) from BatTargets
                      • Unit Group - Remove (Picked unit) from Bats
            • Else - Actions
              • Unit Group - Remove (Picked unit) from BatTargets
Is the leak fixed or does
  • Set BatTargets = (Units within 100.00 of TempPoint)
leak a region or something?
 
Status
Not open for further replies.
Top