HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

ForGroup Picking Up Dead Units

05-26-2006, 10:20 PM#1
MysticGeneral
Are there any conditions I can check to see if it's not picking up the bodies of dead units? Or is the only way to fix this through Gameplay Constants?
05-26-2006, 10:33 PM#2
Naakaloh
Remove any units from the group that are dead. I believe the condition you'll want to check is if the unit has 0 or less life or

Collapse JASS:
IsUnitType( whichUnit, UNIT_TYPE_DEAD ) 
05-26-2006, 10:36 PM#3
MysticGeneral
Ugh, didn't think of that. Thanks. I originally set the corpse removal to 0.00 seconds in the gameplay constants. But I kinda need them now O.o Anyways, thanks again.
05-27-2006, 01:15 AM#4
The)TideHunter(
Btw, Naakaloh kinda confused me, because he said remove them.
In the ForGroup, which takes a condition, just make it a condition there like this:

Trigger:
Unit Group - Pick every unit in Your Critera matching (((Matching unit) is dead) Equal to False)) and do 'Some Actions
05-27-2006, 01:32 AM#5
MysticGeneral
I didn't use GUI for that. I just did

Collapse JASS:
function PF_Cc_cb takes nothing returns boolean
return ( IsUnitType( whichUnit, UNIT_TYPE_DEAD ) == false )
endfunction
05-27-2006, 01:43 AM#6
The)TideHunter(
O ok
05-28-2006, 03:26 PM#7
BertTheJasser
You forgot one of the most lame bugs from Blizzard Entertainment appearing when using a single unittypecheck statement a boolexpr. You must do it in this way to ensure it to work at anytime, even if a unit has multiple unittypes:
Collapse JASS:
function PF_Cc_cb takes nothing returns boolean
return not ( IsUnitType( whichUnit, UNIT_TYPE_DEAD )!=null )
endfunction
(I am not 100% sure if it is != or ==. So exchange that if it doesn't work.) Hope I could help
05-28-2006, 07:22 PM#8
blu_da_noob
Uh, that's not right bert. The actual bug is you have to use == false, rather than not, which Mystic already did.
05-29-2006, 01:06 PM#9
BertTheJasser
Tell me if I am wrong, but this is vexorian is unittype safe function. So I guess I am right.
05-29-2006, 03:21 PM#10
Blade.dk
Quote:
Originally Posted by blu_da_noob
Uh, that's not right bert. The actual bug is you have to use == false, rather than not, which Mystic already did.

The bug with IsUnitType is boolexpr is when you return the boolean directly, you just need to compare it to something (in most cases true) and it works. not seemed to do the same thing fine last time I checked.
05-29-2006, 03:32 PM#11
blu_da_noob
Hmm, sorry, my mistake. That is correct, it was returning different integers rather than the standard 1/0 for booleans, so it has to be compared to something.