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

Leaks

Level 7
Joined
Nov 15, 2009
Messages
225
What are leaks?
Just a little bit 'different' explaining for all those who don't understand it.

I will explain it with an example.


1. Imagine a variable is a memo.

You can save data with a variable.
So in this example you write a value down on a memo.

2. How to check the value?

Simply pick up the memo and read what you've written down.
Any problems so far? No? Fine, let's continue!

3. I want to write down something else

How could you do this?
Strike the previous text and write down something else.
So we have an unreadable text (striked text) and another text you can read.

In our example the striked text is the leak.
It is still there, but you can't read it (even when you know what it is).

4. How can we avoid this leak?

Get a new memo for every text you write down.
And don't forget to throw the old memo into your bin.
This means that a variable would be removed, destroyed or 'null'ed now.

5. Does any variable leaks?

Thanks god no, but it would be easier to remember if they all would.
There's the problem. How should you know what leaks?
Don't worry, you will learn this over time (even if you don't focuse on it).

Most common things that leak:

locations
unit groups (groups)
player groups (forces)
special effects

6. How can I avoid leaks?

If you already used Jass it's not that problem. Because removing leaks mostly needs jass scripts.
As a GUI user (warcraft dialog triggering) you need custom scripts (listed somewhere on the top of all).
Inside those custom scripts you can write down any jass line you want.
In this case the 'leak remover'

Methods for most common things that leak
  • Custom script: call RemoveLocation(udg_POINT_VARIABLENAME)
  • Custom script: set bj_wantDestroyGroup = true
  • Player - Clear PLAYERGROUP_VARIABLENAME
  • Special Effect - Destroy(GetLastCreatedEffect)

7. Is there a complete list of things, or additional infos?

Yes, take a look here.
This page helped me a lot!



Remember:
This info does not contains all infos for leaks.
It is just a short explaining!
Last edited:
Top