- Joined
- Jun 26, 2020
- Messages
- 1,928
I heard you should "null" the variables when you don't need it anymore, but I saw people sometimes didn't do this when they recommend triggers, so when is necessary do this?
I heard that, but I mean when some people who seem to know about the topic do not do this with that things, are they doing it wrong?, and Have I do this also with global variables and in GUI?You do need to null Groups, Forces, Units, Points (Locations), etc... AFTER removing/destroying them.
You only null local variables, and you need to do it in GUI as well.I heard that, but I mean when some people who seem to know about the topic do not do this with that things, are they doing it wrong?, and Have I do this also with global variables and in GUI?
Oh thank you, and one more question: I heard I have to avoid the "Do nothing" function, but I have to use it if I use the "If/Then/Else"(One action) function, Is it necessary?You only null local variables, and you need to do it in GUI as well.
Global variables will always have some value.
You can use:Oh thank you, and one more question: I heard I have to avoid the "Do nothing" function, but I have to use it if I use the "If/Then/Else"(One action) function, Is it necessary?
I know I can do that, but that will make my trigger look less elegant, when I ask Is it necessary? I mean Is it necessary avoid that function?You can use:
And no, it does nothing. I think it was needed a while back in the early days of wc3.
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Then - Actions
Else - Actions
I really can't confirm or deny whether it's actually a bad thing.
I don't think you would even notice the difference.So I have to remake all the If/Then/Else to optimimize my map.
I wanna make my map the most possible optimized.I don't think you would even notice the difference.
hmmmUse "Comment" instead of "Do Nothing" if you're gonna use those single-lined statements.
If ((Random integer number between 1 and 2) Equal to 1) then do (Player - Add 1 to (Triggering player) Current gold) else do (-------- --------)
Well... about that... Comment didn't exist, either.They could have filled the else part with comments, so Do Nothing wasn't necessary back then. It is just that they did not realize this hehe.
JeWell... about that... Comment didn't exist, either.
Local unit u
u=GetAtacker()
call Wait(2.00)
set udg_Temp_Unit=u
call some_funct(udg_Temp_Unit)
u=null
type agent extends handle // all reference counted objects
Oh I miss the word "agent", thank you.Memory Leaks Again, this tutorial explains it all.
But yes, only agents need to be nulled (local variables only), you don't null strings, they will always leak, but once. Meaning that once a character is in the string table it won't leak anymore.
igamestate
image
itempool
itemtype
lightning
limitop
mapcontrol
mapdensity
mapflag
mapsetting
mapvisibility
pathingtype
placement
playercolor
playerevent
playergameresult
playerscore
playerslotstate
playerstate
playerunitevent
race
racepreference
raritycontrol
soundtype
startlocprio
terraindeformation
texmapflags
texttag
triggeraction
triggercondition
ubersplat
unitevent
unitpool
unitstate
unittype
version
volumegroup
weapontype
weathereffect
widgetevent