- Joined
- Oct 11, 2012
- Messages
- 711
Hi there.
My first quesion: please see the two examples below:
However, when using a local trigger, it cannot be turned off:
So if my map has lots of triggered spells, is it better to use global triggers since disabled global triggers won't be fired? For example, I have 500 spells using global trigger variables and 490 of them are turned off, then when a unit casts a spell, only 10 triggers will be fired (checking the conditions). But if I use 500 local trigger variables, then 500 of them will all be fired, right?
Second question: on map initialization, are there differences between global triggers and local triggers? They all got initialized, right? Even the disabled global triggers? I am concerning about hitting the op limit.
My first quesion: please see the two examples below:
JASS:
function InitTrig_test takes nothing returns nothing
set gg_trg_test = CreateTrigger()
call DisableTrigger(gg_trg_test) //Disable it first then enable it when I want to use it.
.........
endfunction
However, when using a local trigger, it cannot be turned off:
JASS:
function onInit takes nothing returns nothing
local trigger t = CreateTrigger()
call DisableTrigger(t) //This is useless because I don't know how to turn it on later unless store it in some place
.....
endfunction
Second question: on map initialization, are there differences between global triggers and local triggers? They all got initialized, right? Even the disabled global triggers? I am concerning about hitting the op limit.