LearningCode
New Member
- Reaction score
- 24
I want to make a trigger run once on map initialization, then destroy and null that trigger.
Problem is, when I make a scope that initializes the function that runs the trigger, nothing happens.
I have to use [lJASS]call TriggerRegisterTimerEvent(t, 0.01, false)[/lJASS]
It kinda' annoys me.
Would anyone know the JASS equivalent of "Map Initialization"?
Here's the trigger I have now "In case you guys catch a leak which most likely exists.)
Problem is, when I make a scope that initializes the function that runs the trigger, nothing happens.
I have to use [lJASS]call TriggerRegisterTimerEvent(t, 0.01, false)[/lJASS]
It kinda' annoys me.
Would anyone know the JASS equivalent of "Map Initialization"?
Here's the trigger I have now "In case you guys catch a leak which most likely exists.)
JASS:
scope GameInit initializer GameStart
private function Visibility takes nothing returns nothing
local integer i = 0
local integer d = 0
local trigger t = GetTriggeringTrigger()
call SetFloatGameState(GAME_STATE_TIME_OF_DAY, 12.00)
call SetTimeOfDayScale(0.00 * 0.01)
call FogEnable(false)
call FogMaskEnable(false)
call SetGameSpeed( MAP_SPEED_FASTEST )
call SetMapFlag(MAP_LOCK_SPEED, true)
loop
exitwhen i == 7
loop
exitwhen d == 7
call SetPlayerAlliance(Player(i), Player(d), ALLIANCE_PASSIVE, true)
call SetPlayerAlliance(Player(i), Player(d), ALLIANCE_SHARED_XP, true)
set d = d+1
endloop
set i = i+1
endloop
set i = 0
loop
exitwhen i == 7
call SetPlayerAlliance(Player(11), Player(i), ALLIANCE_PASSIVE, false)
call SetPlayerAlliance(Player(i), Player(11), ALLIANCE_PASSIVE, false)
set i = i+1
endloop
call DisableTrigger(t)
call DestroyTrigger(t)
set t = null
endfunction
private function GameStart takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterTimerEvent(t, 0.01, false)
call TriggerAddAction(t, function Visibility)
set t = null
endfunction
endscope