- Joined
- May 15, 2008
- Messages
- 147
Ok I've uber-mastered GUI(see my arena game) and am sick of it's limitations, and now I'm practicing Jass, but I still lack the experience.
What's the thing with the Expected ' error I don't get that??
Here is the code it shows that the error in this line:
Uhm don't pay attention on the uncompletion (since it does nothing, 'xcept moving the dummy unit) of the spell I'm just practicing so I get the hang of using the timers.
Thanx in advance!!!
What's the thing with the Expected ' error I don't get that??
Here is the code it shows that the error in this line:
JASS:
call TimerStart(T, 0.03, true, function Blood_Twister_Execute())
Uhm don't pay attention on the uncompletion (since it does nothing, 'xcept moving the dummy unit) of the spell I'm just practicing so I get the hang of using the timers.
Thanx in advance!!!
JASS:
//Condition Main
function Blood_Twister_Condition takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A004' ) ) then
return false
endif
return true
endfunction
//Actionez
function Blood_Twister_Execute takes nothing returns nothing
local timer T = GetExpiredTimer()
local unit sfx = LoadUnitHandle(udg_Hashtable, GetHandleId(GetTriggerUnit()), 2)
local integer x = LoadIntegerBJ(1, GetHandleId(GetTriggerUnit()), udg_Hashtable)
set x = x+1
call SaveIntegerBJ(x, 1, GetHandleId(GetTriggerUnit()), udg_Hashtable)
if x > 12 then
call DisplayTextToForce( GetPlayersAll(), I2S(x) )
call SetUnitPosition(sfx, PolarProjectionX( GetUnitX(sfx), 90, 0), PolarProjectionY( GetUnitY(sfx), 90, 0))
else
call PauseTimerBJ( true, T )
call DestroyTimer(T)
call KillUnit(sfx)
endif
set T = null
set sfx = null
call FlushChildHashtableBJ( GetHandleIdBJ(GetTriggerUnit()), udg_Hashtable )
endfunction
function Blood_Twister_Action takes nothing returns nothing
local timer T = CreateTimer()
local unit sfx
local integer x = 0
local real Angle = 0
call CreateNUnitsAtLoc( 1, 'h000', GetOwningPlayer(GetTriggerUnit()), GetUnitLoc(GetTriggerUnit()), Angle )
set sfx = GetLastCreatedUnit()
call SetUnitAnimation(sfx, "birth")
call QueueUnitAnimation(sfx, "stand")
call SaveIntegerBJ(x, 1, GetHandleId(GetTriggerUnit()), udg_Hashtable)
call SaveUnitHandleBJ(sfx, 2, GetHandleId(GetTriggerUnit()), udg_Hashtable)
call TimerStart(T, 0.03, true, function Blood_Twister_Execute())
set T = null
set sfx = null
endfunction
//////////////////////////////////////////////////////
function InitTrig_Blood_Twister takes nothing returns nothing
local trigger T = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( T, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( T, Condition( function Blood_Twister_Condition ) )
call TriggerAddAction( T, function Blood_Twister_Action )
set T = null
endfunction