Problem With Timer

nandosman

New Member
Reaction score
4
I'm having problems with an effect i'm creating, i'm using this code:

JASS:
local unit casting_unit
    local location cast_loc 
    local location n
    local effect array e
    local integer i
    local real m
    local timer t
    
    set t = CreateTimer()
    set i = 0
    set casting_unit = GetSpellAbilityUnit()
    set cast_loc = GetUnitLoc(casting_unit)

    set n = PolarProjectionBJ(cast_loc, 300, 270)
    set m = 0   
    loop
        exitwhen m >= (((1 + SquareRoot(5))/2)*300)
        set m = m + 20
        call TimerStart(t, 0.05, false, function Especial_Effect(n, m, 108))
        set e<i> = GetLastCreatedEffectBJ()
        set i = i + 1
    endloop</i>


The code continues but this is the problematic part, i think the problem is that the timer doesn't accept functions that takes variables, but i'm not sure; tell me if that's true...
 

Rheias

New Helper (I got over 2000 posts)
Reaction score
232
TimerStart takes code, code is like functions, but, the functions code represent can't take, nor return something.

If you want to pass the locals to that function you need to use:

1) Globals or
2) Some kind of Handle System (KaTTaNa's / Vexorian's CS_Cache)
3) Structs.
 
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