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

Memory leaks

Status
Not open for further replies.
Level 15
Joined
Jan 12, 2011
Messages
1,197
A lot of users have told me that there are some memory leaks in my map, and it is a big problem.
My map will be only accepted if i fix these leaks.
However, i do not know how how to even begin with this leaks fixing.

I have looked up the two leaks tutorials in this site, but i have no idea how to do the things are metioned there in my map.

So i attach my map, and please tell me how to change the triggers and other things to fix the leaks. (open my map, got to trigger editor, and tell me how to balance the triggers to fix leaks)

I will be really grateful if you help me with this.
 

Attachments

  • Through Snow and Ice v.2.0.w3x
    5.9 MB · Views: 55
Last edited:
Level 12
Joined
Sep 11, 2011
Messages
1,176
i spotted the leaks on these triggers :

- Tri Arrow (Points, Unit Groups)
the (Position of (triggering unit)) should be set into variable and destroy them later

  • Unit Group - Pick every unit in (Units within 1000.00 of tempPoint) and do (Actions)
put this on top of the action, this action destroy the group after it's used.
  • Custom script: set bj_wantDestroyGroup = true
result
  • Custom script: set bj_wantDestroyGroup = true
  • Unit Group - Pick every unit in (Units within 1000.00 of tempPoint) and do (Actions)
  • Tri Arrow
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Tri-Arrow
    • Actions
      • Set tempPoint = (Position of (Triggering unit))
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 1000.00 of tempPoint) and do (Actions)
        • Loop - Actions
          • Unit Group - Add (Picked unit) to TriUnitsArrow
          • Set TriArrowLimit = (Number of units in TriUnitsArrow)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • TriArrowLimit Less than or equal to 3
            • Then - Actions
              • Unit Group - Pick every unit in TriUnitsArrow and do (Actions)
                • Loop - Actions
                  • Unit - Create 1 Dummy (Tri-Arrow) for (Owner of (Triggering unit)) at tempPoint facing Default building facing degrees
                  • Unit - Order (Last created unit) to Night Elf Warden - Shadow Strike (Picked unit)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Picked unit) has buff Shadow Strike) Equal to True
                    • Then - Actions
                      • Unit - Kill (Last created unit)
                      • Unit Group - Remove all units of TriUnitsArrow from TriUnitsArrow
                    • Else - Actions
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • TriArrowLimit Greater than 3
                • Then - Actions
                  • Unit Group - Remove (Random unit from (Random (TriArrowLimit - 4) units from TriUnitsArrow)) from TriUnitsArrow
                  • Unit Group - Pick every unit in TriUnitsArrow and do (Actions)
                    • Loop - Actions
                      • Unit - Create 1 Dummy (Tri-Arrow) for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing degrees
                      • Unit - Order (Last created unit) to Night Elf Warden - Shadow Strike (Picked unit)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • ((Picked unit) has buff Shadow Strike) Equal to True
                        • Then - Actions
                          • Unit - Kill (Last created unit)
                          • Unit Group - Remove all units of TriUnitsArrow from TriUnitsArrow
                        • Else - Actions
                • Else - Actions
        • Custom script: call RemoveLocation(udg_tempPoint)
- Judgement Strike (Special Effect, Point)
  • Judgement Strike
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Judgement Strike
    • Actions
      • Set TargetPoint_JS = (Target point of ability being cast)
      • Set Caster_JS = (Casting unit)
      • Special Effect - Create a special effect at (Target point of ability being cast) using Abilities\Spells\Human\ReviveHuman\ReviveHuman.mdl
      • Special Effect - Destroy (Last created special effect)
      • Unit - Cause Caster_JS to damage circular area after 0.50 seconds of radius 200.00 at TargetPoint_JS, dealing (90.00 x (Real((Level of Judgement Strike for Caster_JS)))) damage of attack type Chaos and damage type Normal
      • Custom script: call RemoveLocation (udg_TargetPoint_JS)
- Laser Impulse (Special Effect)
  • Laser Impulse
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Laser Impulse (Kul'Tiras Mage)
    • Actions
      • Set TargetPoint_LI = (Target point of ability being cast)
      • Set Caster_LI = (Casting unit)
      • Special Effect - Create a special effect at (Target point of ability being cast) using Abilities\Spells\Items\TomeOfRetraining\TomeOfRetrainingCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • Unit - Cause Caster_LI to damage circular area after 0.50 seconds of radius 500.00 at TargetPoint_LI, dealing 600.00 damage of attack type Spells and damage type Cold
      • Custom script: call RemoveLocation(udg_TargetPoint_LI)
- Paralyzing Thunder (Point)
  • Unit - Remove PT_Dummy from the game
these should be
  • Unit - Add 0.10 Generic expiration timer for PT_Dummy
  • Custom script: call RemoveUnit(udg_PT_Dummy)
these should be
  • Custom script: call RemoveLocation(udg_PT_Point)
  • Paralyzing Thunder
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Paralyzing Thunder (Electric Rider)
    • Actions
      • Set PT_Point = (Target point of ability being cast)
      • Unit - Create 1 Dummy (Paralyzing Thunder) for (Owner of (Casting unit)) at PT_Point facing Default building facing degrees
      • Set PT_Dummy = (Last created unit)
      • Wait 1.00 seconds
      • Unit - Add a 0.10 second Generic expiration timer to PT_Dummy
      • Custom script: call RemoveLocation(udg_PT_Point)
- Precious Gold Coins (3 Points)
  • Precious Gold Coins
    • Events
      • Time - Elapsed game time is 4.00 seconds
    • Conditions
    • Actions
      • Set tempPoint = (Random point in (Playable map area))
      • Item - Create Precious Gold coins at tempPoint
      • Custom script: call RemoveLocation (udg_tempPoint)
      • Set tempPoint = (Random point in (Playable map area))
      • Item - Create Precious Gold coins at tempPoint
      • Custom script: call RemoveLocation (udg_tempPoint)
      • Set tempPoint = (Random point in (Playable map area))
      • Item - Create Precious Gold coins at tempPoint
      • Custom script: call RemoveLocation (udg_tempPoint)
      • Trigger - Turn on Dropper <gen>
      • Wait 2.20 game-time seconds
      • Game - Display to (All players) the text: The Precious Gold C...
- Dropper (Point)
  • Dropper
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • Set tempPoint = (Random point in (Playable map area))
      • Unit - Order Precious Gold Coins Dropper 0274 <gen> to Move To tempPoint
      • Custom script: call RemoveLocation (udg_tempPoint)
- Stored Foods (Point)
  • Stored Foods
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Stored Foods
    • Actions
      • Set tempPoint = (Center of Stored Foods <gen>)
      • Unit - Move (Triggering unit) instantly to tempPoint
      • Custom script: call RemoveLocation (udg_tempPoint)
- The Owl Spawn (Point)
  • The Owl Spawn
    • Events
      • Time - Elapsed game time is 400.00 seconds
    • Conditions
    • Actions
      • Game - Display to (All players) for 45.00 seconds the text: The |cffffcc00Golde...
      • Set tempPoint = (Random point in (Playable map area))
      • Unit - Create 1 Golden Owl for Neutral Passive at tempPoint facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_tempPoint)
Learning Hero should be Triggering unit
Casting unit should be Triggering unit
Dying unit should be Triggering unit

EDIT: should i explain the details ? the tutorials should help you fix the leaks. i'm not sure why are you not able to fix leaks after reading tutorials.
 
Last edited:
Status
Not open for further replies.
Top