| 03-24-2008, 01:11 AM | #1 |
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 JASS:function InitTrig_COL takes nothing returns nothing JASS:public function InitTrig_COL takes nothing returns nothing 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 |
You dont have an JASS:endfunction JASS:private function Actions takes nothing returns nothing |
| 03-24-2008, 01:25 AM | #3 |
Wow Thanks |
| 03-25-2008, 07:06 AM | #4 |
It should also be public function InitTrig. |
| 03-25-2008, 01:33 PM | #5 | |
Quote:
|
| 03-25-2008, 07:11 PM | #6 |
That'd be good. Something else good to have would be to use the SCOPE_PREFIX constant in the names of variables, like so: JASS:scope MyTriggerScope initializer InitScope //... private function InitScope takes nothing returns nothing set gg_trg_+SCOPE_PREFIX = CreateTrigger //Other trigger init things... endfunction endscope |
