HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Corpse Detection

04-12-2007, 06:32 PM#1
Rising_Dusk
Ran a search and nothing there could really help me.
Is there any way to accurately detect if a unit is an exploitable corpse without using some dummy ability derivation of raise dead/carrion beetles?

My map has the potential to "explode" units when they die, but any configuration of boolean checks I do on a unit cannot tell me if the unit is a raisable corpse or not.
Something I'm missing or no?
04-12-2007, 06:37 PM#2
blu_da_noob
Revivable corpse? No, sadly :/.
Checking with a raise dead caster shouldn't be too hard though.
04-12-2007, 06:39 PM#3
Rising_Dusk
I sort of expected that answer, but with MSN being a crackwhore and not letting me on I wanted to be sure.
Thanks Blu.
04-12-2007, 06:42 PM#4
blu_da_noob
MSN seems to be ok now. Or I managed to sign on roughly 10 minutes ago (eventually). I don't know if it's still giving problems, and I'm not signing off to check :P
04-12-2007, 06:47 PM#5
moyack
I don't know, but I think this script could work.

Collapse JASS:
function Test_IsDead takes nothing returns boolean
    return GetWidgetLife(GetFilterUnit()) < 0.405
endfunction

function Test_GetCorpse takes unit c , real r returns unit
    // this function will return a corpse (in theory) or null
    local group g = CreateGroup()
    local boolexpr Cnd = Condition(function Test_IsDead)
    local unit u
    call GroupEnumUnitsInRange(g, GetUnitX(c), GetUnitY(c), r, Cnd)
    set u = FirstOfGroup(g)
    call DestroyGroup(g)
    call DestroyBoolExpr(Cnd)
    set g = null
    set Cnd = null
    return u
endfunction

I think it works for one reason: I had issues grouping units in a range, and many times I get included dead units (the corpses).
04-12-2007, 06:50 PM#6
Rising_Dusk
Well, I can detect "a corpse" but the issue then becomes if the "corpse" was blown up or not.
I think Blu is right in saying you can't detect whether a corpse is reviveable or not.

I'll just use a raise dead dummy spell and detect that.
04-12-2007, 06:53 PM#7
blu_da_noob
It also won't detect if it's a revivable unit or not. For example, a unit isn't revivable until the corpse appears, but that would return true as the death animation is being played.
04-12-2007, 06:59 PM#8
moyack
A blown corpse should return a null unit, in theory, doesn't it?

To make a better question, if a corpse decays completely, that unit in a group is removed or not? as far as I know it happens.

Quote:
Originally Posted by blu_da_noob
It also won't detect if it's a revivable unit or not. For example, a unit isn't revivable until the corpse appears, but that would return true as the death animation is being played.
Hmmm, yes... I forgot that
04-12-2007, 07:09 PM#9
blu_da_noob
You can never tell the difference between just dead and revivable units with life checks.
04-12-2007, 07:37 PM#10
Captain Griffen
You could just make your own function and add unit types to an array with simple hash based on their ID, then check on that.
04-12-2007, 08:15 PM#11
blu_da_noob
Quote:
Originally Posted by Captain Griffen
You could just make your own function and add unit types to an array with simple hash based on their ID, then check on that.

I don't think you understand what I'm meaning. Even units that are set as revivable cannot be revived until their corpse appears. So a footman that is playing its death animation (having just died and having hp < 0.405) isn't revivable yet.
04-12-2007, 08:30 PM#12
Vexorian
You can't detect corpses, you can barely detect dead units (And it is actually very hard to make this bullet proff)
04-13-2007, 03:42 AM#13
Toink
But how did he script Bloodwell to force the player to target an area with 'corpses' ? >_>
04-13-2007, 03:50 AM#14
Rising_Dusk
That was the loser way.
I basically checked for dead units and just removed one arbitrarily.

It isn't accurate in that it picks a revivable unit (It can pick exploded units) and it can pick units during their death animations.
These are "little" things as they are that I wanted to fix.
04-13-2007, 03:52 AM#15
Toink
How about corpse explosion? I think I saw it here..