hi,
local variable create an instance meaning that the same local cannot be over written by another cast of the function.
ex:
local unit a
set a = GetTriggerUnit()
wait 2.00
kill a
---------------------------------------------------------------------------------------
the problem is i use GUI with merged trigger wich run other triggers, and local variable are better be cleanned, because they create a value on each run...but if the value is cleanned while another trigger still is using the same instance of local variable it will create bugs...
how to clean a local when the same local is runned on many trigger with different wait time?
trigger 1
set local unit a = GetTriggerUnit()
if a == 'R000' do stuff
if a == 'Y010' or if a == 'K001' call TriggerExecute(trigger2)
if a == 'H002' call TriggerExecute(trigger3)
trigger 2
if a == 'Y010' do stuff
else if a == 'K001' call TriggerExecute(trigger4)
trigger 3
wait 2.00
if life of a> 50 do stuff
wait 2.00
wait 2.00
if life of a> 50 do stuff
wait 2.00
if life of a> 50 do stuff
trigger 4
move a to loc
etc..whatever
-------------------------------------------------------------------------------------
the important thing is that i have local for (attacking) (attacked) (ownerofattacking) (ownerofattacked) (playernumberofowner...etc)
there are lot of if then else and 100 or more of typeunit, and check, so it would be impossible to make it in one trigger in GUI.
but some trigger because of wait will continue to use "a" for a long time (a,b,c,d,etc...)
to clean them should i make at the end of each divided trigger a call TriggerExecute(trigger6)
trigger6
wait 20 sec
set a = null
so each instance would be cleanned after 20 sec, or add in each trigger the set a= null, but then it will remove value before the a instance finish in some trigger.
???
EDIT:
also i should tell you that since i use GUI, all my local are actually udg_Variable made local with custom text....
local variable create an instance meaning that the same local cannot be over written by another cast of the function.
ex:
local unit a
set a = GetTriggerUnit()
wait 2.00
kill a
---------------------------------------------------------------------------------------
the problem is i use GUI with merged trigger wich run other triggers, and local variable are better be cleanned, because they create a value on each run...but if the value is cleanned while another trigger still is using the same instance of local variable it will create bugs...
how to clean a local when the same local is runned on many trigger with different wait time?
trigger 1
set local unit a = GetTriggerUnit()
if a == 'R000' do stuff
if a == 'Y010' or if a == 'K001' call TriggerExecute(trigger2)
if a == 'H002' call TriggerExecute(trigger3)
trigger 2
if a == 'Y010' do stuff
else if a == 'K001' call TriggerExecute(trigger4)
trigger 3
wait 2.00
if life of a> 50 do stuff
wait 2.00
wait 2.00
if life of a> 50 do stuff
wait 2.00
if life of a> 50 do stuff
trigger 4
move a to loc
etc..whatever
-------------------------------------------------------------------------------------
the important thing is that i have local for (attacking) (attacked) (ownerofattacking) (ownerofattacked) (playernumberofowner...etc)
there are lot of if then else and 100 or more of typeunit, and check, so it would be impossible to make it in one trigger in GUI.
but some trigger because of wait will continue to use "a" for a long time (a,b,c,d,etc...)
to clean them should i make at the end of each divided trigger a call TriggerExecute(trigger6)
trigger6
wait 20 sec
set a = null
so each instance would be cleanned after 20 sec, or add in each trigger the set a= null, but then it will remove value before the a instance finish in some trigger.
???
EDIT:
also i should tell you that since i use GUI, all my local are actually udg_Variable made local with custom text....