• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] kill\explode\remove

Status
Not open for further replies.
Level 11
Joined
Dec 31, 2007
Messages
780
ive been searching in internet for a good explanation about this.. and i only got more confused than what i used to be:ugly:

so... i need some nice person to explain... which is the best way to remove a unit from the MEMORY... kill unit leaks... i know... but ive seen somewhere that remove also leaks... how about hide unit,Explode unit? or just explode?...

Thx in advance ^^:wink:
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
Make unit not decay and not revivable
hide and kill it
it will be in memory for some time
but it will get repleaced after some seconds

and HINDYhat sais Remove Unit is not safe about leaks
 
Level 9
Joined
May 27, 2006
Messages
498
As its stated in its name, it explodes unit. When Blizz was creating W3, nobody knew that leaks exist ; o

You'd check if unit is revivable and if its not = remove it/do what O2 said. Im not sure if there is a condition checking if unit is revivable, though.
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
raft, people have known that leaks exist for ages, they're a basic programming concept. It's just that most languages have garbage collectors to deal with that sort of garbage, or only work in primitive types which don't need to worry about it.

Anyways, RemoveUnit doesn't directly leak, but it isn't safe due to the fact that it doesn't fire death events (though Kill+Remove will).

KillUnit is fine, but the unit takes a while to decay.

SetUnitExploded effectively skips decay upon KillUnit, and changes the death animation to a blood splash.
 
Status
Not open for further replies.
Top