ZakkWylde-
New Member
- Reaction score
- 14
JASS:
private function Trig takes nothing returns nothing
local integer a = 0
local integer b = 3
//local real system = 45.00
local real x
local real y
local integer kill = 0
local unit u = GetEnumUnit()
local real unitx = GetUnitX (u)
local real unity = GetUnitY (u)
local effect e
if GetUnitState(u, UNIT_STATE_LIFE) >= 1 then
loop
exitwhen a > b
set x = unitx + TerrainKillSlide_system * Cos(( 90.00 * I2R(a) ) * bj_DEGTORAD)
set y = unity + TerrainKillSlide_system * Sin(( 90.00 * I2R(a) ) * bj_DEGTORAD)
if GetTerrainType(x, y) == udg_DeathTerVines then
set kill = ( kill + 1 )
endif
set a = a + 1
endloop
if kill == 4 and GetUnitFlyHeight(u) <= 0.01 then
call SetUnitMoveSpeed(u, 521)
call PauseUnit(u, true)
if GetUnitMoveSpeed(u)==521 then
call BJDebugMsg("Effect.")
set e = AddSpecialEffect("Abilities\\Spells\\NightElf\\EntanglingRoots\\EntanglingRootsTarget.mdl", unitx, unity)
call SetUnitMoveSpeed(u, 520)
call BJDebugMsg("Done.")
call TriggerSleepAction(2.0)
call BJDebugMsg("Sleep Over.")
endif
call SetUnitExploded(u, true)
call KillUnit(u)
call PauseUnit(u, false)
call SetUnitMoveSpeed(u, 522)
call DestroyEffect(e)
set e = null
endif
endif
set u = null
endfunction
So if you can follow that trigger through...maybe someone can explain to me WHY as SOON as I step on the vines, it starts making entangling roots effects CONSTANTLY--non-stop...until I type -kill red to kill my unit. It eventually gets to the point of fps drastically falling (because of the myriad effects all at once). When I run the trigger, the messages displayed are
Effect.
Done.
Effect.(x10239812309)
Done. (x10239812309)
and it keeps on running those messages.
It doesn't even get to doing anything else... i.e. my unit's movement speed (put in as test tracker) is never set to 520 or 522 after its initially being set to 521 in the trigger.
I would LOVE some help...(I have even tried timers...but maybe I implemented it incorrectly). If someone could give me a drop-dead easy example of a timer working in this format, that would GREAT!!! (Or any working example for that matter )