• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[JASS] WHY?! why?!! Why does ths happen?

Status
Not open for further replies.
Level 18
Joined
Oct 18, 2007
Messages
930
ok im making a kind of moving spell but i cant get this to work
JASS:
function C_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A000'
endfunction

function C_Move takes unit u, unit a, real dist, real angle, location loc returns nothing

endfunction

function C_Actions takes nothing returns nothing
    local timer t = CreateTimer()
    local unit u = GetTriggerUnit()
    local unit a = GetSpellTargetUnit()
    local location loc1
    local location loc2
    local real dist
    local real angle
    call TimerStart(t, 0.035, true, function C_Move( u, t, dist, angle, loc1 ))
endfunction

//*-------------------------------------------------------------------------------------------------------*
//|                                         *END OF SCRIPT*                                               |
//*-------------------------------------------------------------------------------------------------------*
function InitTrig_Charge takes nothing returns nothing
  local trigger C = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ( C, EVENT_PLAYER_UNIT_SPELL_CAST )
    call TriggerAddCondition( C, Condition( function C_Actions ) )
    call TriggerAddAction( C, function C_Actions )
  set C = null
endfunction

I get the error here
JASS:
    call TimerStart(t, 0.035, true, function C_Actions( u, a, dist, angle, loc1 ))
i get the error
Code:
Line 31: expected '

someone know why? and if you know why, tell me where :)
 
Last edited:
Level 22
Joined
Dec 31, 2006
Messages
2,216
You can't use arguments when using timers. But it's possible to attach data to timers or other handles by f.ex. using "Local Handle Vars" and then retrieve the stored data in the function that needs the data.
 
Status
Not open for further replies.
Top