• 🏆 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!

[Trigger] How to fix leaks in this spell ? (GUI)

Status
Not open for further replies.
Level 4
Joined
Mar 24, 2008
Messages
87
Hello i'm trying to fix leaks in this trigger but i'm blocked :

  • Lightning
    • Events
      • Unit - A unit casts a spell
    • Conditions
      • (Ability being cast) Equal to Lightning
    • Actions
      • Set PointLightning = (Target point of ability being cast)
      • Set PointCastLightning = (Position of (Casting unit))
      • Light - Create a Lightning Chain - Principal lightning effect from source PointCastLightning to target PointLightning
      • Set EffectLightning[(Player number of (Owner of (Triggering unit)))] = (Last created lightning effect)
      • Special Effect - Create a special effect at PointLightning using Abilities\Weapons\Bolt\BoltImpact.mdl
      • Group units - Pick every unit in (Units in (Entire map) matching ((((Distance between (Position of (Matching unit)) and PointCastLightning) + (Distance between (Position of (Matching unit)) and PointLightning)) Less or equal to 20.00) and (((Owner of (Matching unit)) is an enemy of (Owner of (Triggering unit) Equal to TRUE) and do (Actions)
        • Then - Actions
          • Unit - Cause (Triggering unit) to damage (Picked unit), dealing 50.00 damage of attack type Sorts and damage type Foudre
          • Unit - Cause (Triggering unit) to damage (Picked unit), dealing (1.00 x (Real((Agility of (Triggering unit) (Inclure bonuses))))) damage of attack type Sorts and damage type Foudre
      • Set GroupLightning = (Units within 100.00 of PointCastLightning matching (((Owner of (Matching unit)) is an enemy of (Owner of (Triggering unit))) Equal to TRUE))
      • Groupe units - Pick every unit in GroupLightning and do (Actions)
        • Boucle - Actions
          • Unit - Cause (Triggering unit) to damage (Picked unit), dealing 200.00 damage of attack type Sorts and damage type Foudre
          • Unit - Cause (Triggering unit) to damage (Picked unit), dealing (4.00 x (Real((Agility of (Triggering unit) (Inclure bonuses))))) damage of attack type Sorts and damage type Foudre
      • Custom script: call DestroyGroup(udg_GroupLightning)
      • Custom script: call RemoveLocation(udg_PointLightning)
      • Custom script: call RemoveLocation(udg_PointCastLightning)
      • Wait 0.50 seconds
      • Light - Destroy EffectLightning[(Player number of (Owner of (Triggering unit)))]
The problem is on the lane :

  • Group units - Pick every unit in (Units in (Entire map) matching ((((Distance between (Position of (Matching unit)) and PointCastLightning) + (Distance between (Position of (Matching unit)) and PointLightning)) Less or Equal to 20.00) and (((Owner of (Matching unit)) is an enemy of (Owner of (Triggering unit) Equal to TRUE) and do (Actions)
First i think there would be a better way to damage a "lane", secondly i don't know how to remove leaks here, as i can't make a Variable (Point of Matching units's locations).

Someone has an idea please ? :)

Thanks,

Exum
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Remove the position leaks like this:

  • Actions
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in (Units in (Playable map area)) matching ... and do (Actions)
      • Loop - Actions
        • Set u1 = (Picked unit)
        • Set p1 = (Position of (u1)
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Distance between p1 and...) Greater than or equal to 10.00
          • Then - Actions
          • Else - Actions
        • Custom script: call RemoveLocation(udg_p1)
 
Level 4
Joined
Mar 24, 2008
Messages
87
Thank for your answers :)

Specially maker, you will always save me (my real problem was with position leaks) !
 
Status
Not open for further replies.
Top