Jesus4Lyf
Good Idea™
Key Timers 2 is now out. Easier interface. Uses one timer for each period instead of one timer for each chunk of code. I would've liked to have a new thread for it because I didn't consider Key Timers 1 redundant, but oh well.
if TriggerEvaluate(trig<i>) then
call TriggerClearConditions(trig<i>)
call TriggerAddCondition(trig<i>, Conditionz[max[id]])
call TriggerClearConditions(trig[max[id]])
set max[id]=max[id]-1
endif
</i></i></i>
//However I pick every unit within unit group
set i.pushunit=(GetUnit ())//that should be GetEnumUnit i think but not totally sure ^^
call Do<insert something here>
//dont have WE open and i forget where my WC disc is so everythings a little unknown
local group g=CreateGroup()
local unit t
call GroupEnumUnitsInRange(g,GetUnitX(unit),GetUnitY(unit),distance,null)
loop
set t=FirstOfGroup(g)
exitwhen t==null
call GroupRemoveUnit(g,t)
if <CONDITIONS INVOLVING T WHICH IS ENUM UNIT> then
<DO STUFF TO T WHICH IS ENUM UNIT>
endif
endloop
call DestroyGroup(g)
set g=null
Actually, I use that method for Stuff like "IsUnitEnemy(...) == true" in an If then else statement in the loop.Just got back from holidays...
Sorry your code is a bit vague. I explained elsewhere how to to something to all units withing a certain radius... I'd use that method:
JASS:local group g=CreateGroup() local unit t call GroupEnumUnitsInRange(g,GetUnitX(unit),GetUnitY(unit),distance,null) loop set t=FirstOfGroup(g) exitwhen t==null call GroupRemoveUnit(g,t) if <CONDITIONS INVOLVING T WHICH IS ENUM UNIT> then <DO STUFF TO T WHICH IS ENUM UNIT> endif endloop call DestroyGroup(g) set g=null
Note that these groups aren't reusable as they must remove all units from the group as it is used. However, since I assume you'll pause the units that are sliding, and that they'll slide with the dummy unit (which is not needed, you can just store an x and y in a variable) that they will not leave the radius anyway, and so will be included every time it loops. Using ForGroup is generally a bad idea in my opinion. Sometimes it's the best way though... But I tend to use this instead. Hope that helps, if it doesn't, ask for further help... Sorry that I've been on holidays and stuff, chances are this is out of date for you anyway.![]()
local integer j=2
globals
integer J
endglobals
...
set J=2
As I said, this timer system is really neat..
Any comments before I move this into the systems section?
set FastFood[H2I(t)-0x100000]=Data
local integer i=FastFood[H2I(GetExpiredTimer())-0x100000]