• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Have i cleaned leaks in a proper way?

Status
Not open for further replies.
Level 17
Joined
Jun 2, 2009
Messages
1,146
Before
  • Anti Armor Effect Copy
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units within 800.00 of AntiArmor_Loc matching ((((Matching unit) belongs to an enemy of (Owner of AntiArmor_Dummy)) Equal to True) and (((Matching unit) is alive) Equal to True))) and do (Actions)
        • Loop - Actions
          • Unit - Order AntiArmor_Dummy to Night Elf Druid Of The Talon - Faerie Fire (Picked unit)
After
  • Anti Armor Effect
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set TempGroup = (Units within 800.00 of AntiArmor_Loc)
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) belongs to an enemy of (Owner of AntiArmor_Dummy)) Equal to True
              • ((Picked unit) is alive) Equal to True
            • Then - Actions
              • Unit - Order AntiArmor_Dummy to Night Elf Druid Of The Talon - Faerie Fire (Picked unit)
            • Else - Actions
      • Custom script: call DestroyGroup(udg_TempGroup)
And here is the first part of trigger. I am currently confused a lot about leaks.
  • Anti Armor Field
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Anti-Armor Field //
    • Actions
      • Set AntiArmor_Caster = (Triggering unit)
      • Set AntiArmor_Loc = (Target point of ability being cast)
      • Unit - Create 1 DUMMY [JFA] for (Owner of AntiArmor_Caster) at AntiArmor_Loc facing Default building facing degrees
      • Set AntiArmor_Dummy = (Last created unit)
      • Unit - Add Faerie Fire // master to AntiArmor_Dummy
      • Unit - Set level of Faerie Fire // master for AntiArmor_Dummy to (Level of Anti-Armor Field // for AntiArmor_Caster)
      • Unit - Add a 10.00 second Generic expiration timer to AntiArmor_Dummy
      • Trigger - Turn on Anti Armor Effect <gen>
      • Wait 10.00 seconds
      • Trigger - Turn off Anti Armor Effect <gen>
      • Custom script: call RemoveLocation(udg_AntiArmor_Loc)
 
Level 12
Joined
Jan 10, 2023
Messages
191
Yep, in the first trigger you can instead put this before the group is made:
  • Custom script: set bj__wantDestroyGroup = true
and it will destroy the group after the 'pick every' loop is done without needing to make a global group variable.


EDIT: dummy in the second trigger looks good too!

EDIT EDIT: Wait, remove the dummy before the next time this runs or you'll have a bunch of dummies leaking.
 
Last edited:
Level 39
Joined
Feb 27, 2007
Messages
5,031
EDIT EDIT: Wait, remove the dummy before the next time this runs or you'll have a bunch of dummies leaking.
It has been given an expiration timer; no issue.
"custom script: set bj__wantDestroyGroup = true"
No quotation marks (I understand why you wrote them, but it will definitely be confusing for JFAMAP), and only one _ instead of two:
  • Custom script: set bj_wantDestroyGroup = true
@JFAMAP You should remove AntiArmor_Loc (to clean it before it becomes a leak) before the Wait 10.00 seconds line instead of after it. If the trigger runs again before that wait finishes, the point will not be properly removed.
 
Level 12
Joined
Jan 10, 2023
Messages
191
It has been given an expiration timer; no issue.

No quotation marks (I understand why you wrote them, but it will definitely be confusing for JFAMAP), and only one _ instead of two:
  • Custom script: set bj_wantDestroyGroup = true
@JFAMAP You should remove AntiArmor_Loc (to clean it before it becomes a leak) before the Wait 10.00 seconds line instead of after it. If the trigger runs again before that wait finishes, the point will not be properly removed.
Totally missed the expiration timer... :/

I definitely see your point on the quotes, at first I was going to just skip the trigger tags, then realized I might as well make it easy and left the quotation marks. I'm going to fix that because it doesn't look good lol
 
Status
Not open for further replies.
Top