native DestroyTimer takes timer whichTimer returns nothing
Those are safe to destroy unless you destroy them from another thread that can fire randomly. As far as people have reported, the fault is with events that are in the process of firing getting destroyed by their bound trigger's destruction.Oh also i wasnt talking about destroying timers i was talking about destroying triggers with timing events. like this: Time - Every 90.00 seconds of game time
that kinda thing.. those arnt safe to destroy eh?
I would like to point out that once a trigger has become unreachable (eg a trigger that only is able to fire once) it is classed as a memory leak.You can destroy it from another trigger, but it useless really, you won't increase performance so much or things like that. Also if you remove some functions used by other triggers you can crush game later or create bugs.
Also destroy trigger will just remove some code from your map, effects and actions created with that trigger will still remain.
function InitTrig_Setup takes nothing returns nothing
set gg_trg_Setup = CreateTrigger( )
call TriggerAddAction( gg_trg_Setup, function Trig_Setup_Actions )
endfunction
True, you can't reduce/reset research level.
//==============================================================================
// Library creates invisible sun and moon units for all players.
// These units are then used as tech requirements for spells.
// If a player has a sun unit in his ownership than he can use sun spells.
// Same goes for moon ofc.
// Sun units are owned by players only during day time.
// Moon units are owned by players only during night time.
//==============================================================================
library Daytime initializer Init uses Trig
globals
private constant player NEUTRAL = Player(13)
private unit array sun
private unit array moon
endglobals
//==============================================================================
// For testing purposes
//==============================================================================
public function Off takes nothing returns nothing
local integer i = 0
loop
exitwhen i>=12
call SetUnitOwner(sun[i], NEUTRAL, false)
call SetUnitOwner(moon[i], NEUTRAL, false)
set i = i + 1
endloop
endfunction
//==============================================================================
private function Dawn takes nothing returns nothing
local integer i = 0
loop
exitwhen i>=12
call SetUnitOwner(sun[i], Player(i), false)
call SetUnitOwner(moon[i], NEUTRAL, false)
set i = i + 1
endloop
endfunction
//==============================================================================
private function Dusk takes nothing returns nothing
local integer i = 0
loop
exitwhen i>=12
call SetUnitOwner(moon[i], Player(i), false)
call SetUnitOwner(sun[i], NEUTRAL, false)
set i = i + 1
endloop
endfunction
//==============================================================================
public function isDay takes nothing returns boolean
return (GetTimeOfDay() >= 6.00) and (GetTimeOfDay() < 18.00)
endfunction
//==============================================================================
private function Actions takes nothing returns nothing
if isDay() then
call Dawn()
else
call Dusk()
endif
endfunction
//==============================================================================
private function Init takes nothing returns nothing
local trigger trig
local item it
local integer i = 0
loop
exitwhen i>=12
set sun[i] = CreateUnit(NEUTRAL, UID_sun, 0-i*100, 0, 0)
set moon[i] = CreateUnit(NEUTRAL, UID_moon, 0+i*100, 0, 0)
call PauseUnit(sun[i], true)
call PauseUnit(moon[i], true)
set i = i + 1
endloop
// empire sun gets all map regen aura, scourge moon gets all map regen aura
call UnitAddAbility(sun[Players_EMPIRE], AID_sun_aura)
call UnitAddAbility(moon[Players_SCOURGE], AID_moon_aura)
call Trig_TimeOfDay(function Dawn, 6.00)
call Trig_TimeOfDay(function Dusk, 18.00)
call Trig_TimerSingle(function Actions, 0.01)
endfunction
endlibrary
Sorry buddy but you are wrong.
It just add or remove REQUIREMENTS for some event created.
UPGRADES are totally different thing.
This is false. You didn't even run the map to see how this method works did you?It just add or remove REQUIREMENTS for some event created.
^Setting an ugrade to a lower level is not possible.
True, you can't reduce/reset research level.
(talking obviously about researches not upgrades)Yes you can.
You obviously don't do you?I know what I'm saying, you are the one who act smart!
My whole map is open-source, and you already posted the trigger yourself.Show us how then, triggers, script, test map, I don't care!
With my English knowledge this:My whole map is open-source, and you already posted the trigger yourself.
It even has comments jeez.
Your vJass is horrible, it look more like jass with some elements of vJass, like globals.I guess the problem here is that my whole map is in vJass while you people speak only in GUI language...
Well I make, and you know what, people appreciate that, tutorials are created so people can learn, if you understand idea, code shape isn't important, GUI, jass etc.I don't make tutorials for GUI so I guess you will have to Upgrade your mapmaking skills by Researching my map.
Yes you can.
Check Daytime trigger in this map:
http://www.hiveworkshop.com/forums/map-development-202/6-aos-priest-vs-necro-207129/