ZakkWylde-
New Member
- Reaction score
- 14
So I got the entangle effect to work when a hero walks or slides on the vines...
here is the initializer:
However, if more than one player is active (when I tried it, we had 3 people), it skips at least one line of the code...causing the demon hunters to keep sliding (they still die though)
here is the rest of the code:
In a 2 player game, if 2 people hit the vines at the same same, it skips that line of code...and the demon hunters both slide...
I would assume with 4 or more people that the case would resemble that of 3 people.
Is it possible that running timer events every 0.1 seconds for 12 demon hunters causes this problem?
Should I have it so that it checks at slightly different times? like every [square root of 2]/14 seconds...for one and sqrroot3/17 for another...(so that they're not exactly the same)?
here is the initializer:
JASS:
function InitTrig_RedTerrainKill takes nothing returns nothing
set gg_trg_RedTerrainKill = CreateTrigger( )
call TriggerRegisterTimerEvent(gg_trg_RedTerrainKill, 0.1, true)
call TriggerAddAction( gg_trg_RedTerrainKill, function RedTerrainKill )
endfunction
However, if more than one player is active (when I tried it, we had 3 people), it skips at least one line of the code...causing the demon hunters to keep sliding (they still die though)
here is the rest of the code:
JASS:
function RedTerrainKill takes nothing returns nothing
local unit u = udg_DemonHunters[1]
local real x = GetUnitX(u)
local real y = GetUnitY(u)
local effect e
if GetTerrainType(x, y) == udg_DeathTerVines and IsUnitAliveBJ(u)==true then
call SetUnitMoveSpeed(u, 520) //<--This line seems to be skipped
call PauseUnit(u, true)
call SetUnitFacing(u, GetUnitFacing(u))
set e = AddSpecialEffect("Abilities\\Spells\\NightElf\\EntanglingRoots\\EntanglingRootsTarget.mdl", x, y)
call DisableTrigger(gg_trg_RedTerrainKill)
call TriggerSleepAction(2)
call SetUnitExploded(u, true)
call KillUnit(u)
call PauseUnit(u, false)
call SetUnitMoveSpeed(u, 522)
call DestroyEffect(e)
set e = null
call EnableTrigger(gg_trg_RedTerrainKill)
endif
endfunction
In a 2 player game, if 2 people hit the vines at the same same, it skips that line of code...and the demon hunters both slide...
I would assume with 4 or more people that the case would resemble that of 3 people.
Is it possible that running timer events every 0.1 seconds for 12 demon hunters causes this problem?
Should I have it so that it checks at slightly different times? like every [square root of 2]/14 seconds...for one and sqrroot3/17 for another...(so that they're not exactly the same)?