Too many repeated timer events?!?

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:
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)?
 

Sgqvur

FullOfUltimateTruthsAndEt ernalPrinciples, i.e shi
Reaction score
62
JASS:
local unit u = udg_DemonHunters[1]


Your code does what it suppose to do only to the unit stored in udg_DemonHunters[1], but what about udg_DemonHunters[0] for example?


whats the point of this?
JASS:



and is this really needed?
JASS:
 

ZakkWylde-

New Member
Reaction score
14
JASS:
local unit u = udg_DemonHunters[1]


Your code does what it suppose to do only to the unit stored in udg_DemonHunters[1], but what about udg_DemonHunters[0] for example?


whats the point of this?
JASS:



and is this really needed?
JASS:

well its a terrain kill, and I tried to individualize it. I just gave one example (and I stupidly didn't make the array start at 0, I started at 1 /qq). But I currently have 12 triggers (for each player .... red through brown)

When you pause a unit that's sliding, for some reason it turns direction to face 270 degrees (facing down). So I set it to face the direction it was facing, instead of turning to face down.

The trigger sleep action is so that the demon hunter is frozen for two seconds with entangle effect under him and then he dies 2 seconds later (so it looks like he's dying to entangle).
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top