• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

About Unit Group Leak

Status
Not open for further replies.
Level 6
Joined
Jan 27, 2007
Messages
208
Just a simple question from me.
  • Unit Group - Remove all units from (Some UnitGroup)
Is that trigger remove Unit Group leak? Because i have a trigger that if i destroy the group, that trigger wont work well (bugged).

Thanks for help.
 
You could use that:

  • Trigger 1
    • Events
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in ([which group]) and do (Actions)
        • Loop - Actions
or that:

  • Trigger 2
    • Events
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (which group) and do (Actions)
        • Loop - Actions
          • Unit Group - Add (Picked unit) to [which group]
      • Custom script: call DestroyGroup([which group])
Any of those will remove group leaks.
 
em...Here
  • Ultimate Slash
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Ultimate Slash [Warrior]
    • Actions
      • Set temp_CasterPoint = (Position of (Triggering unit))
      • Set temp_Point = (Target point of ability being cast)
      • Set UltimateSlashAngle = (Angle from temp_CasterPoint to temp_Point)
      • Set UltimateSlashDistance = 16.00
      • Set UltimateSlashTime = 1.00
      • Set UltimateSlashCaster = (Triggering unit)
      • Hashtable - Save UltimateSlashAngle as 0 of (Key (Triggering unit)) in UltimateSlashTable
      • Hashtable - Save UltimateSlashDistance as 1 of (Key (Triggering unit)) in UltimateSlashTable
      • Hashtable - Save UltimateSlashTime as 2 of (Key (Triggering unit)) in UltimateSlashTable
      • Hashtable - Save Handle OfUltimateSlashCaster as 3 of (Key (Triggering unit)) in UltimateSlashTable
      • Unit Group - Add (Triggering unit) to UltimateSlashGroup
      • Custom script: call RemoveLocation(udg_temp_Point)
      • Custom script: call RemoveLocation(udg_temp_CasterPoint)
  • Activate Ultimate Slash
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in UltimateSlashGroup and do (Actions)
        • Loop - Actions
          • Set UltimateSlashAngle = (Load 0 of (Key (Picked unit)) from UltimateSlashTable)
          • Set UltimateSlashDistance = (Load 1 of (Key (Picked unit)) from UltimateSlashTable)
          • Set UltimateSlashTime = (Load 2 of (Key (Picked unit)) from UltimateSlashTable)
          • Set UltimateSlashCaster = (Load 3 of (Key (Picked unit)) in UltimateSlashTable)
          • Set UltimateSlashCasterPoint[(Player number of (Owner of (Picked unit)))] = (Position of UltimateSlashCaster)
          • Set UltimateSlashUnitGroup[(Player number of (Owner of (Picked unit)))] = (Units within 125.00 of UltimateSlashCasterPoint[(Player number of (Owner of (Picked unit)))] matching ((((Matching unit) belongs to an enemy of (Owner of UltimateSlashCaster)) Equal to True) and (((Matching unit) is in UltimateSlashDamaged[(Player number of
          • Unit Group - Pick every unit in UltimateSlashUnitGroup[(Player number of (Owner of UltimateSlashCaster))] and do (Actions)
            • Loop - Actions
              • Unit - Cause UltimateSlashCaster to damage (Picked unit), dealing (Real(((Strength of UltimateSlashCaster (Include bonuses)) x 5))) damage of attack type Hero and damage type Normal
              • Unit Group - Add (Picked unit) to UltimateSlashDamaged[(Player number of (Owner of UltimateSlashCaster))]
          • Custom script: call DestroyGroup(udg_UltimateSlashUnitGroup[GetConvertedPlayerId(GetOwningPlayer(GetEnumUnit()))])
          • Custom script: call RemoveLocation(udg_UltimateSlashCasterPoint[GetConvertedPlayerId(GetOwningPlayer(GetEnumUnit()))])
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • UltimateSlashTime Greater than 0.00
            • Then - Actions
              • Set UltimateSlashPoint[(Player number of (Owner of (Picked unit)))] = (Position of (Picked unit))
              • Unit - Move (Picked unit) instantly to (UltimateSlashPoint[(Player number of (Owner of (Picked unit)))] offset by UltimateSlashDistance towards UltimateSlashAngle degrees)
              • Unit - Turn collision for (Picked unit) Off
              • Animation - Change (Picked unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 100.00% transparency
              • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Human\Polymorph\PolyMorphDoneGround.mdl
              • Special Effect - Destroy (Last created special effect)
              • Hashtable - Save (UltimateSlashTime - 0.04) as 2 of (Key (Picked unit)) in UltimateSlashTable
              • Custom script: call RemoveLocation(udg_UltimateSlashPoint[GetConvertedPlayerId(GetOwningPlayer(GetEnumUnit()))])
            • Else - Actions
              • Unit - Turn collision for (Picked unit) On
              • Animation - Change (Picked unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
              • Unit Group - Remove all units from UltimateSlashDamaged[(Player number of (Owner of UltimateSlashCaster))]
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in UltimateSlashTable
              • Unit Group - Remove (Picked unit) from UltimateSlashGroup
              • Custom script: call RemoveLocation(udg_UltimateSlashPoint[GetConvertedPlayerId(GetOwningPlayer(GetEnumUnit()))])
:|
 
Ah, I would love to help you, but I don't know hashtable yet... So the triggers are just very confusing to me right now.

Edit: I found the error, Destroy group at the end of the loop.
 
The problem is that you keep using picked unit after destroying group, not sure but might be it. Maybe you could try using a variable for picked unit.
 
Status
Not open for further replies.
Back
Top