1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. We have recently started the 16th edition of the Mini Mapping Contest. The theme is mini RPG. Do check it out and have fun.
    Dismiss Notice
  4. Dismiss Notice
  5. The Highway to Hell has been laid open. Come along and participate in the 5th Special Effect Contest.
    Dismiss Notice
  6. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Fixing Leaks

Discussion in 'Map Development' started by Chuckle Brother, Sep 28, 2005.

  1. Chuckle Brother

    Chuckle Brother

    Joined:
    May 16, 2004
    Messages:
    392
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Alright I understand what a leak is and such, but I need to know every type of leak and the proper way to deal with them using custom scripts. Also I need to know how they are created. And lastly I have a question regarding position leaks, does referencing to the Target Point and such leave a leak and when i create a dummy they need to have their position destroyed right?
     
  2. Komodo

    Komodo

    Joined:
    Nov 4, 2004
    Messages:
    23
    Resources:
    0
    Resources:
    0
    Only one which ever bothers me is the location one. If you ever define a Point on the map just make sure you remove it. Most of the time I use other things such as regions or positions of units rather then Points. Im interested to see what some experienced map makers have to say on this though.
     
  3. Chuckle Brother

    Chuckle Brother

    Joined:
    May 16, 2004
    Messages:
    392
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Thats what I wanted. I want a complete list of leaks and how to fix them so that I can patch them for my map. Cause right now it leaks like a bottomless boat.
     
  4. qwerty

    qwerty

    Joined:
    Jul 2, 2004
    Messages:
    695
    Resources:
    0
    Resources:
    0
    position of a unit IS a point.

    and cant you just null all the variables in a function after using it?
     
  5. Los_Tacos

    Los_Tacos

    Joined:
    Aug 5, 2005
    Messages:
    219
    Resources:
    7
    Maps:
    7
    Resources:
    7
    I don't think nullifying is necessary, just destroying.

    To answer the OP

    Point: make a point variable

    example trigger
    set tempPoint = random point in region 001
    create unit at tempPoint
    custom script - call RemoveLocation(udg_tempPoint)

    Unit group: make a unit group variable

    example trigger
    set tempGroup = units in region 001
    pick every unit in tempGroup and do kill picked unit
    custom script - call DestroyGroup(udg_tempGroup)

    Groups leak when you use "pick every unit" action. Those are the only 2 types of leaks that you need to worry about.
     
  6. qwerty

    qwerty

    Joined:
    Jul 2, 2004
    Messages:
    695
    Resources:
    0
    Resources:
    0
    if you destroy before nullifying, then it wont be nulled and the variable would still exist there.
     
  7. Chuckle Brother

    Chuckle Brother

    Joined:
    May 16, 2004
    Messages:
    392
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Thanks guys, I knew how to fix position leaks, i've been doing that destruction of the Point variables for a while now, I just wasn't sure what other types there are.
     
  8. Pyrodactyl

    Pyrodactyl

    Joined:
    Jun 9, 2004
    Messages:
    212
    Resources:
    1
    Maps:
    1
    Resources:
    1
    I wanted to open a topic like that, but i saw it already exists, so i want to ask a few questions about leak.

    You all say, i can prevent a leak by destroying the location. That makes sense in case of spells, where the location is always different.
    But, what a bout locations that i will use later? So i have a periodic trigger that spawns units (AoS map) every x seconds to a location variable that always remains the same. I did not notice any leaks after hours of playing (probably because i have a lot of memory in my comp.), and i don't know why it is necessary to remove this location and then create it again every time the trigger runs.

    Perhaps i don't understand well enough what makes a variable to leak.