• 🏆 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] Fixing memory leaks in the map.

Status
Not open for further replies.
Level 6
Joined
Jul 12, 2017
Messages
139
Hello everyone.

I wanna ask if you could help me with memory leaks, well I do understand what leak is and I have attempt to learn it a lot but still, I couldn't manage to do it.

So, I just wanna ask if anyone could fix the triggers of my map. There's more than 100 triggers and I would love to do it myself but I just couldn't...

This is too much I know but I just wanna see if anyone could help, I would appreciate a lo-... no I would love you to death!

If there's noone then I don't mind at all because I know asking to do this for free is bizarre and ridiculous.
 

Attachments

  • Journey to the end FIX V2.0.w3x
    15.8 MB · Views: 47
  • Journey to the end FIX V2.0.w3x
    15.8 MB · Views: 45
Level 37
Joined
Jul 22, 2015
Messages
3,485
I took a look at all your triggers, and pretty much all of your locations and special effects leak. You also have a couple of unit group leaks in the Ally becomes natural at first folder. They are extremely easy to fix, so I recommend you take a look at these two tutorials: Things That Leak & Memory Leaks

An example of one of your memory leaks would be here:
  • Blink Strike
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Blink Attack (Maiev)
    • Actions
      • Set TemLoc00 = (Target unit of ability being cast)
      • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing 400.00 damage of attack type Spells and damage type Normal
      • Unit - Move (Triggering unit) instantly to (Position of TemLoc00)
      • Unit - Order (Triggering unit) to Attack (Target unit of ability being cast)
      • Special Effect - Create a special effect at (Position of (Casting unit)) using Abilities\Spells\NightElf\Blink\BlinkTarget.mdl
      • Wait 2.00 seconds
      • Special Effect - Destroy (Last created special effect)
  • Position of TemLoc00 & Position of (Casting unit) are location leaks
  • The special effect you create can potentially leak if another effect is created within the 2.00 second wait timer
Here is how you would fix them:
  • Blink Strike
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Blink Attack (Maiev)
    • Actions
      • Set TemLoc00 = (Target unit of ability being cast)
      • Set TempLoc1 = (Position of TemLoc00)
      • Set TempLoc2 = (Position of (Casting unit))
      • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing 400.00 damage of attack type Spells and damage type Normal
      • Unit - Move (Triggering unit) instantly to TempLoc1
      • Unit - Order (Triggering unit) to Attack (Target unit of ability being cast)
      • Custom script: call RemoveLocation(udg_TempLoc1)
      • Custom script: call RemoveLocation(udg_TempLoc2)
      • Special Effect - Create a special effect at TempLoc2 using Abilities\Spells\NightElf\Blink\BlinkTarget.mdl
      • Set TempSFX = (Last created special effect)
      • Wait 2.00 seconds
      • Special Effect - Destroy TempSFX
Do keep in mind that this spell is not MUI. There is also a lot of room for improvement in efficiency here, but the thread is about leaks.
 
Status
Not open for further replies.
Top