| 07-27-2007, 05:34 PM | #1 |
I get an invalid arugment type at call PauseTimer(nextpale). Theres also an expected endif for all of the following: Anyone know whats wrong? JASS:local timer nextpale = CreateTimer() local integer counter = 0 local unit caster = GetSpellAbilityUnit() call SetHandleHandle(nextpale, "counter", counter) call SetHandleHandle(nextpale, "caster", caster) call TimerStart(nextpale, 0.2, true, function EndPale) JASS:function EndPale takes nothing returns nothing local timer nextpale = GetExpiredTimer() local integer countess = GetHandleInt(nextpale, "counter") local unit caster = GetHandleUnit(nextpale, "caster") local location point = PolarProjectionBJ(GetUnitLoc(caster), 256.00, ( GetUnitFacing(caster) + ( I2R(countess) * 16.00 ) )) call PointSFX(point,"Abilities\\Spells\\Undead\\Impale\\ImpaleMissTarget.mdl",3) call SetHandleHandle(nextpale, "counter", countess + 1) call PauseTimer(nextpale) call DestroyTimer(nextpale) set caster = null set nextpale = null endfunction function Trig_Spiral_Impale_Actions takes nothing returns nothing if (GetSpellAbilityId() == 'A004') then local timer nextpale = CreateTimer() local integer counter = 0 local unit caster = GetSpellAbilityUnit() call SetHandleHandle(nextpale, "counter", counter) call SetHandleHandle(nextpale, "caster", caster) call TimerStart(nextpale, 0.2, true, function EndPale) endif endfunction //=========================================================================== function InitTrig_Spiral_Impale takes nothing returns nothing set gg_trg_Spiral_Impale = CreateTrigger( ) call TriggerRegisterAnyUnitEventBJ( gg_trg_Spiral_Impale, EVENT_PLAYER_UNIT_SPELL_EFFECT ) call TriggerAddAction( gg_trg_Spiral_Impale, function Trig_Spiral_Impale_Actions ) endfunction |
| 07-27-2007, 05:39 PM | #2 |
JASS:call SetHandleHandle(nextpale, "counter", countess + 1) Integers aren't handles. If you want to set an integer, use SetHandleInteger(...) You've also got this same issue later on. JASS:local integer counter = 0 local unit caster = GetSpellAbilityUnit() call SetHandleHandle(nextpale, "counter", counter) |
| 07-27-2007, 06:02 PM | #3 |
the expected endif still persists |
| 07-27-2007, 06:11 PM | #4 |
Can't believe I didn't see this before... JASS:if (GetSpellAbilityId() == 'A004') then local timer nextpale = CreateTimer() local integer counter = 0 local unit caster = GetSpellAbilityUnit() call SetHandleHandle(nextpale, "counter", counter) call SetHandleHandle(nextpale, "caster", caster) call TimerStart(nextpale, 0.2, true, function EndPale) endif That means you need to move the declarations above the "if" To look probably like this... JASS:local timer nextpale = CreateTimer() local integer counter = 0 local unit caster = GetSpellAbilityUnit() if (GetSpellAbilityId() == 'A004') then call SetHandleHandle(nextpale, "counter", counter) call SetHandleHandle(nextpale, "caster", caster) call TimerStart(nextpale, 0.2, true, function EndPale) endif |
| 07-27-2007, 06:12 PM | #5 |
The local block has to be the first in the function. Using PJASS will help you avoid exposing embarassing mistakes like this. |
