Troll-Brain
You can change this now in User CP.
- Reaction score
- 85
I'm still waiting for benchmarks.
Will you post it or should i do them myself ?
Will you post it or should i do them myself ?
library Test initializer init
globals
private boolexpr B1
private boolexpr B2
private trigger Trig
endglobals
private function F1 takes nothing returns boolean
return true
endfunction
private function F2 takes nothing returns boolean
return true
endfunction
private function F3 takes nothing returns boolean
return true
endfunction
private function Actions takes nothing returns nothing
call EnableTrigger(Trig)
call TriggerSleepAction(20.)
//call BJDebugMsg("end")
call DisableTrigger(Trig)
endfunction
private function DoTheTest takes nothing returns nothing
//call BJDebugMsg("run")
set B1 = And(Condition(function F1),Condition(function F2))
set B2 = And(B1,Condition(function F3))
call DestroyBoolExpr(B1)
call DestroyBoolExpr(B2)
//set B1 = null
//set B2 = null
endfunction
private function init takes nothing returns nothing
local trigger trig = CreateTrigger()
set Trig = CreateTrigger()
call TriggerRegisterTimerEvent(Trig,0.01,true)
call TriggerAddAction(Trig,function DoTheTest)
call DisableTrigger(Trig)
call TriggerRegisterPlayerEventEndCinematic(trig,Player(0))
call TriggerAddAction(trig, function Actions)
endfunction
endlibrary
Test it ?No, if the variable set to another value, original value will be removed, I think.
lolwut?Has anyone really been far even as decided to use even go want to do look more like?
It leaks, it's minor but it's still a leak.What, setting the value to something else instead of null?
// _ __ _______ _ ___
// | |/ / |__ __(_) |__ \
// | ' / ___ _ _| | _ _ __ ___ ___ _ __ ___ ) |
// | < / _ \ | | | | | | '_ ` _ \ / _ \ '__/ __| / /
// | . \ __/ |_| | | | | | | | | | __/ | \__ \/ /_
// |_|\_\___|\__, |_| |_|_| |_| |_|\___|_| |___/____|
// __/ |
// |___/
// This one is nice too
// _ __ _____ _ _____
// | | / / |_ _(_) / __ \
// | |/ / ___ _ _| | _ _ __ ___ ___ _ __ ___ `' / /'
// | \ / _ \ | | | | | | '_ ` _ \ / _ \ '__/ __| / /
// | |\ \ __/ |_| | | | | | | | | | __/ | \__ \./ /___
// \_| \_/\___|\__, \_/ |_|_| |_| |_|\___|_| |___/\_____/
// __/ |
// |____/
He's right. But this has nothing to do with KT2 anymore at all. This is a new leak altogether. Shift discussion here.>What, setting the value to something else instead of null?
It leaks, it's minor but it's still a leak.
I know it's unbelievable, but you can test it yourself, just test my code with the comments for the setting nulls, and then with theses comments removed.
That's because HSAS is a general struct attachment system and this is a timer system. Two completely different things with two completely different purposes.Yummy!
Compared to HSAS by PandaMine this is easy as **** to use (although his system attaches to other handles as well).
You never need to null struct variables even if you are using HSAS. Struct variables themselves are just integers. HSAS refers to nulling the local handle variables, which is something that you should be doing anyway regardless of what system you're using.One last question. I don't need to null struct variables actually do I?
I did that til now because it was necessary in HSAS. But normally I don't need to or?
Yes.Would it be possible to add some functions for pausing this TAZO timer outside of callback, as well as some TimerGetRemaining and TimerGetElapsed functions, or just some way to get the timer that runs some specific instance?
scope revivehero initializer I
private function C takes nothing returns boolean
return IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) and IsUnitIllusion(GetTriggerUnit()) == false
endfunction
//the following comments are just notes considering you cannot
//view the unit id in the terrain editor
//call KillUnit( gg_unit_nhmc_0117 )
//call KillUnit( gg_unit_nder_0195 )
//call KillUnit( gg_unit_nshe_0196 )
//call KillUnit( gg_unit_nrac_0197 )
//call KillUnit( gg_unit_ndog_0190 )
//call KillUnit( gg_unit_necr_0199 )
//call KillUnit( gg_unit_nfro_0201 )
//call KillUnit( gg_unit_npng_0189 )
//call KillUnit( gg_unit_nfbr_0162 )
//call KillUnit( gg_unit_ncrb_0148 )
private function A takes nothing returns nothing
local real x
local real y
call TriggerSleepAction(I2R(GetUnitLevel(GetTriggerUnit())) * 1.75 + 10.00)
if GetOwningPlayer(GetTriggerUnit()) == Player(2) then
set x = GetUnitX(gg_unit_nshe_0196)
set y = GetUnitY(gg_unit_nshe_0196)
else
if GetOwningPlayer(GetTriggerUnit()) == Player(3) then
set x = GetUnitX(gg_unit_npng_0189)
set y = GetUnitY(gg_unit_npng_0189)
else
if GetOwningPlayer(GetTriggerUnit()) == Player(4) then
set x = GetUnitX(gg_unit_necr_0199)
set y = GetUnitY(gg_unit_necr_0199)
else
if GetOwningPlayer(GetTriggerUnit()) == Player(5) then
set x = GetUnitX(gg_unit_nfbr_0162)
set y = GetUnitY(gg_unit_nfbr_0162)
else
if GetOwningPlayer(GetTriggerUnit()) == Player(6) then
set x = GetUnitX(gg_unit_nder_0195)
set y = GetUnitY(gg_unit_nder_0195)
else
if GetOwningPlayer(GetTriggerUnit()) == Player(8) then
set x = GetUnitX(gg_unit_nrac_0197)
set y = GetUnitY(gg_unit_nrac_0197)
else
if GetOwningPlayer(GetTriggerUnit()) == Player(7) then
set x = GetUnitX(gg_unit_nfro_0201)
set y = GetUnitY(gg_unit_nfro_0201)
else
if GetOwningPlayer(GetTriggerUnit()) == Player(10) then
set x = GetUnitX(gg_unit_ndog_0190)
set y = GetUnitY(gg_unit_ndog_0190)
else
if GetOwningPlayer(GetTriggerUnit()) == Player(11) then
set x = GetUnitX(gg_unit_ncrb_0148)
set y = GetUnitY(gg_unit_ncrb_0148)
if GetOwningPlayer(GetTriggerUnit()) == Player(9) then
set x = GetUnitX(gg_unit_nhmc_0117)
set y = GetUnitY(gg_unit_nhmc_0117)
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
call ReviveHero(GetTriggerUnit(), x,y,true)
endfunction
//===========================================================================
private function I takes nothing returns nothing
local trigger t = CreateTrigger( )
call TAF_PUE( t, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( t, Condition( function C ) )
call TriggerAddAction( t, function A )
endfunction
endscope
scope revivehero initializer I
private struct Data
real x
real y
unit hero
endstruct
private function AfterWait takes nothing returns boolean
local Data d=Data(KT_GetData())
call ReviveHero(d.hero,d.x,d.y,true)
call d.destroy()
return true
endfunction
private function C takes nothing returns boolean
return IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) and IsUnitIllusion(GetTriggerUnit()) == false
endfunction
//the following comments are just notes considering you cannot
//view the unit id in the terrain editor
//call KillUnit( gg_unit_nhmc_0117 )
//call KillUnit( gg_unit_nder_0195 )
//call KillUnit( gg_unit_nshe_0196 )
//call KillUnit( gg_unit_nrac_0197 )
//call KillUnit( gg_unit_ndog_0190 )
//call KillUnit( gg_unit_necr_0199 )
//call KillUnit( gg_unit_nfro_0201 )
//call KillUnit( gg_unit_npng_0189 )
//call KillUnit( gg_unit_nfbr_0162 )
//call KillUnit( gg_unit_ncrb_0148 )
private function A takes nothing returns nothing
local Data d=Data.create()
local real x
local real y
if GetOwningPlayer(GetTriggerUnit()) == Player(2) then
set x = GetUnitX(gg_unit_nshe_0196)
set y = GetUnitY(gg_unit_nshe_0196)
else
if GetOwningPlayer(GetTriggerUnit()) == Player(3) then
set x = GetUnitX(gg_unit_npng_0189)
set y = GetUnitY(gg_unit_npng_0189)
else
if GetOwningPlayer(GetTriggerUnit()) == Player(4) then
set x = GetUnitX(gg_unit_necr_0199)
set y = GetUnitY(gg_unit_necr_0199)
else
if GetOwningPlayer(GetTriggerUnit()) == Player(5) then
set x = GetUnitX(gg_unit_nfbr_0162)
set y = GetUnitY(gg_unit_nfbr_0162)
else
if GetOwningPlayer(GetTriggerUnit()) == Player(6) then
set x = GetUnitX(gg_unit_nder_0195)
set y = GetUnitY(gg_unit_nder_0195)
else
if GetOwningPlayer(GetTriggerUnit()) == Player(8) then
set x = GetUnitX(gg_unit_nrac_0197)
set y = GetUnitY(gg_unit_nrac_0197)
else
if GetOwningPlayer(GetTriggerUnit()) == Player(7) then
set x = GetUnitX(gg_unit_nfro_0201)
set y = GetUnitY(gg_unit_nfro_0201)
else
if GetOwningPlayer(GetTriggerUnit()) == Player(10) then
set x = GetUnitX(gg_unit_ndog_0190)
set y = GetUnitY(gg_unit_ndog_0190)
else
if GetOwningPlayer(GetTriggerUnit()) == Player(11) then
set x = GetUnitX(gg_unit_ncrb_0148)
set y = GetUnitY(gg_unit_ncrb_0148)
if GetOwningPlayer(GetTriggerUnit()) == Player(9) then
set x = GetUnitX(gg_unit_nhmc_0117)
set y = GetUnitY(gg_unit_nhmc_0117)
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
set d.x=x
set d.y=y
set d.hero=GetTriggerUnit()
call KT_Add(function AfterWait,d,I2R(GetUnitLevel(GetTriggerUnit())) * 1.75 + 10.00)
endfunction
//===========================================================================
private function I takes nothing returns nothing
local trigger t = CreateTrigger( )
call TAF_PUE( t, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( t, Condition( function C ) )
call TriggerAddAction( t, function A )
endfunction
endscope
scope revivehero initializer I
private struct Data
unit hero
endstruct
private function AfterWait takes nothing returns boolean
local Data d=KT_GetData()
local real x
local real y
if GetOwningPlayer(d.hero) == Player(2) then
set x = GetUnitX(gg_unit_nshe_0196)
set y = GetUnitY(gg_unit_nshe_0196)
else
if GetOwningPlayer(d.hero) == Player(3) then
set x = GetUnitX(gg_unit_npng_0189)
set y = GetUnitY(gg_unit_npng_0189)
else
if GetOwningPlayer(d.hero) == Player(4) then
set x = GetUnitX(gg_unit_necr_0199)
set y = GetUnitY(gg_unit_necr_0199)
else
if GetOwningPlayer(d.hero) == Player(5) then
set x = GetUnitX(gg_unit_nfbr_0162)
set y = GetUnitY(gg_unit_nfbr_0162)
else
if GetOwningPlayer(d.hero) == Player(6) then
set x = GetUnitX(gg_unit_nder_0195)
set y = GetUnitY(gg_unit_nder_0195)
else
if GetOwningPlayer(d.hero) == Player(8) then
set x = GetUnitX(gg_unit_nrac_0197)
set y = GetUnitY(gg_unit_nrac_0197)
else
if GetOwningPlayer(d.hero) == Player(7) then
set x = GetUnitX(gg_unit_nfro_0201)
set y = GetUnitY(gg_unit_nfro_0201)
else
if GetOwningPlayer(d.hero) == Player(10) then
set x = GetUnitX(gg_unit_ndog_0190)
set y = GetUnitY(gg_unit_ndog_0190)
else
if GetOwningPlayer(d.hero) == Player(11) then
set x = GetUnitX(gg_unit_ncrb_0148)
set y = GetUnitY(gg_unit_ncrb_0148)
if GetOwningPlayer(d.hero) == Player(9) then
set x = GetUnitX(gg_unit_nhmc_0117)
set y = GetUnitY(gg_unit_nhmc_0117)
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
call ReviveHero(d.hero, x,y,true)
call d.destroy()
return true
endfunction
private function C takes nothing returns boolean
return IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) and IsUnitIllusion(GetTriggerUnit()) == false
endfunction
//the following comments are just notes considering you cannot
//view the unit id in the terrain editor
//call KillUnit( gg_unit_nhmc_0117 )
//call KillUnit( gg_unit_nder_0195 )
//call KillUnit( gg_unit_nshe_0196 )
//call KillUnit( gg_unit_nrac_0197 )
//call KillUnit( gg_unit_ndog_0190 )
//call KillUnit( gg_unit_necr_0199 )
//call KillUnit( gg_unit_nfro_0201 )
//call KillUnit( gg_unit_npng_0189 )
//call KillUnit( gg_unit_nfbr_0162 )
//call KillUnit( gg_unit_ncrb_0148 )
private function A takes nothing returns nothing
local Data d=Data.create()
set d.hero=GetTriggerUnit()
call KT_Add(function AfterWait,d,I2R(GetUnitLevel(d.hero)) * 1.75 + 10.00)
endfunction
//===========================================================================
private function I takes nothing returns nothing
local trigger t = CreateTrigger( )
call TAF_PUE( t, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( t, Condition( function C ) )
call TriggerAddAction( t, function A )
endfunction
endscope