HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Wierd error message

03-24-2008, 01:11 AM#1
burningice95
Collapse JASS:
scope COL

private function Callback takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit u = GetHandleUnit((t), "paused")

call UnitPauseTimedLife(u,false)
call FlushHandleLocals(t)
call PauseTimer(t)
call DestroyTimer(t)
endfunction


private function Filter takes nothing returns boolean
return  GetUnitAbilityLevel(GetFilterUnit(), B04P) > 0
endfunction


private function Actions takes nothing returns nothing

local group g = CreateGroup() 
local unit u
local rect r = GetPlayableMapRect() 
local timer t = CreateTimer()

set g =  GroupEnumUnitsInRect(g, r, Condition(function Filter))

loop
set u = FirstOfGroup(g)
exitwhen u == null
    call SetWidgetLife(u, life, GetWidgetLife(u, life) +1 )
    call GroupRemoveUnit(g, u)
    
    if IsUnitType(u, UNIT_TYPE_SUMMONED) == true  then 
            call TimerStart(t,45., false, function Callback)
            SetHandleHandle(t, "paused", u)
    endif
endloop


//===========================================================================
function InitTrig_COL takes nothing returns nothing
    set gg_trg_COL = CreateTrigger(  )
    call TriggerRegisterTimerEventPeriodic( gg_trg_COL, 1.00 )
    call TriggerAddAction( gg_trg_COL, function Actions )
endfunction

endscope


Collapse JASS:
function InitTrig_COL takes nothing returns nothing
gives me a syntax error. So does
Collapse JASS:
public function InitTrig_COL takes nothing returns nothing 
and
Collapse JASS:
private function InitTrig_COL takes nothing returns nothing

Does anyone know why?

I am using the Latest NewGen pack and the latest JassHelper, as far as I know.
03-24-2008, 01:13 AM#2
Joker
You dont have an
Collapse JASS:
endfunction
in your
Collapse JASS:
private function Actions takes nothing returns nothing
03-24-2008, 01:25 AM#3
burningice95
Wow

Thanks
03-25-2008, 07:06 AM#4
Pyrogasm
It should also be public function InitTrig.
03-25-2008, 01:33 PM#5
Vexorian
Quote:
Originally Posted by Pyrogasm
It should also be public function InitTrig.
I say it is time to move to scope initializers
03-25-2008, 07:11 PM#6
Pyrogasm
That'd be good. Something else good to have would be to use the SCOPE_PREFIX constant in the names of variables, like so:
Collapse JASS:
scope MyTriggerScope initializer InitScope
    //...
    private function InitScope takes nothing returns nothing
        set gg_trg_+SCOPE_PREFIX = CreateTrigger
        //Other trigger init things...
    endfunction
endscope
That way if people still want to use the global trigger variables they can do so without having to worry about changing the trigger references.