• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[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