Does "Playable Map Area," "Current Camera Bounds,"and etc. leak?
Also, if in a single trigger a variable is cleaned, can it still be reused in the same instance later of the trigger? Finally, if a single variable is reused, does each reuse overwrite memory or leak?
Also, if in a single trigger a variable is cleaned, can it still be reused in the same instance later of the trigger? Finally, if a single variable is reused, does each reuse overwrite memory or leak?
If you have a group variable, set it to a new group, then destroy the group, you can use it again. But of course you'll have to set the variable to a new group again because you destroyed the last one. And no, reusing it doesn't leak as long as you destroy everything. Think of variables as pointers to an object (because that's what they are). Once you lose all pointers to a certain object, that object is "leaking" because you can't find it and it will never be destroyed or used.
If you do "Center of (playable map area)", (current camera bounds), etc. that will leak. You need to set a temppoint to the point you wish to refer to and destroy it after the applicable actions.
If you do "Center of (playable map area)", (current camera bounds), etc. that will leak. You need to set a temppoint to the point you wish to refer to and destroy it after the applicable actions.
This is correct. Both Playable map area and current camera bounds are BJ global vars that can be referenced at any time, but anything that creates new locations based upon them will leak the locations. The rects themselves are okay because they get re-used multiple times (Or at the very least have persistent references to themselves).
(Semi-thread revival; don't kill me for it! {/sarcasm})
Does this trigger leak (and is it MUI; BTW, only one Hero per player can use this ability, and that Hero is the only one that does)? If no, I generally have all of my memory leak questions answered. If yes, well, I dunno.
Obsolete
Trigger:
Omnislash
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Omnislash
Actions
-------- First strike -------- Set AAomnislash_p[(Player number of (Owner of (Triggering unit)))] = (Position of (Target unit of ability being cast)) Set AAomnislash_p2[(Player number of (Owner of (Triggering unit)))] = (Position of (Triggering unit)) Set AAomnislash_p3[(Player number of (Owner of (Triggering unit)))] = (AAomnislash_p[(Player number of (Owner of (Triggering unit)))] offset by 175.00 towards (Random angle) degrees) Set AAomnislash_u[(Player number of (Owner of (Triggering unit)))] = (Target unit of ability being cast) Animation - Change (Triggering unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 50.00% transparency Unit - Make (Triggering unit) Invulnerable Special Effect - Create a special effect at AAomnislash_p2[(Player number of (Owner of (Triggering unit)))] using Abilities\Spells\Orc\MirrorImage\MirrorImageDeathCaster.mdl Unit - Move (Triggering unit) instantly to AAomnislash_p3[(Player number of (Owner of (Triggering unit)))] Special Effect - Create a special effect at AAomnislash_p3[(Player number of (Owner of (Triggering unit)))] using Abilities\Spells\Orc\MirrorImage\MirrorImageDeathCaster.mdl Animation - Play (Triggering unit)'s attack animation Wait 1.00 seconds Unit - Cause (Triggering unit) to damage AAomnislash_u[(Player number of (Owner of (Triggering unit)))], dealing (Random real number between (Real((Agility of (Triggering unit) (Include bonuses)))) and (Real((Strength of (Triggering unit) (Include bonuses))))) damage of attack type Hero and damage type Normal
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Random integer number between 1 and 3) Equal to 1
Then - Actions
Sound - Play MetalHeavySliceMetal1 <gen> at 100.00% volume, located at AAomnislash_p[(Player number of (Owner of (Triggering unit)))] with Z offset 0.00
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Random integer number between 1 and 3) Equal to 2
Then - Actions
Sound - Play MetalHeavySliceMetal2 <gen> at 100.00% volume, located at AAomnislash_p[(Player number of (Owner of (Triggering unit)))] with Z offset 0.00
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Random integer number between 1 and 3) Equal to 3
Then - Actions
Sound - Play MetalHeavySliceMetal3 <gen> at 100.00% volume, located at AAomnislash_p[(Player number of (Owner of (Triggering unit)))] with Z offset 0.00
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Player number of (Owner of (Triggering unit))) Equal to 1
Set AAomnislash_p[(Player number of (Owner of (Triggering unit)))] = (Position of AAomnislash_u[(Player number of (Owner of (Triggering unit)))]) Set AAomnislash_p2[(Player number of (Owner of (Triggering unit)))] = (Position of (Triggering unit)) Set AAomnislash_p3[(Player number of (Owner of (Triggering unit)))] = (AAomnislash_p[(Player number of (Owner of (Triggering unit)))] offset by 175.00 towards (Random angle) degrees) Special Effect - Create a special effect at AAomnislash_p2[(Player number of (Owner of (Triggering unit)))] using Abilities\Spells\Orc\MirrorImage\MirrorImageDeathCaster.mdl Unit - Move (Triggering unit) instantly to AAomnislash_p3[(Player number of (Owner of (Triggering unit)))] Special Effect - Create a special effect at AAomnislash_p3[(Player number of (Owner of (Triggering unit)))] using Abilities\Spells\Orc\MirrorImage\MirrorImageDeathCaster.mdl Animation - Play (Triggering unit)'s attack animation Wait 1.00 seconds Unit - Cause (Triggering unit) to damage AAomnislash_u[(Player number of (Owner of (Triggering unit)))], dealing (Random real number between (Real((Agility of (Triggering unit) (Include bonuses)))) and (Real((Strength of (Triggering unit) (Include bonuses))))) damage of attack type Hero and damage type Normal
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Random integer number between 1 and 3) Equal to 1
Then - Actions
Sound - Play MetalHeavySliceMetal1 <gen> at 100.00% volume, located at AAomnislash_p[(Player number of (Owner of (Triggering unit)))] with Z offset 0.00
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Random integer number between 1 and 3) Equal to 2
Then - Actions
Sound - Play MetalHeavySliceMetal2 <gen> at 100.00% volume, located at AAomnislash_p[(Player number of (Owner of (Triggering unit)))] with Z offset 0.00
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Random integer number between 1 and 3) Equal to 3
Then - Actions
Sound - Play MetalHeavySliceMetal3 <gen> at 100.00% volume, located at AAomnislash_p[(Player number of (Owner of (Triggering unit)))] with Z offset 0.00
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Player number of (Owner of (Triggering unit))) Equal to 1
Does this trigger leak (and is it MUI; BTW, only one Hero per player can use this ability, and that Hero is the only one that does)? If no, I generally have all of my memory leak questions answered. If yes, well, I dunno.
Another Omnislash
Trigger:
Omnislash
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Omnislash
Actions
Wait 0.25 seconds
-------- First strike --------
Set AAomnislash_u[(Player number of (Owner of (Triggering unit)))] = (Target unit of ability being cast)
Set AAomnislash_p[(Player number of (Owner of (Triggering unit)))] = (Position of AAomnislash_u[(Player number of (Owner of (Triggering unit)))])
Set AAomnislash_p2[(Player number of (Owner of (Triggering unit)))] = (Position of (Triggering unit))
Set AAomnislash_p3[(Player number of (Owner of (Triggering unit)))] = (AAomnislash_p[(Player number of (Owner of (Triggering unit)))] offset by 175.00 towards (Random angle) degrees)
Animation - Change (Triggering unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 50.00% transparency
Unit - Pause (Triggering unit)
Unit - Make (Triggering unit) Invulnerable
Special Effect - Create a special effect at AAomnislash_p2[(Player number of (Owner of (Triggering unit)))] using Abilities\Spells\Orc\MirrorImage\MirrorImageDeathCaster.mdl
Unit - Move (Triggering unit) instantly to AAomnislash_p3[(Player number of (Owner of (Triggering unit)))], facing AAcoldblade_p[(Player number of (Owner of (Triggering unit)))]
Special Effect - Create a special effect at AAomnislash_p3[(Player number of (Owner of (Triggering unit)))] using Abilities\Spells\Orc\MirrorImage\MirrorImageDeathCaster.mdl
Animation - Play (Triggering unit)'s attack animation
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Cold Blade for (Triggering unit)) Not equal to 0
(Random real number between 0.00 and 1.00) Less than or equal to ((Real((Level of Cold Blade for (Triggering unit)))) x 0.10)
Then - Actions
Set AAcoldblade_p[(Player number of (Owner of (Triggering unit)))] = (Position of AAomnislash_u2[(Player number of (Owner of (Triggering unit)))])
Unit - Create 1 Dummy for (Owner of (Triggering unit)) at AAcoldblade_p[(Player number of (Owner of (Triggering unit)))] facing Default building facing degrees
Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
Unit - Add Cold Blade (Dummy) to (Last created unit)
Unit - Set level of Cold Blade (Dummy) for (Last created unit) to (Level of Cold Blade for (Triggering unit))
Unit - Order (Last created unit) to Undead Lich - Frost Nova AAomnislash_u2[(Player number of (Owner of (Triggering unit)))]
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Player number of (Owner of (Triggering unit))) Equal to 1
Wait 0.25 seconds
Unit - Cause (Triggering unit) to damage AAomnislash_u[(Player number of (Owner of (Triggering unit)))], dealing (Random real number between (Real((Agility of (Triggering unit) (Include bonuses)))) and (Real((Strength of (Triggering unit) (Include bonuses))))) damage of attack type Hero and damage type Normal
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Random integer number between 1 and 3) Equal to 1
Then - Actions
Sound - Play MetalHeavySliceMetal1 <gen> at 100.00% volume, located at AAomnislash_p[(Player number of (Owner of (Triggering unit)))] with Z offset 0.00
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Random integer number between 1 and 3) Equal to 2
Then - Actions
Sound - Play MetalHeavySliceMetal2 <gen> at 100.00% volume, located at AAomnislash_p[(Player number of (Owner of (Triggering unit)))] with Z offset 0.00
Else - Actions
Sound - Play MetalHeavySliceMetal3 <gen> at 100.00% volume, located at AAomnislash_p[(Player number of (Owner of (Triggering unit)))] with Z offset 0.00
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Player number of (Owner of (Triggering unit))) Equal to 1
Set AAomnislash_u2[(Player number of (Owner of (Triggering unit)))] = AAomnislash_u[(Player number of (Owner of (Triggering unit)))]
Set AAomnislash_p[(Player number of (Owner of (Triggering unit)))] = (Position of AAomnislash_u2[(Player number of (Owner of (Triggering unit)))])
Set AAomnislash_p2[(Player number of (Owner of (Triggering unit)))] = (Position of (Triggering unit))
Set AAomnislash_p3[(Player number of (Owner of (Triggering unit)))] = (AAomnislash_p[(Player number of (Owner of (Triggering unit)))] offset by 175.00 towards (Random angle) degrees)
Special Effect - Create a special effect at AAomnislash_p2[(Player number of (Owner of (Triggering unit)))] using Abilities\Spells\Orc\MirrorImage\MirrorImageDeathCaster.mdl
Unit - Move (Triggering unit) instantly to AAomnislash_p3[(Player number of (Owner of (Triggering unit)))], facing AAcoldblade_p[(Player number of (Owner of (Triggering unit)))]
Special Effect - Create a special effect at AAomnislash_p3[(Player number of (Owner of (Triggering unit)))] using Abilities\Spells\Orc\MirrorImage\MirrorImageDeathCaster.mdl
Animation - Play (Triggering unit)'s attack animation
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Cold Blade for (Triggering unit)) Not equal to 0
(Random real number between 0.00 and 1.00) Less than or equal to ((Real((Level of Cold Blade for (Triggering unit)))) x 0.10)
Then - Actions
Set AAcoldblade_p[(Player number of (Owner of (Triggering unit)))] = (Position of AAomnislash_u2[(Player number of (Owner of (Triggering unit)))])
Unit - Create 1 Dummy for (Owner of (Triggering unit)) at AAcoldblade_p[(Player number of (Owner of (Triggering unit)))] facing Default building facing degrees
Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
Unit - Add Cold Blade (Dummy) to (Last created unit)
Unit - Set level of Cold Blade (Dummy) for (Last created unit) to (Level of Cold Blade for (Triggering unit))
Unit - Order (Last created unit) to Undead Lich - Frost Nova AAomnislash_u2[(Player number of (Owner of (Triggering unit)))]
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Player number of (Owner of (Triggering unit))) Equal to 1
Wait 0.25 seconds
Unit - Cause (Triggering unit) to damage AAomnislash_u[(Player number of (Owner of (Triggering unit)))], dealing (Random real number between (Real((Agility of (Triggering unit) (Include bonuses)))) and (Real((Strength of (Triggering unit) (Include bonuses))))) damage of attack type Hero and damage type Normal
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Random integer number between 1 and 3) Equal to 1
Then - Actions
Sound - Play MetalHeavySliceMetal1 <gen> at 100.00% volume, located at AAomnislash_p[(Player number of (Owner of (Triggering unit)))] with Z offset 0.00
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Random integer number between 1 and 3) Equal to 2
Then - Actions
Sound - Play MetalHeavySliceMetal2 <gen> at 100.00% volume, located at AAomnislash_p[(Player number of (Owner of (Triggering unit)))] with Z offset 0.00
Else - Actions
Sound - Play MetalHeavySliceMetal3 <gen> at 100.00% volume, located at AAomnislash_p[(Player number of (Owner of (Triggering unit)))] with Z offset 0.00
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Player number of (Owner of (Triggering unit))) Equal to 1
Animation - Change (Triggering unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
Unit - Make (Triggering unit) Vulnerable
Unit - Unpause (Triggering unit)