Yea, that sounds better. So basically i would use something like 10 unit groups or so and recycle them(like re-empty them at the end of triggers and get a free one when i needed one).
Also it would be slower if u searched through all units with data on them in one single group than searching several groups i think.
This is what i got so far... am i on the right track?

JASS:
library GroupRecycle
globals
unit group G[1] = CreateGroup()
unit group G[2] = CreateGroup()
unit group G[3] = CreateGroup()
unit group G[4] = CreateGroup()
unit group G[5] = CreateGroup()
unit group G[6] = CreateGroup()
unit group G[7] = CreateGroup()
unit group G[8] = CreateGroup()
unit group G[9] = CreateGroup()
unit group G[10] = CreateGroup()
endglobals
function GetGroup takes nothing returns integer
loop
exitwhen i > 10
if CountUnitsInGroup(G[i]) == 0 then
return i
endif
set i = i + 1
endloop
return 11
endfunction
function GroupRelease takes integer groupid returns nothing
call GroupClear(G[groupid])
endfunction
endlibrary
function m takes nothing returns booleanexpr
return true
endfunction
function forgroupfunc takes nothing returns nothing
endfunction
function usegroup takes nothing returns nothing
local integer i = GetGroup()
local booleanxpr = Condition(m)
set G[i] = GroupEnumUnitsInRange(G[i],x,y,radius, condition)
call ForGroup(G[i],function forgroupfunc)
call GroupRelease(i)
endfunction
Quote:
I think all these timer systems are confusing the hell out of people
|
QFT, yea... They all seem to all have "personal benefits" for each of them too if it wasn't enough to annoy the heck out of you trying to choose which ones to use. I think using like TT and HSAS works good.
(Since i think HSAS is faster than ABC, but not faster than TT. Also TT only uses 1 timer.
Another reason why is i don't like going back to gamecache really either.)