- Joined
- Nov 3, 2013
- Messages
- 989
Warcraft 3 patch: 1.31.1
I get an error on this line
I'm assuming that the issue is paranoia_expire(u) but I don't know why.
In 1.27 (JNGP) I don't get any error, though since
Since JNGP seemingly had no problem with it, I tried playing the map on 1.31.1 anyway, but that didn't work until I disabled the trigger.
the trigger is a combination of me converting a GUI trigger into custom text + I copied the timer functions from some tutorial, but I changed it so the function
I get an error on this line
call TimerStart(t, tDuration, false, function paranoia_expire(u))
Syntax Error, unexpected "("I'm assuming that the issue is paranoia_expire(u) but I don't know why.
In 1.27 (JNGP) I don't get any error, though since
BlzGetUnitAbilityCooldown
doesn't exist I replaced it with a number, so it could also have a problem I suppose.Since JNGP seemingly had no problem with it, I tried playing the map on 1.31.1 anyway, but that didn't work until I disabled the trigger.
JASS:
function paranoia_expire takes unit u returns nothing
call UnitRemoveAbility(u, 'A04E')
endfunction
function paranoia_timer takes unit u returns nothing
local timer t=CreateTimer()
local real tDuration = BlzGetUnitAbilityCooldown(u, 'A04E', GetUnitAbilityLevel(u, 'A04E'))
call TimerStart(t, tDuration, false, function paranoia_expire(u))
set t=null
endfunction
function Trig_Paranoia_2_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A04F' ) ) then
return false
endif
return true
endfunction
function Trig_Paranoia_2_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
call UnitAddAbilityBJ( 'A04E', u )
call SetUnitAbilityLevelSwapped( u, 'A04E', GetUnitAbilityLevel(u, 'A04F') )
call paranoia_timer(u)
endfunction
//===========================================================================
function InitTrig_Paranoia_2 takes nothing returns nothing
set gg_trg_Paranoia_2 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Paranoia_2, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Paranoia_2, Condition( function Trig_Paranoia_2_Conditions ) )
call TriggerAddAction( gg_trg_Paranoia_2, function Trig_Paranoia_2_Actions )
endfunction
the trigger is a combination of me converting a GUI trigger into custom text + I copied the timer functions from some tutorial, but I changed it so the function
paranoia_expire
takes a unit variable, since I wanted that to carry over so I don't have to use a hashtable or anything