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

[JASS] UnitApplyTimedLife -> not removing units completly?

Status
Not open for further replies.
Level 7
Joined
Oct 21, 2008
Messages
234
I´m currently recognizing serious performance problems in my map. After testing several functions i found the problem. Sinces i use a buff system that needs timed dummy units (with Aloc), those wont get removed after time is up. They where removed from screen (the model) but can still be found e.g. by GroupEnumUnitsOfPlayer. As number of units in map reaches 500 it gets laggy...

So two questions:
  1. Is it just an error of my code/thoughts or really the truth, that units with timed life wont be removed completly?
  2. How to fix it? I need to place a buff without using sleeps or timed units.
 
Level 7
Joined
Oct 21, 2008
Messages
234
first of all try it with 'BTLF' instead of 'Aloc' and don't forget to null the locals or globals

Aloc - that means that i added a locust ability to them. Nulling globals or locals wont remove that units :con:

Look, it´s just that simple:

JASS:
function FleeUnit takes unit u returns nothing
    local unit uFlee = CreateUnit(GetOwningPlayer(u), 'h01C', GetUnitX(u), GetUnitY(u), 0)
    call UnitApplyTimedLife(uFlee, 'BTLF', 1)
    call IssueTargetOrder(uFlee,"slow",u)
endfunction

h01C is the dummy unit. The buff-ability is, as you can guess, the slow ability.
 
Level 7
Joined
Oct 21, 2008
Messages
234
Hm nulling locals fixes leaks? Never heard of that, but thx. Will try it out.

Btw: replacing UnitApplyTimedLife by RemoveUnit will eliminate those performance issues, the units are also complety removed and cant be found by GroupEnums any more.
So someone plz tell me how to completly remove by UnitApplyTimedLife :p
 
Status
Not open for further replies.
Top