• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Spell Breaks when i remove memory leaks...

Status
Not open for further replies.
Level 4
Joined
Apr 22, 2008
Messages
34
The spell works fine without removing the memory leaks and then when i do it only works the first time, then the 2nd time it breaks.. anyone know why??

heres scripts:
  • Speed Burst
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to KiBurst2
    • Actions
      • Set KiBurstCaster = (Casting unit)
      • Set loc6 = (Position of KiBurstCaster)
      • Set loc7 = (Target point of ability being cast)
      • Set CastRange = (Distance between loc6 and loc7)
      • Set CliffLevel = (Terrain cliff level at loc6)
      • Unit - Turn collision for (Triggering unit) Off
      • Animation - Change (Triggering unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 100.00% transparency
      • Unit - Create 1 Dummy Ki Burst for (Owner of (Triggering unit)) at loc6 facing loc7
      • Animation - Play (Last created unit)'s birth animation
      • Unit Group - Add (Last created unit) to KiBurstGroup
      • Unit Group - Add (Triggering unit) to KiBurstGroup
      • Trigger - Turn on shifting <gen>
  • shifting
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • Set loc8 = (loc6 offset by 25.00 towards (Angle from loc6 to loc7) degrees)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • CastRange Less than or equal to 0.00
              • (Terrain cliff level at loc8) Greater than (CliffLevel + 1)
              • (Terrain cliff level at loc8) Less than (CliffLevel - 1)
        • Then - Actions
          • Animation - Change KiBurstCaster's vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
          • Unit Group - Remove KiBurstCaster from KiBurstGroup
          • Unit Group - Pick every unit in KiBurstGroup and do (Actions)
            • Loop - Actions
              • Unit - Kill (Picked unit)
          • Unit Group - Remove all units from dmgedGroup
          • Unit - Turn collision for KiBurstCaster On
          • Custom script: call DestroyGroup(udg_dmgedGroup)
          • Custom script: call DestroyGroup(udg_KiBurstGroup)
          • Custom script: call RemoveLocation(udg_loc8)
          • Custom script: call RemoveLocation(udg_loc6)
          • Custom script: call RemoveLocation(udg_loc7)
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • Unit Group - Pick every unit in KiBurstGroup and do (Actions)
            • Loop - Actions
              • Animation - Play (Picked unit)'s stand animation
              • Unit - Move (Picked unit) instantly to loc8, facing loc7
              • Set loc6 = (Position of (Picked unit))
          • Set unitgroup1 = (Units within 200.00 of loc8 matching ((((Matching unit) is in dmgedGroup) Equal to False) and (((Matching unit) belongs to an enemy of (Owner of KiBurstCaster)) Equal to True)))
          • Unit Group - Pick every unit in unitgroup1 and do (Actions)
            • Loop - Actions
              • Unit - Cause KiBurstCaster to damage (Picked unit), dealing ((Real((Level of KiBurst2 for KiBurstCaster))) x (100.00 x (Real((Intelligence of KiBurstCaster (Include bonuses)))))) damage of attack type Normal and damage type Normal
              • Unit Group - Add (Picked unit) to dmgedGroup
          • Custom script: call DestroyGroup(udg_unitgroup1)
          • Set CastRange = (CastRange - 25.00)
 
Level 11
Joined
Feb 11, 2010
Messages
199
IIRC, if you're using Add / Remove units, you don't need to destroy the group. You only need to destroy dynamically generated unit groups, such as "Unit Group - Pick every unit in (function) and do (whatever)." So, for example, you would of course need to destroy unitgroup1, but why are you destroying these empty groups that aren't dynamically generated?

If you have destroyed the group, there's nothing for you add the units to, because Add Unit to Unit Group doesn't create a group, the way Set Unit Group = (function) does.

http://www.hiveworkshop.com/forums/triggers-scripts-269/things-leak-35124/
 
Level 4
Joined
Apr 22, 2008
Messages
34
IIRC, if you're using Add / Remove units, you don't need to destroy the group. You only need to destroy dynamically generated unit groups, such as "Unit Group - Pick every unit in (function) and do (whatever)." So, for example, you would of course need to destroy unitgroup1, but why are you destroying these empty groups that aren't dynamically generated?

If you have destroyed the group, there's nothing for you add the units to, because Add Unit to Unit Group doesn't create a group, the way Set Unit Group = (function) does.

http://www.hiveworkshop.com/forums/triggers-scripts-269/things-leak-35124/

nice thx always thought u had to remove unit groups + rep
 
Status
Not open for further replies.
Top