• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Killing units

Status
Not open for further replies.
Level 24
Joined
Aug 1, 2013
Messages
4,657
The biggest reason is that dead units still exists... at least I believe that is.
Removing them will clear the data of those units.
Dead units might also be removed as soon as their corpse has been on the ground too longbut I don't really know.
 
Level 2
Joined
Jan 22, 2013
Messages
11
Another small thing which may or may not have an effect is that if you kill the units, yes the animations and etc will go off which means the corpses remain meaning that players who own units that interact with corpses (necromancers, death knights, ghouls etc) will gain an advantage. Might not be that big of a deal but it all depends on what kind of map and units you have and are making.
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
Not sure but wont killing a unit give exp ? So... yea use Remove.

Another thing:

If you are upgrading into another race shouldn't something like "replace" be used ?

If every unit of the first race (the one which goes away) has a counterpart of the second race.
so you create a list of units and check if the unit is equal to... Something like:

Pick all units for player
== For loop IndexVar(0 to NumberOfDifferentUnits)
==== if (picked unit) = RaceONEUnit[IndexVar]
====== Replace (picked unit) with RaceTWOUnit[IndexVar]
====== Break
==== else
====|empty|
 
Level 6
Joined
May 20, 2014
Messages
228
> Not sure but wont killing a unit give exp ? So... yea use Remove.

Killed units via triggers don't give exp, so it's perfectly safe to use kill function. Though, remove would be better in this case.
 
Status
Not open for further replies.
Top