ZakkWylde-
New Member
- Reaction score
- 14
Every second, this function creates and orders 2-6 troll headhunters...
There's the code. Is there any reason this should cause lag after running for a while?
When the troll headhunters reach the other side, I remove them from the game (using GUI). The units are removed...but is something left behind?
Am I missing something? After about 5 minutes of this running, I believe it single-handedly accounts for about 20-40 fps (out of my normal 60). When it first starts up, its around 10.
JASS:
function yU takes integer Id,real X1,real Y1,real X2,real Y2,real YH returns nothing
local unit zH=CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE), Id, X1, Y1, YH)
call IssuePointOrderById(zH,851986,X2,Y2)
call SetUnitMoveSpeed(zH, 370)
call GroupAddUnit(udg_Level4Pat,zH)
call GroupAddUnit(udg_Level4Snow, zH)
set zH = null
endfunction
function ZU takes integer Id,rect r1,rect r2 returns nothing
local integer i
local real X1
local real Y1
local real X2
local real Y2
set i =GetRandomInt(0, 2)
loop
exitwhen (i<0)
set X1=GetRandomReal(GetRectMinX(r1),GetRectMaxX(r1))
set Y1=GetRandomReal(GetRectMinY(r1),GetRectMaxY(r1))
set X2=GetRectMaxX(r2)
set Y2=GetRandomReal(GetRectCenterY(r2),GetRectCenterY(r2))
call yU(Id,X1,Y1,X2,Y2,0)
set i=i-1
endloop
set i = 0 //Whatever =D
endfunction
function Gogo takes nothing returns nothing
local integer Th = 039;ohun039;
call ZU(Th, gg_rct_Level4BigTrolla, gg_rct_Level4BigTrollaStop)
call ZU(Th, gg_rct_Level4BigTrollb, gg_rct_Level4BigTrollbStop)
endfunction
//===============
function InitTrig_Level4BigSnow takes nothing returns nothing
set gg_trg_Level4BigSnow = CreateTrigger()
call DisableTrigger(gg_trg_Level4BigSnow)
call TriggerRegisterTimerEvent(gg_trg_Level4BigSnow, 1., true)
call TriggerAddAction(gg_trg_Level4BigSnow, function Gogo)
endfunction
There's the code. Is there any reason this should cause lag after running for a while?
When the troll headhunters reach the other side, I remove them from the game (using GUI). The units are removed...but is something left behind?
Am I missing something? After about 5 minutes of this running, I believe it single-handedly accounts for about 20-40 fps (out of my normal 60). When it first starts up, its around 10.