Yudistira
Reaction score
21

Profile posts Latest activity Postings Experience Resources About


  • Please use the yellow Edit button at the bottom of your posts and add text there instead of writing one post after another of yours unless it's an important update.
    Yudistira
    Yudistira
    thats accidental actually, mistake sir

    Please use the yellow Edit button at the bottom of your posts and add text there instead of writing one post after another of yours unless it's an important update.
    As Ghostwolf said, the normals of the vertices are inverted or pointing to the inside of the model. You might want to export the mesh, fix the normals and then reimport and re-rig the mesh onto the model. There might be an easier way, but this is all I can think of right now.
    l disable my respawn system and yet lag still there..
    even l used region to point a location does it cause leaks?
    Good day,

    Im using old codegen and i dont know how to converte code into texfile, if you do i will be happy.

    Thanks a lot.
    You can try nulling the location after you destroy it.

    Handles are not recycled instantly, they are recycled in batches.

    Run the actions a lot of time without the waits and see what happens.
    I don't see any leak there, though you may try to null the point variable - once you remove the location via custom script, use "set udg_Striker[18] = null

    Also, when you pick units into the group, you don't need to check if player number of matching player is greater than or equal to 1, since there is no player with number 0 (unless you use jass, where player 1 = 0, player 2 = 1, etc.), so you can leave that condition out.
    It is alright (leakfree), but there is one thing that puzzles me:
    Set Unit_Groups = (Units within 512.00 of Striker[10] matching ((Matching unit) Equal to ReCas[1]))This picks only specific unit (the ReCas[1] unit) into this group. I assume you want to check distance - if so, use the "Real" condition "Math - Distance between points" => you set 2 points (ReCas and Acc) and check their distance via the real condition I wrote about. It should be more efficient that way.
    The pick functions in GUI all have that problem. You would have to track the creation/destruction of all units, store them inside a permanent group, then in the specific case copy its elements/filter unwanted units via if/then/elses out for a new group. But since you cannot create a new group in GUI either, you would have to use permanent groups in the specific code as well, therefore not destroying them. Better build yourself some function in GUI then.

    GetUnitsInRange
    Events
    Conditions
    Actions
    Custom script: set udg_g = CreateGroup()
    Custom script: call GroupEnumUnitsInRange(udg_g, GetLocationX(udg_l), GetLocationY(udg_l), udg_pickRange, null)




    Events
    Conditions
    Actions
    Set l = (Position of (Triggering unit))
    Set pickRange = 180.00
    Trigger - Run GetUnitsInRange <gen> (ignoring conditions)
    Custom script: call RemoveLocation(udg_l)
    Unit Group - Pick every unit in g and do (Actions)
    Loop - Actions
    Custom script: call DestroyGroup(udg_g)

    Well, anyway, learn jass.
    That's because the "Units In Range"-function is flawed/Blizzard screwed up local agent variables. It looks like this:

    function GetUnitsInRangeOfLocMatching takes real radius, location whichLocation, boolexpr filter returns group
    local group g = CreateGroup()
    call GroupEnumUnitsInRangeOfLoc(g, whichLocation, radius, filter)
    call DestroyBoolExpr(filter)
    return g
    endfunction

    function GetUnitsInRangeOfLocAll takes real radius, location whichLocation returns group
    return GetUnitsInRangeOfLocMatching(radius, whichLocation, null)
    endfunction

    In the upper function, a local variable g is pointed to the group object but never nullified. An object cannot free its id before all variables/references are gone from it but local variables are not auto-deleted when the function call terminates, therefore in the example above, the object always ends up with one remaining reference. Avoid the function/write an alternative, e.g.:

    function GetUnitsInRangeOfLocMatchingFixed takes real radius, location whichLocation, boolexpr filter returns group
    local group g = CreateGroup()
    call GroupEnumUnitsInRangeOfLoc(g, whichLocation, radius, filter)
    call DestroyBoolExpr(filter)
    set udg_unusedGroupVariable = g
    set g = null
    return udg_unusedGroupVariable
    endfunction

    function GetUnitsInRangeOfLocAllFixed takes real radius, location whichLocation returns group
    return GetUnitsInRangeOfLocMatchingFixed(radius, whichLocation, null)
    endfunction

    where udg_unusedGroupVariable is some elsewhere unused global group variable.
    easiest way is to store player number of triggering player into an integer variable.
    Lets call it tempInt
    here is the custom script.
    Custom script: call DestroyGroup(udg_UnitGroup[ udg_tempInt])
    Also this can be made a lot more efficient. Picking every unit owned by a player is taxing. Instead have a couple triggers. One that adds units to a player group of the units owner when they enter the map. Then one that removes units from the group when they leave the map.
    Alternatively don't use a group array. Just use tempGroup if you are planning on destroying it after you use it.
    If you show me the whole trigger i can tell you which is the better way to go with it.
  • Loading…
  • Loading…
  • Loading…
  • Loading…
  • Loading…
Top